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

Holds suggested profile array related functions. More...

#include "xrt/xrt_compiler.h"
#include "xrt/xrt_device.h"
#include "oxr_extension_support.h"
#include "oxr_forward_declarations.h"
#include "oxr_suggested_profile.h"
Include dependency graph for oxr_suggested_profile_array.h:

Go to the source code of this file.

Data Structures

struct  oxr_suggested_profile_array
 Manages an array of suggested profiles, does not have a init function but must be zero initialized where it is declared. More...
 

Functions

XRT_NONNULL_ALL bool oxr_suggested_profile_array_find_by_device_name (const struct oxr_suggested_profile_array *array, enum xrt_device_name name, struct oxr_suggested_profile **out_p)
 Find a suggested profile by the XRT device name stored on its profile template.
 
XRT_NONNULL_ALL 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, struct oxr_suggested_profile **out_p, const struct oxr_rebinding_profile **out_rebinding)
 Find the first rebinding profile that targets target_device_name and has a suggested source profile in array.
 

Detailed Description

Holds suggested profile array related functions.

Author
Jakob Bornecrantz tborn.nosp@m.ecra.nosp@m.ntz@n.nosp@m.vidi.nosp@m.a.com

Function Documentation

◆ oxr_suggested_profile_array_find_by_device_name()

XRT_NONNULL_ALL bool oxr_suggested_profile_array_find_by_device_name ( const struct oxr_suggested_profile_array *  array,
enum xrt_device_name  name,
struct oxr_suggested_profile **  out_p 
)

Find a suggested profile by the XRT device name stored on its profile template.

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

Parameters
arraySuggested profile array to search, must not be NULL
nameXRT device name stored on the profile template
[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_suggested_profile::templ.

◆ oxr_suggested_profile_array_find_rebinding_for_device_name()

XRT_NONNULL_ALL 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,
struct oxr_suggested_profile **  out_p,
const struct oxr_rebinding_profile **  out_rebinding 
)

Find the first rebinding profile that targets target_device_name 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
[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_registry::rebindings, oxr_binding_profile::registry, oxr_rebinding_profile::source_profile_path, and oxr_rebinding_profile::target_profile_path.