Monado OpenXR Runtime
Loading...
Searching...
No Matches

A parsed equivalent of a list of sub-action paths. More...

#include <oxr/actions/oxr_subaction.h>

Collaboration diagram for oxr_subaction_paths:

Public Member Functions

bool oxr_classify_subaction_paths (const struct oxr_instance_path_cache *cache, uint32_t subaction_path_count, const XrPath *subaction_paths, struct oxr_subaction_paths *out_subaction_paths)
 Classify an array of subaction paths into a parsed oxr_subaction_paths bitfield.
 

Static Public Member Functions

static bool oxr_subaction_paths_is_subset_of (const struct oxr_subaction_paths *a, const struct oxr_subaction_paths *b)
 Helper function to determine if the set of paths in a is a subset of the paths in b.
 
static bool oxr_classify_subaction_path (const struct oxr_instance_path_cache *cache, XrPath subaction_path, struct oxr_subaction_paths *out_subaction_paths)
 Convenience wrapper around oxr_classify_subaction_paths() for the single-path case, see oxr_classify_subaction_paths().
 

Data Fields

bool any
 
bool left
 
bool right
 
bool head
 
bool gamepad
 
bool eyes
 
bool user
 

Detailed Description

A parsed equivalent of a list of sub-action paths.

If any is true, then no paths were provided, which typically means any input is acceptable.

Member Function Documentation

◆ oxr_classify_subaction_path()

static bool oxr_classify_subaction_path ( const struct oxr_instance_path_cache cache,
XrPath  subaction_path,
struct oxr_subaction_paths out_subaction_paths 
)
inlinestatic

Convenience wrapper around oxr_classify_subaction_paths() for the single-path case, see oxr_classify_subaction_paths().

Referenced by oxr_action_sync_data(), and oxr_verify_subaction_path_sync().

◆ oxr_classify_subaction_paths()

bool oxr_classify_subaction_paths ( const struct oxr_instance_path_cache cache,
uint32_t  subaction_path_count,
const XrPath *  subaction_paths,
struct oxr_subaction_paths out_subaction_paths 
)

Classify an array of subaction paths into a parsed oxr_subaction_paths bitfield.

The caller must do any error printing or reporting.

Zeroes out_subaction_paths, then for each path in subaction_paths:

  • If subaction_path_count is 0, sets out_subaction_paths->any to true and returns true.
  • If the path is XR_NULL_PATH, sets out_subaction_paths->any to true.
  • Otherwise matches the path against the instance's known subaction paths (e.g. /user/hand/left, /user/hand/right, /user/head) via cache and sets the corresponding flag in out_subaction_paths.
Parameters
[in]cacheInstance path cache containing resolved subaction path values
[in]subaction_path_countNumber of paths in subaction_paths
[in]subaction_pathsArray of XrPath subaction path handles to classify
[out]out_subaction_pathsFilled with the classified path flags; set oxr_subaction_paths::any if no paths or XR_NULL_PATH seen
Returns
true if all paths were recognized and classified
false if any path was not a known subaction path; the caller must report an error or warning

References OXR_FOR_EACH_VALID_SUBACTION_PATH, and U_ZERO.

Referenced by oxr_action_create().

◆ oxr_subaction_paths_is_subset_of()

static bool oxr_subaction_paths_is_subset_of ( const struct oxr_subaction_paths a,
const struct oxr_subaction_paths b 
)
inlinestatic

Helper function to determine if the set of paths in a is a subset of the paths in b.

References OXR_FOR_EACH_SUBACTION_PATH.

Referenced by oxr_verify_subaction_path_sync().


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