|
Monado OpenXR Runtime
|
Used to hold diverse child handles and ensure orderly destruction. More...
#include <oxr/oxr_objects.h>


Public Member Functions | |
| XrResult | oxr_handle_destroy (struct oxr_logger *log, struct oxr_handle_base *hb) |
| Destroy the handle's object, as well as all child handles recursively. | |
Data Fields | |
| uint64_t | debug |
| Magic (per-handle-type) value for debugging. | |
| struct oxr_handle_base * | parent |
| Pointer to this object's parent handle holder, if any. | |
| struct oxr_handle_base * | children [256] |
| Array of children, if any. | |
| enum oxr_handle_state | state |
| Current handle state. | |
| oxr_handle_destroyer | destroy |
| Destroy the object this handle refers to. | |
Protected Member Functions | |
| XrResult | oxr_handle_init (struct oxr_logger *log, struct oxr_handle_base *hb, uint64_t debug, oxr_handle_destroyer destroy, struct oxr_handle_base *parent) |
| Initialize a handle holder, and if a parent is specified, update its child list to include this handle. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| typedef XrResult(* | oxr_handle_destroyer) (struct oxr_logger *log, struct oxr_handle_base *hb) |
| Function pointer type for a handle destruction function. | |
| XrResult | oxr_handle_allocate_and_init (struct oxr_logger *log, size_t size, uint64_t debug, oxr_handle_destroyer destroy, struct oxr_handle_base *parent, void **out) |
| Allocate some memory for use as a handle, and initialize it as a handle. | |
| #define | OXR_ALLOCATE_HANDLE(LOG, OUT, DEBUG, DESTROY, PARENT) oxr_handle_allocate_and_init(LOG, sizeof(*OUT), DEBUG, DESTROY, PARENT, (void **)&OUT) |
| Allocates memory for a handle and evaluates to an XrResult. | |
| #define | OXR_ALLOCATE_HANDLE_OR_RETURN(LOG, OUT, DEBUG, DESTROY, PARENT) |
| Allocate memory for a handle, returning in case of failure. | |
| const char * | oxr_handle_state_to_string (enum oxr_handle_state state) |
| Returns a human-readable label for a handle state. | |
Used to hold diverse child handles and ensure orderly destruction.
Each object referenced by an OpenXR handle should have one of these as its first element, thus "extending" this class.
|
protected |
Initialize a handle holder, and if a parent is specified, update its child list to include this handle.
|
related |
Allocates memory for a handle and evaluates to an XrResult.
| LOG | pointer to struct oxr_logger |
| OUT | the pointer to handle struct type you already created. |
| DEBUG | Magic per-type debugging constant |
| DESTROY | Handle destructor function |
| PARENT | a parent handle, if any |
Use when you want to do something other than immediately returning in case of failure. If returning immediately is OK, see OXR_ALLOCATE_HANDLE_OR_RETURN().
|
related |
Allocate memory for a handle, returning in case of failure.
| LOG | pointer to struct oxr_logger |
| OUT | the pointer to handle struct type you already created. |
| DEBUG | Magic per-type debugging constant |
| DESTROY | Handle destructor function |
| PARENT | a parent handle, if any |
Will return an XrResult from the current function if something fails. If that's not OK, see OXR_ALLOCATE_HANDLE().
Referenced by oxr_instance::oxr_instance_create(), oxr_space_xdev_pose_create(), and oxr_swapchain_common_create().
|
related |
Allocate some memory for use as a handle, and initialize it as a handle.
Mainly for internal use - use OXR_ALLOCATE_HANDLE instead which wraps this.
| struct oxr_handle_base* oxr_handle_base::children[256] |
Array of children, if any.
Referenced by oxr_handle_do_destroy(), and oxr_session::oxr_session_attach_action_sets().
| uint64_t oxr_handle_base::debug |
Magic (per-handle-type) value for debugging.
| oxr_handle_destroyer oxr_handle_base::destroy |
Destroy the object this handle refers to.
| struct oxr_handle_base* oxr_handle_base::parent |
Pointer to this object's parent handle holder, if any.
Referenced by oxr_handle_do_destroy().
| enum oxr_handle_state oxr_handle_base::state |
Current handle state.
Referenced by oxr_session_change_state().