Monado OpenXR Runtime
u_system Struct Reference

A helper to implement a xrt_system, takes care of multiplexing events to sessions. More...

#include <util/u_system.h>

Inheritance diagram for u_system:
Collaboration diagram for u_system:

Public Member Functions

struct u_systemu_system_create (void)
 Create a u_system. More...
 
void u_system_add_session (struct u_system *usys, struct xrt_session *xs, struct xrt_session_event_sink *xses)
 Add a xrt_session to be tracked and to receive multiplexed events. More...
 
void u_system_remove_session (struct u_system *usys, struct xrt_session *xs, struct xrt_session_event_sink *xses)
 Remove a xrt_session from tracking, it will no longer receive events, the given xses needs to match when it was added. More...
 
void u_system_broadcast_event (struct u_system *usys, const union xrt_session_event *xse)
 Broadcast event to all sessions under this system. More...
 
void u_system_set_system_compositor (struct u_system *usys, struct xrt_system_compositor *xsysc)
 Set the system compositor, used in the xrt_system_create_session call. More...
 
void u_system_fill_properties (struct u_system *usys, const char *name)
 Fill system properties. More...
 

Static Public Member Functions

static void u_system_destroy (struct u_system **usys_ptr)
 Destroy an u_system_create allocated u_system - helper function. More...
 
- Static Public Member Functions inherited from xrt_system
static xrt_result_t xrt_system_create_session (struct xrt_system *xsys, const struct xrt_session_info *xsi, struct xrt_session **out_xs, struct xrt_compositor_native **out_xcn)
 Create a xrt_session and optionally a xrt_compositor_native for this system. More...
 
static void xrt_system_destroy (struct xrt_system **xsys_ptr)
 Destroy an xrt_system - helper function. More...
 

Data Fields

struct xrt_system base
 
struct xrt_session_event_sink broadcast
 Pushes events to all sessions created from this system. More...
 
struct {
   struct os_mutex   mutex
 
   uint32_t   count
 Number of session and event sink pairs. More...
 
   struct u_system_session_pair *   pairs
 Array of session and event sink pairs. More...
 
sessions
 
struct xrt_system_compositorxsysc
 Used to implement xrt_system::create_session, can be NULL. More...
 
- Data Fields inherited from xrt_system
xrt_result_t(* create_session )(struct xrt_system *xsys, const struct xrt_session_info *xsi, struct xrt_session **out_xs, struct xrt_compositor_native **out_xcn)
 Create a xrt_session and optionally a xrt_compositor_native for this system. More...
 
void(* destroy )(struct xrt_system *xsys)
 Destroy the system, must be destroyed after system devices and system compositor has been destroyed. More...
 
struct xrt_system_properties properties
 

Detailed Description

A helper to implement a xrt_system, takes care of multiplexing events to sessions.

Member Function Documentation

◆ u_system_destroy()

static void u_system_destroy ( struct u_system **  usys_ptr)
inlinestatic

Destroy an u_system_create allocated u_system - helper function.

Parameters
[in,out]usys_ptrA pointer to the u_system_create allocated struct pointer.

Will destroy the system devices if *usys_ptr is not NULL. Will then set *usys_ptr to NULL.

References xrt_system::destroy.

Field Documentation

◆ broadcast

struct xrt_session_event_sink u_system::broadcast

Pushes events to all sessions created from this system.

◆ count

uint32_t u_system::count

Number of session and event sink pairs.

Referenced by u_system_add_session(), u_system_broadcast_event(), and u_system_remove_session().

◆ pairs

struct u_system_session_pair* u_system::pairs

Array of session and event sink pairs.

Referenced by u_system_add_session(), u_system_broadcast_event(), and u_system_remove_session().

◆ xsysc

struct xrt_system_compositor* u_system::xsysc

Used to implement xrt_system::create_session, can be NULL.

This field should be set with u_system_set_system_compositor.

Referenced by u_system_set_system_compositor().


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