Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_handle_array.h
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief A dynamic array of handles.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup oxr_main
8 */
9
10#pragma once
11
12
13struct oxr_handle_base;
14
15/*!
16 * Manages an array of handles, does not have a init function but must be zero initialized where it is declared.
17 */
19{
20 struct oxr_handle_base **handles;
21 uint32_t count;
22 uint32_t capacity;
23};
24
25/*!
26 * Destroys all handles in the array, and the array itself.
27 */
28XrResult
29oxr_handle_array_destroy(struct oxr_logger *log, struct oxr_handle_array *array, int level);
30
31/*!
32 * Adds a handle to the array.
33 */
34bool
35oxr_handle_array_add(struct oxr_handle_array *array, struct oxr_handle_base *handle);
36
37/*!
38 * Removes the handle at the given index from the array, shifting all later handles down by one.
39 */
40bool
41oxr_handle_array_remove(struct oxr_handle_array *array, uint32_t index);
XrResult oxr_handle_array_destroy(struct oxr_logger *log, struct oxr_handle_array *array, int level)
Destroys all handles in the array, and the array itself.
Definition oxr_handle_array.c:22
bool oxr_handle_array_add(struct oxr_handle_array *array, struct oxr_handle_base *handle)
Adds a handle to the array.
Definition oxr_handle_array.c:45
bool oxr_handle_array_remove(struct oxr_handle_array *array, uint32_t index)
Removes the handle at the given index from the array, shifting all later handles down by one.
Definition oxr_handle_array.c:70
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
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44