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

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

#include <oxr/actions/oxr_suggested_profile_array.h>

Collaboration diagram for oxr_suggested_profile_array:

Public Member Functions

XRT_NONNULL_ALL void oxr_suggested_profile_array_clear (struct oxr_suggested_profile_array *array)
 Frees all profiles on the suggested profile array.
 
XRT_NONNULL_ALL void oxr_suggested_profile_array_add (struct oxr_suggested_profile_array *array, struct oxr_suggested_profile *profile)
 Add a suggested profile to the array.
 
XRT_NONNULL_ALL XRT_CHECK_RESULT XrResult oxr_suggested_profile_array_clone (const struct oxr_suggested_profile_array *src, struct oxr_suggested_profile_array *dst)
 Clone a suggested profile array.
 
XRT_NONNULL_ALL bool oxr_suggested_profile_array_find_by_path (const struct oxr_suggested_profile_array *array, XrPath path, struct oxr_suggested_profile **out_p)
 Find a suggested profile in the array by its path.
 

Data Fields

struct oxr_suggested_profile ** profiles
 
size_t count
 

Detailed Description

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

Member Function Documentation

◆ oxr_suggested_profile_array_add()

XRT_NONNULL_ALL void oxr_suggested_profile_array_add ( struct oxr_suggested_profile_array *  array,
struct oxr_suggested_profile *  profile 
)

Add a suggested profile to the array.

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

Parameters
arraySuggested profile array to add to, must not be NULL
profileSuggested profile to add, must not be NULL

References U_ARRAY_REALLOC_OR_FREE.

◆ oxr_suggested_profile_array_clear()

XRT_NONNULL_ALL void oxr_suggested_profile_array_clear ( struct oxr_suggested_profile_array *  array)

Frees all profiles on the suggested profile array.

Frees all suggested 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
arraySuggested profile array to destroy, must not be NULL

◆ oxr_suggested_profile_array_clone()

XRT_NONNULL_ALL XRT_CHECK_RESULT XrResult oxr_suggested_profile_array_clone ( const struct oxr_suggested_profile_array *  src,
struct oxr_suggested_profile_array *  dst 
)

Clone a suggested profile array.

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

Parameters
srcSource suggested profile array to clone, must not be NULL
dstDestination suggested profile array, must not be NULL
Returns
XR_SUCCESS on success, XR_ERROR_RUNTIME_FAILURE on allocation failure

References U_TYPED_ARRAY_CALLOC.

◆ oxr_suggested_profile_array_find_by_path()

XRT_NONNULL_ALL bool oxr_suggested_profile_array_find_by_path ( const struct oxr_suggested_profile_array *  array,
XrPath  path,
struct oxr_suggested_profile **  out_p 
)

Find a suggested profile in the array by its path.

Searches the array for a suggested profile with the matching XrPath.

Parameters
arraySuggested profile array to search, must not be NULL
pathXrPath to search for
[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::path.


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