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

Registry-wide store of subaction payloads keyed by XrPath. More...

#include <oxr/actions/oxr_subaction_store.h>

Collaboration diagram for oxr_subaction_store:

Public Member Functions

XRT_CHECK_RESULT XrResult oxr_subaction_store_init (struct oxr_subaction_store *store)
 Initialize an empty subaction store.
 
void oxr_subaction_store_fini (struct oxr_subaction_store *store)
 Release all stored subactions and destroy the store.
 
XRT_CHECK_RESULT XrResult oxr_subaction_store_add (struct oxr_subaction_store *store, XrPath path, const char *localized_name)
 Insert a subaction path if not already present.
 
bool oxr_subaction_store_get (const struct oxr_subaction_store *store, XrPath path, const struct oxr_binding_subaction **out_subaction)
 Look up a subaction payload by path.
 

Data Fields

struct u_hashmap_int * subactions_by_path
 Maps subaction XrPath to oxr_binding_subaction.
 

Detailed Description

Registry-wide store of subaction payloads keyed by XrPath.

Populated once when the binding registry is created with the known top-level subaction paths. Binding points look up shared payloads here instead of owning their own copies.

Member Function Documentation

◆ oxr_subaction_store_add()

XRT_CHECK_RESULT XrResult oxr_subaction_store_add ( struct oxr_subaction_store *  store,
XrPath  path,
const char *  localized_name 
)

Insert a subaction path if not already present.

Duplicate paths are ignored and return success.

References oxr_binding_subaction::localized_name, oxr_binding_subaction::path, subactions_by_path, U_TYPED_CALLOC, and U_ZERO.

◆ oxr_subaction_store_fini()

void oxr_subaction_store_fini ( struct oxr_subaction_store *  store)

Release all stored subactions and destroy the store.

References subactions_by_path, and u_hashmap_int_clear_and_call_for_each().

◆ oxr_subaction_store_get()

bool oxr_subaction_store_get ( const struct oxr_subaction_store *  store,
XrPath  path,
const struct oxr_binding_subaction **  out_subaction 
)

Look up a subaction payload by path.

Returns
true if path was found, with out_subaction set
false if path is unknown, with out_subaction set to NULL

References oxr_binding_subaction::path, and subactions_by_path.

◆ oxr_subaction_store_init()

XRT_CHECK_RESULT XrResult oxr_subaction_store_init ( struct oxr_subaction_store *  store)

Initialize an empty subaction store.

References subactions_by_path, and U_ZERO.

Field Documentation

◆ subactions_by_path

struct u_hashmap_int* oxr_subaction_store::subactions_by_path

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