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

Per-session map of action key to action attachment. More...

#include <oxr/actions/oxr_session_attached_actions.h>

Collaboration diagram for oxr_session_attached_actions:

Public Member Functions

XRT_NONNULL_ALL XrResult oxr_session_attached_actions_init (struct oxr_session_attached_actions *attached)
 Initialize the attached actions for a session.
 
XRT_NONNULL_ALL void oxr_session_attached_actions_fini (struct oxr_session_attached_actions *attached)
 Finalize and cleanup the attached actions.
 
XRT_NONNULL_ALL XrResult oxr_session_attached_actions_add_action_attachment (struct oxr_session_attached_actions *attached, struct oxr_action_attachment *act_attachment)
 Add a single action attachment to the map (thread-safe).
 
XRT_NONNULL_ALL void oxr_session_attached_actions_remove_action_attachment (struct oxr_session_attached_actions *attached, struct oxr_action_attachment *act_attachment)
 Remove a single action attachment from the map (thread-safe).
 
XRT_NONNULL_ALL void oxr_session_attached_actions_find (struct oxr_session_attached_actions *attached, uint32_t act_key, struct oxr_action_attachment **out_act_attached)
 Find an action attachment by action key (thread-safe).
 

Data Fields

struct u_hashmap_intact_attachments_by_key
 A map of action key to action attachment.
 
struct os_mutex mutex
 

Detailed Description

Per-session map of action key to action attachment.

This is stored on the session (not on the action context) and tracks all action attachments from all action contexts. State-get and lookup functions (e.g. xrGetActionStateBoolean, haptics, pose) resolve an action by act_key only; they do not need to know which context the action came from. That way, a future extension that adds multiple action contexts per session can keep feeding this single map, and those functions will not need to change.

Member Function Documentation

◆ oxr_session_attached_actions_add_action_attachment()

XRT_NONNULL_ALL XrResult oxr_session_attached_actions_add_action_attachment ( struct oxr_session_attached_actions attached,
struct oxr_action_attachment act_attachment 
)

Add a single action attachment to the map (thread-safe).

References act_attachments_by_key, and oxr_action_attachment::act_key.

◆ oxr_session_attached_actions_find()

XRT_NONNULL_ALL void oxr_session_attached_actions_find ( struct oxr_session_attached_actions attached,
uint32_t  act_key,
struct oxr_action_attachment **  out_act_attached 
)

Find an action attachment by action key (thread-safe).

References act_attachments_by_key.

◆ oxr_session_attached_actions_fini()

XRT_NONNULL_ALL void oxr_session_attached_actions_fini ( struct oxr_session_attached_actions attached)

Finalize and cleanup the attached actions.

References act_attachments_by_key.

◆ oxr_session_attached_actions_init()

XRT_NONNULL_ALL XrResult oxr_session_attached_actions_init ( struct oxr_session_attached_actions attached)

Initialize the attached actions for a session.

References act_attachments_by_key.

◆ oxr_session_attached_actions_remove_action_attachment()

XRT_NONNULL_ALL void oxr_session_attached_actions_remove_action_attachment ( struct oxr_session_attached_actions attached,
struct oxr_action_attachment act_attachment 
)

Remove a single action attachment from the map (thread-safe).

References act_attachments_by_key, and oxr_action_attachment::act_key.

Field Documentation

◆ act_attachments_by_key

struct u_hashmap_int* oxr_session_attached_actions::act_attachments_by_key

A map of action key to action attachment.

The action attachments are actually owned by the action set attachments, which are owned by the session action context.

If non-null, this means an action context (default or otherwise) action sets have been attached to the owning session, since this map points to oxr_action_attachment members of oxr_session_action_context::act_set_attachments elements.

Referenced by oxr_session_attached_actions_add_action_attachment(), oxr_session_attached_actions_find(), oxr_session_attached_actions_fini(), oxr_session_attached_actions_init(), and oxr_session_attached_actions_remove_action_attachment().


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