15#include "../oxr_logger.h"
102 oxr_handle_destroyer destroy,
128 oxr_handle_destroyer destroy,
145#define OXR_ALLOCATE_HANDLE(LOG, OUT, DEBUG, DESTROY, PARENT) \
146 oxr_handle_allocate_and_init(LOG, sizeof(*OUT), DEBUG, DESTROY, PARENT, (void **)&OUT)
162#define OXR_ALLOCATE_HANDLE_OR_RETURN(LOG, OUT, DEBUG, DESTROY, PARENT) \
164 XrResult allocResult = OXR_ALLOCATE_HANDLE(LOG, OUT, DEBUG, DESTROY, PARENT); \
165 if (allocResult != XR_SUCCESS) { \
166 return allocResult; \
oxr_handle_state
State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other uns...
Definition oxr_handle_base.h:43
@ OXR_HANDLE_STATE_DESTROYED
State after successful oxr_handle_destroy.
Definition oxr_handle_base.h:51
@ OXR_HANDLE_STATE_LIVE
State after successful oxr_handle_init.
Definition oxr_handle_base.h:48
@ OXR_HANDLE_STATE_UNINITIALIZED
State during/before oxr_handle_init, or after failure.
Definition oxr_handle_base.h:45
A dynamic array of handles.
Manages an array of handles, does not have a init function but must be zero initialized where it is d...
Definition oxr_handle_array.h:19
Used to hold diverse child handles and ensure orderly destruction.
Definition oxr_handle_base.h:61
struct oxr_handle_base * parent
Pointer to this object's parent handle holder, if any.
Definition oxr_handle_base.h:68
uint64_t debug
Magic (per-handle-type) value for debugging.
Definition oxr_handle_base.h:63
enum oxr_handle_state state
Current handle state.
Definition oxr_handle_base.h:78
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 handl...
XrResult(* oxr_handle_destroyer)(struct oxr_logger *log, struct oxr_handle_base *hb)
Function pointer type for a handle destruction function.
Definition oxr_handle_base.h:34
oxr_handle_destroyer destroy
Destroy the object this handle refers to.
Definition oxr_handle_base.h:83
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.
struct oxr_handle_array children
Array of children, if any.
Definition oxr_handle_base.h:73
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44