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

A cache of flattened device inputs and outputs. More...

#include <xrt/xrt_io_cache.h>

Collaboration diagram for xrt_io_cache:

Static Public Member Functions

static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_get_info (struct xrt_io_cache *xic, struct xrt_io_cache_info *out_info)
 Query the current cache layout.
 
static xrt_result_t xrt_io_cache_read (struct xrt_io_cache *xic, uint64_t generation_id, uint32_t input_count, struct xrt_input *inputs, uint32_t output_count, struct xrt_output *outputs, bool *out_stale)
 Read the current input and output values into caller-provided arrays.
 
static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_create_space (struct xrt_io_cache *xic, struct xrt_device_id id, enum xrt_input_name name, struct xrt_space **out_space)
 Create a space for an input on a specific device.
 
static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_set_output (struct xrt_io_cache *xic, struct xrt_device_id id, enum xrt_output_name name, const struct xrt_output_value *value)
 Set an output value on a specific device.
 
static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_get_output_limits (struct xrt_io_cache *xic, struct xrt_device_id id, struct xrt_output_limits *out_limits)
 Query the (device-wide) output limits for a device.
 
static XRT_NONNULL_ALL void xrt_io_cache_destroy (struct xrt_io_cache **xic_ptr)
 Destroy an xrt_io_cache - helper function.
 

Data Fields

xrt_result_t(* get_info )(struct xrt_io_cache *xic, struct xrt_io_cache_info *out_info)
 Query the current cache layout.
 
xrt_result_t(* read )(struct xrt_io_cache *xic, uint64_t generation_id, uint32_t input_count, struct xrt_input *inputs, uint32_t output_count, struct xrt_output *outputs, bool *out_stale)
 Read the current input and output values into caller-provided arrays.
 
xrt_result_t(* create_space )(struct xrt_io_cache *xic, struct xrt_device_id id, enum xrt_input_name name, struct xrt_space **out_space)
 Create a space for an input on a specific device.
 
xrt_result_t(* set_output )(struct xrt_io_cache *xic, struct xrt_device_id id, enum xrt_output_name name, const struct xrt_output_value *value)
 Set an output value on a specific device.
 
xrt_result_t(* get_output_limits )(struct xrt_io_cache *xic, struct xrt_device_id id, struct xrt_output_limits *out_limits)
 Query the (device-wide) output limits for a device.
 
void(* destroy )(struct xrt_io_cache *xic)
 Destroy this cache.
 

Detailed Description

A cache of flattened device inputs and outputs.

Member Function Documentation

◆ xrt_io_cache_create_space()

static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_create_space ( struct xrt_io_cache *  xic,
struct xrt_device_id  id,
enum xrt_input_name  name,
struct xrt_space **  out_space 
)
inlinestatic

Create a space for an input on a specific device.

Parameters
xicPointer to self.
idDevice to create the space on.
nameInput name to bind the space to.
out_spaceCreated space.

References create_space.

◆ xrt_io_cache_destroy()

static XRT_NONNULL_ALL void xrt_io_cache_destroy ( struct xrt_io_cache **  xic_ptr)
inlinestatic

Destroy an xrt_io_cache - helper function.

Parameters
[in,out]xic_ptrA pointer to the xrt_io_cache struct pointer.

Will destroy the cache if *xic_ptr is not NULL. Will then set *xic_ptr to NULL.

References destroy.

Referenced by ipc_server_objects_destroy_xic().

◆ xrt_io_cache_get_info()

static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_get_info ( struct xrt_io_cache *  xic,
struct xrt_io_cache_info *  out_info 
)
inlinestatic

Query the current cache layout.

Parameters
xicPointer to self.
out_infoResulting layout snapshot.

References get_info.

◆ xrt_io_cache_get_output_limits()

static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_get_output_limits ( struct xrt_io_cache *  xic,
struct xrt_device_id  id,
struct xrt_output_limits *  out_limits 
)
inlinestatic

Query the (device-wide) output limits for a device.

Parameters
xicPointer to self.
idDevice to query.
out_limitsResulting limits.

References get_output_limits.

◆ xrt_io_cache_read()

static xrt_result_t xrt_io_cache_read ( struct xrt_io_cache *  xic,
uint64_t  generation_id,
uint32_t  input_count,
struct xrt_input *  inputs,
uint32_t  output_count,
struct xrt_output *  outputs,
bool *  out_stale 
)
inlinestatic

Read the current input and output values into caller-provided arrays.

Parameters
xicPointer to self.
generation_idLayout generation from the most recent get_info call.
input_countCapacity of inputs; must match the layout snapshot.
inputsOutput array for input values.
output_countCapacity of outputs; must match the layout snapshot.
outputsOutput array for output metadata.
out_staleSet to true when generation_id no longer matches the live layout; the arrays are not written in that case.
Returns
XRT_ERROR_INVALID_ARGUMENT if input_count or output_count do not match the current layout while the generation still matches.

References xrt_io_cache_device::input_count, xrt_io_cache_device::output_count, and read.

◆ xrt_io_cache_set_output()

static XRT_NONNULL_ALL xrt_result_t xrt_io_cache_set_output ( struct xrt_io_cache *  xic,
struct xrt_device_id  id,
enum xrt_output_name  name,
const struct xrt_output_value *  value 
)
inlinestatic

Set an output value on a specific device.

Parameters
xicPointer to self.
idDevice to set the output on.
nameOutput name.
valueValue to write.

References set_output.

Field Documentation

◆ create_space

xrt_result_t(* xrt_io_cache::create_space) (struct xrt_io_cache *xic, struct xrt_device_id id, enum xrt_input_name name, struct xrt_space **out_space)

Create a space for an input on a specific device.

Parameters
xicPointer to self.
idDevice to create the space on.
nameInput name to bind the space to.
out_spaceCreated space.

Referenced by xrt_io_cache_create_space().

◆ destroy

void(* xrt_io_cache::destroy) (struct xrt_io_cache *xic)

Destroy this cache.

Code consuming this interface should use xrt_io_cache_destroy.

Referenced by xrt_io_cache_destroy().

◆ get_info

xrt_result_t(* xrt_io_cache::get_info) (struct xrt_io_cache *xic, struct xrt_io_cache_info *out_info)

Query the current cache layout.

Parameters
xicPointer to self.
out_infoResulting layout snapshot.

Referenced by xrt_io_cache_get_info().

◆ get_output_limits

xrt_result_t(* xrt_io_cache::get_output_limits) (struct xrt_io_cache *xic, struct xrt_device_id id, struct xrt_output_limits *out_limits)

Query the (device-wide) output limits for a device.

Parameters
xicPointer to self.
idDevice to query.
out_limitsResulting limits.

Referenced by xrt_io_cache_get_output_limits().

◆ read

xrt_result_t(* xrt_io_cache::read) (struct xrt_io_cache *xic, uint64_t generation_id, uint32_t input_count, struct xrt_input *inputs, uint32_t output_count, struct xrt_output *outputs, bool *out_stale)

Read the current input and output values into caller-provided arrays.

Parameters
xicPointer to self.
generation_idLayout generation from the most recent get_info call.
input_countCapacity of inputs; must match the layout snapshot.
inputsOutput array for input values.
output_countCapacity of outputs; must match the layout snapshot.
outputsOutput array for output metadata.
out_staleSet to true when generation_id no longer matches the live layout; the arrays are not written in that case.
Returns
XRT_ERROR_INVALID_ARGUMENT if input_count or output_count do not match the current layout while the generation still matches.

Referenced by xrt_io_cache_read().

◆ set_output

xrt_result_t(* xrt_io_cache::set_output) (struct xrt_io_cache *xic, struct xrt_device_id id, enum xrt_output_name name, const struct xrt_output_value *value)

Set an output value on a specific device.

Parameters
xicPointer to self.
idDevice to set the output on.
nameOutput name.
valueValue to write.

Referenced by xrt_io_cache_set_output().


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