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

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

#include </builds/monado/monado/src/xrt/base/b_system.h>

Inheritance diagram for b_system:
Collaboration diagram for b_system:

Public Member Functions

struct b_systemb_system_create (void)
 Create a b_system, creates a fully working system.
 
void b_system_add_session (struct b_system *bsys, struct xrt_session *xs, struct xrt_session_event_sink *xses)
 Add a xrt_session to be tracked and to receive multiplexed events.
 
void b_system_remove_session (struct b_system *bsys, 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.
 
void b_system_broadcast_event (struct b_system *bsys, const union xrt_session_event *xse)
 Broadcast event to all sessions under this system.
 
void b_system_set_system_compositor (struct b_system *bsys, struct xrt_system_compositor *xsysc)
 Set the system compositor, used in the xrt_system_create_session call.
 
void b_system_fill_properties (struct b_system *bsys, const char *name)
 Fill system properties.
 

Static Public Member Functions

static void b_system_destroy (struct b_system **bsys_ptr)
 Destroy an b_system_create allocated b_system - helper function.
 
- 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.
 
static XRT_NONNULL_ALL void xrt_system_destroy (struct xrt_system **xsys_ptr)
 Destroy an xrt_system - helper function.
 

Data Fields

struct xrt_system base
 
struct xrt_session_event_sink broadcast
 Pushes events to all sessions created from this system.
 
struct { 
 
   struct os_mutex   mutex 
 
   uint32_t   count 
 Number of session and event sink pairs. More...
 
   uint32_t   capacity 
 Capacity of the session array. More...
 
   struct b_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.
 
- 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.
 
void(* destroy )(struct xrt_system *xsys)
 Destroy the system, must be destroyed after system devices and system compositor has been destroyed.
 
struct xrt_system_properties properties
 

Protected Member Functions

bool b_system_init (struct b_system *bsys, void(*destroy_fn)(struct xrt_system *))
 Inits a b_system struct when used as a parent class, only to be used by base class.
 
void b_system_fini (struct b_system *bsys)
 Finalizes a b_system struct when used as a parent class, only to be used by base class.
 

Detailed Description

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

Member Function Documentation

◆ b_system_destroy()

static void b_system_destroy ( struct b_system **  bsys_ptr)
inlinestatic

Destroy an b_system_create allocated b_system - helper function.

Parameters
[in,out]bsys_ptrA pointer to the b_system_create allocated struct pointer.

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

References xrt_system::destroy.

Field Documentation

◆ broadcast

struct xrt_session_event_sink b_system::broadcast

Pushes events to all sessions created from this system.

Referenced by b_system_init(), and sdl_system_devices_init().

◆ capacity

uint32_t b_system::capacity

Capacity of the session array.

Referenced by b_system_add_session(), and b_system_init().

◆ count

uint32_t b_system::count

Number of session and event sink pairs.

Referenced by b_system_add_session(), b_system_broadcast_event(), b_system_fini(), and b_system_remove_session().

◆ pairs

struct b_system_session_pair* b_system::pairs

◆ xsysc

struct xrt_system_compositor* b_system::xsysc

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

This field should be set with b_system_set_system_compositor.

Referenced by b_system_set_system_compositor().


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