Monado OpenXR Runtime
Data Structures
u_var.h File Reference

Variable tracking code. More...

#include "xrt/xrt_defines.h"
Include dependency graph for u_var.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  u_var_f32_arr
 
struct  u_var_timing
 
#define U_VAR_ADD_FUNCS()
 
#define ADD_FUNC(SUFFIX, TYPE, ENUM)   void u_var_add_##SUFFIX(void *, TYPE *, const char *);
 
enum  u_var_kind {
  U_VAR_KIND_BOOL, U_VAR_KIND_RGB_U8, U_VAR_KIND_RGB_F32, U_VAR_KIND_U8,
  U_VAR_KIND_I32, U_VAR_KIND_F32, U_VAR_KIND_F32_ARR, U_VAR_KIND_TIMING,
  U_VAR_KIND_VEC3_I32, U_VAR_KIND_VEC3_F32, U_VAR_KIND_POSE, U_VAR_KIND_SINK,
  U_VAR_KIND_RO_TEXT, U_VAR_KIND_RO_I32, U_VAR_KIND_RO_U32, U_VAR_KIND_RO_F32,
  U_VAR_KIND_RO_I64, U_VAR_KIND_RO_U64, U_VAR_KIND_RO_F64, U_VAR_KIND_RO_VEC3_I32,
  U_VAR_KIND_RO_VEC3_F32, U_VAR_KIND_RO_QUAT_F32, U_VAR_KIND_GUI_HEADER
}
 What kind of variable is this tracking. More...
 
typedef void(* u_var_root_cb) (const char *, void *)
 Callback for entering and leaving root nodes. More...
 
typedef void(* u_var_elm_cb) (const char *, enum u_var_kind, void *, void *)
 Callback on each variable a root node has. More...
 
void u_var_add_root (void *root, const char *c_name, bool number)
 Add a named root object, the u_var subsystem is completely none-invasive to the object it's tracking. More...
 
void u_var_remove_root (void *root)
 Remove the root node. More...
 
void u_var_visit (u_var_root_cb enter_cb, u_var_root_cb exit_cb, u_var_elm_cb elem_cb, void *priv)
 Visit all root nodes and their variables. More...
 
void u_var_force_on (void)
 This forces the variable tracking code to on, it is disabled by default. More...
 

Detailed Description

Variable tracking code.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ U_VAR_ADD_FUNCS

#define U_VAR_ADD_FUNCS ( )
Value:
ADD_FUNC(bool, bool, BOOL) \
ADD_FUNC(rgb_u8, struct xrt_colour_rgb_u8, RGB_U8) \
ADD_FUNC(rgb_f32, struct xrt_colour_rgb_f32, RGB_F32) \
ADD_FUNC(u8, uint8_t, U8) \
ADD_FUNC(i32, int32_t, I32) \
ADD_FUNC(f32, float, F32) \
ADD_FUNC(f32_arr, struct u_var_f32_arr, F32_ARR) \
ADD_FUNC(f32_timing, struct u_var_timing, TIMING) \
ADD_FUNC(vec3_i32, struct xrt_vec3_i32, VEC3_I32) \
ADD_FUNC(vec3_f32, struct xrt_vec3, VEC3_F32) \
ADD_FUNC(pose, struct xrt_pose, POSE) \
ADD_FUNC(sink, struct xrt_frame_sink *, SINK) \
ADD_FUNC(ro_text, const char, RO_TEXT) \
ADD_FUNC(ro_i32, int32_t, RO_I32) \
ADD_FUNC(ro_u32, uint32_t, RO_I32) \
ADD_FUNC(ro_f32, float, RO_F32) \
ADD_FUNC(ro_i64, int64_t, RO_I64) \
ADD_FUNC(ro_u64, uint64_t, RO_U64) \
ADD_FUNC(ro_f64, double, RO_F64) \
ADD_FUNC(ro_vec3_i32, struct xrt_vec3_i32, RO_VEC3_I32) \
ADD_FUNC(ro_vec3_f32, struct xrt_vec3, RO_VEC3_F32) \
ADD_FUNC(ro_quat_f32, struct xrt_quat, RO_QUAT_F32) \
ADD_FUNC(gui_header, bool, GUI_HEADER)
Definition: u_var.h:33
Definition: u_var.h:26
A 3 element vector with single floats.
Definition: xrt_defines.h:131
A 3 element colour with 8 bits per channel.
Definition: xrt_defines.h:166
A pose composed of a position and orientation.
Definition: xrt_defines.h:229
A quaternion with single floats.
Definition: xrt_defines.h:97
A object that is sent frames.
Definition: xrt_frame.h:51
A 3 element vector with 32 bit integers.
Definition: xrt_defines.h:143
A 3 element colour with floating point channels.
Definition: xrt_defines.h:191

Typedef Documentation

◆ u_var_elm_cb

typedef void(* u_var_elm_cb) (const char *, enum u_var_kind, void *, void *)

Callback on each variable a root node has.

◆ u_var_root_cb

typedef void(* u_var_root_cb) (const char *, void *)

Callback for entering and leaving root nodes.

Enumeration Type Documentation

◆ u_var_kind

enum u_var_kind

What kind of variable is this tracking.

Function Documentation

◆ u_var_force_on()

void u_var_force_on ( void  )

This forces the variable tracking code to on, it is disabled by default.

◆ u_var_remove_root()

void u_var_remove_root ( void *  root)

Remove the root node.

Referenced by gui_sdl2_imgui_loop().

◆ u_var_visit()

void u_var_visit ( u_var_root_cb  enter_cb,
u_var_root_cb  exit_cb,
u_var_elm_cb  elem_cb,
void *  priv 
)

Visit all root nodes and their variables.