Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_suggested_profile_array.c File Reference

Holds suggested profile array related functions. More...

Include dependency graph for oxr_suggested_profile_array.c:

Functions

void oxr_suggested_profile_array_clear (struct oxr_suggested_profile_array *array)
 
void oxr_suggested_profile_array_add (struct oxr_suggested_profile_array *array, struct oxr_suggested_profile *profile)
 
XrResult oxr_suggested_profile_array_clone (const struct oxr_suggested_profile_array *src, struct oxr_suggested_profile_array *dst)
 
bool oxr_suggested_profile_array_find_by_path (const struct oxr_suggested_profile_array *array, XrPath path, struct oxr_suggested_profile **out_p)
 
bool oxr_suggested_profile_array_find_by_device_name (const struct oxr_suggested_profile_array *array, const struct oxr_binding_registry *registry, enum xrt_device_name name, XrPath subaction_path, struct oxr_suggested_profile **out_p)
 Find a suggested profile whose profile template has name and binds to the top-level subaction_path.
 
bool oxr_suggested_profile_array_find_rebinding_for_device_name (const struct oxr_suggested_profile_array *array, const struct oxr_binding_registry *registry, enum xrt_device_name target_device_name, XrPath subaction_path, struct oxr_suggested_profile **out_p, const struct oxr_rebinding_profile **out_rebinding)
 Find the first rebinding profile that targets target_device_name, whose target profile binds to the top-level subaction_path, and has a suggested source profile in array.
 

Detailed Description

Holds suggested profile array related functions.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Korcan Hussein korca.nosp@m.n.hu.nosp@m.ssein.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ oxr_suggested_profile_array_find_by_device_name()

bool oxr_suggested_profile_array_find_by_device_name ( const struct oxr_suggested_profile_array *  array,
const struct oxr_binding_registry *  registry,
enum xrt_device_name  name,
XrPath  subaction_path,
struct oxr_suggested_profile **  out_p 
)

Find a suggested profile whose profile template has name and binds to the top-level subaction_path.

This directly compares name against each suggested profile's generated template.

Parameters
arraySuggested profile array to search, must not be NULL
registryBinding registry the suggested profiles are looked up in, must not be NULL
nameXRT device name stored on the profile template
subaction_pathTop-level path the profile must bind to
[out]out_pFound suggested profile; NULL if not found. Must not be NULL.
Returns
true if a matching profile was found, false otherwise

References oxr_binding_profile::oxr_binding_profile_binds_to_subaction(), oxr_suggested_profile::path, oxr_binding_profile::registry, and oxr_suggested_profile::templ.

◆ oxr_suggested_profile_array_find_rebinding_for_device_name()

bool oxr_suggested_profile_array_find_rebinding_for_device_name ( const struct oxr_suggested_profile_array *  array,
const struct oxr_binding_registry *  registry,
enum xrt_device_name  target_device_name,
XrPath  subaction_path,
struct oxr_suggested_profile **  out_p,
const struct oxr_rebinding_profile **  out_rebinding 
)

Find the first rebinding profile that targets target_device_name, whose target profile binds to the top-level subaction_path, and has a suggested source profile in array.

The helper walks the registry's generated rebinding profiles in registry order. This lets template generation decide priority: higher-priority rebindings, such as generic controller rebindings, should be emitted earlier. For each matching rebinding target device, the helper looks for a suggested profile with the rebinding source profile path.

Parameters
arraySuggested profile array to search, must not be NULL
registryBinding registry whose rebinding profiles are walked, must not be NULL
target_device_nameDevice name the rebinding profile must target
subaction_pathTop-level path the rebinding target profile must bind to
[out]out_pSuggested source profile, or NULL if not found
[out]out_rebindingMatching rebinding profile, or NULL if not found
Returns
true if a matching rebinding and suggested profile were found

References oxr_binding_profile::device_name, oxr_binding_profile::oxr_binding_profile_binds_to_subaction(), oxr_binding_registry::rebindings, oxr_binding_profile::registry, oxr_rebinding_profile::source_profile_path, and oxr_rebinding_profile::target_profile_path.