|
Monado OpenXR Runtime
|
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>

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 |
Manages an array of interaction profiles, does not have a init function but must be zero initialized where it is declared.
| 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.
| array | Interaction profile array to add to, must not be NULL |
| profile | Interaction profile to add, must not be NULL |
References U_ARRAY_REALLOC_OR_FREE.
| 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.
| array | Interaction profile array to destroy, must not be NULL |
References oxr_interaction_profile::oxr_interaction_profile_destroy().
| 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.
| src | Source interaction profile array to clone, must not be NULL |
| dst | Destination interaction profile array, must not be NULL |
References oxr_interaction_profile::oxr_interaction_profile_clone(), and U_TYPED_ARRAY_CALLOC.
| 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.
| array | Interaction profile array to search, must not be NULL. | |
| [out] | out_p | Pointer to store the found interaction profile, must not be NULL. Set to NULL if not found. |
References xrt_device::binding_profile_count, xrt_binding_profile::name, and xrt_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.
| array | Interaction profile array to search, must not be NULL | |
| name | Device name to search for, can be XRT_DEVICE_INVALID. | |
| [out] | out_p | Pointer to store the found interaction profile, must not be NULL. Set to NULL if not found. |
References ARRAY_SIZE.
| 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.
| array | Interaction profile array to search, must not be NULL | |
| path | XrPath to search for | |
| [out] | out_p | Pointer to store the found interaction profile, must not be NULL. Set to NULL if not found. |