Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_interaction_profile_array Struct Reference

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

#include <oxr/actions/oxr_interaction_profile_array.h>

Collaboration diagram for oxr_interaction_profile_array:

Public Member Functions

void oxr_interaction_profile_array_clear (struct oxr_interaction_profile_array *array) XRT_NONNULL_ALL
 Frees all profiles on the interaction profile array.
 
void oxr_interaction_profile_array_add (struct oxr_interaction_profile_array *array, struct oxr_interaction_profile *profile) XRT_NONNULL_ALL
 Add an interaction profile to the array.
 
void oxr_interaction_profile_array_clone (const struct oxr_interaction_profile_array *src, struct oxr_interaction_profile_array *dst) XRT_NONNULL_ALL
 Clone an interaction profile array.
 
bool oxr_interaction_profile_array_find_by_path (const struct oxr_interaction_profile_array *array, XrPath path, struct oxr_interaction_profile **out_p) XRT_NONNULL_ALL
 Find an interaction profile in the array by its path.
 
bool oxr_interaction_profile_array_find_by_device_name (const struct oxr_interaction_profile_array *array, const struct oxr_instance_path_cache *cache, enum xrt_device_name name, struct oxr_interaction_profile **out_p) XRT_NONNULL_ALL
 Find an interaction profile in the array by device name.
 
bool oxr_interaction_profile_array_find_by_device (const struct oxr_interaction_profile_array *array, const struct oxr_instance_path_cache *cache, struct xrt_device *xdev, struct oxr_interaction_profile **out_p) XRT_NONNULL_FIRST
 Find an interaction profile in the array by device.
 

Data Fields

struct oxr_interaction_profile ** profiles
 
size_t count
 

Detailed Description

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

Member Function Documentation

◆ oxr_interaction_profile_array_add()

void oxr_interaction_profile_array_add ( struct oxr_interaction_profile_array array,
struct oxr_interaction_profile profile 
)

Add an interaction profile to the array.

The profile is added to the end of the array. The array takes ownership of the profile pointer.

Parameters
arrayInteraction profile array to add to, must not be NULL
profileInteraction profile to add, must not be NULL

References U_ARRAY_REALLOC_OR_FREE.

◆ oxr_interaction_profile_array_clear()

void oxr_interaction_profile_array_clear ( struct oxr_interaction_profile_array array)

Frees all profiles on the interaction profile array.

Frees all interaction profiles in the array and then frees the internal array does not free the struct passed in. After this call, the array structure is reset to an empty state.

Parameters
arrayInteraction profile array to destroy, must not be NULL

References oxr_interaction_profile::oxr_interaction_profile_destroy().

◆ oxr_interaction_profile_array_clone()

void oxr_interaction_profile_array_clone ( const struct oxr_interaction_profile_array src,
struct oxr_interaction_profile_array dst 
)

Clone an interaction profile array.

Creates a deep copy of the source array, including cloning all interaction profiles it contains. The destination array is first cleared (destroying any existing profiles) before cloning.

Parameters
srcSource interaction profile array to clone, must not be NULL
dstDestination interaction profile array, must not be NULL

References oxr_interaction_profile::oxr_interaction_profile_clone(), and U_TYPED_ARRAY_CALLOC.

◆ oxr_interaction_profile_array_find_by_device()

bool oxr_interaction_profile_array_find_by_device ( const struct oxr_interaction_profile_array array,
const struct oxr_instance_path_cache cache,
struct xrt_device xdev,
struct oxr_interaction_profile **  out_p 
)

Find an interaction profile in the array by device.

This function uses oxr_interaction_profile_array_find_by_device_name but also loops through the bindings xrt_device::binding_profiles mappings.

Parameters
arrayInteraction profile array to search, must not be NULL.
[out]out_pPointer to store the found interaction profile, must not be NULL. Set to NULL if not found.
Returns
true if a matching profile was found, false otherwise.

References xrt_device::binding_profile_count, xrt_binding_profile::name, and xrt_device::name.

◆ oxr_interaction_profile_array_find_by_device_name()

bool oxr_interaction_profile_array_find_by_device_name ( const struct oxr_interaction_profile_array array,
const struct oxr_instance_path_cache cache,
enum xrt_device_name  name,
struct oxr_interaction_profile **  out_p 
)

Find an interaction profile in the array by device name.

Maps a xrt_device_name to an interaction profile by searching through profile templates and then finding the matching profile in the array. There might be multiple OpenXR interaction profiles that map to a single device name, so the function continues searching until it finds a profile that exists in the array.

Parameters
arrayInteraction profile array to search, must not be NULL
nameDevice name to search for, can be XRT_DEVICE_INVALID.
[out]out_pPointer to store the found interaction profile, must not be NULL. Set to NULL if not found.
Returns
true if a matching profile was found, false otherwise

References ARRAY_SIZE.

◆ oxr_interaction_profile_array_find_by_path()

bool oxr_interaction_profile_array_find_by_path ( const struct oxr_interaction_profile_array array,
XrPath  path,
struct oxr_interaction_profile **  out_p 
)

Find an interaction profile in the array by its path.

Searches the array for an interaction profile with the matching XrPath.

Parameters
arrayInteraction profile array to search, must not be NULL
pathXrPath to search for
[out]out_pPointer to store the found interaction profile, must not be NULL. Set to NULL if not found.
Returns
true if a matching profile was found, false otherwise

The documentation for this struct was generated from the following file: