31 static_assert(std::is_standard_layout_v<IoCacheBase>,
32 "glue base must be standard layout for pointer recovery");
33 static_assert(is_non_virtual_base_v<IoCacheBase, T>,
34 "glue base must be a non-virtual base of T for pointer recovery");
36 auto &xic = *getXIC();
38 xic.get_info = getInfoWrap;
40 xic.create_space = createSpaceWrap;
41 xic.set_output = setOutputWrap;
42 xic.get_output_limits = getOutputLimitsWrap;
43 xic.destroy = destroyIoCacheWrap;
49 derived()
const noexcept
51 return static_cast<const T &
>(*this);
57 return static_cast<T &
>(*this);
63 return &(
reinterpret_cast<const IoCacheBase *
>(xic)->derived());
69 return &(
reinterpret_cast<IoCacheBase *
>(xic)->derived());
73 getXIC()
const noexcept
96#define GET(xic) (fromXIC(xic)->derived())
101 return GET(xic).getInfo(out_info);
107 uint64_t generation_id,
108 uint32_t input_count,
110 uint32_t output_count,
112 bool *out_stale)
noexcept
114 return GET(xic).read(generation_id, input_count, inputs, output_count, outputs, out_stale);
124 return GET(xic).createSpace(
id, name, out_space);
134 return GET(xic).setOutput(
id, name, value);
143 return GET(xic).getOutputLimits(
id, out_limits);
150 T::destroyIoCache(xic);
CRTP glue wrapper for xrt_io_cache.
Definition g_io_cache.hpp:27
Catch guards for glue classes.
Shared type traits for glue classes.
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:952
enum xrt_result xrt_result_t
Result type used across Monado.
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1636
A unique identifier for an xrt_device instance.
Definition xrt_device.h:47
Snapshot of the cache layout.
Definition xrt_io_cache.h:75
A cache of flattened device inputs and outputs.
Definition xrt_io_cache.h:116
Output limits of a particular device.
Definition xrt_device.h:275
A union of all output types.
Definition xrt_defines.h:2413
A single named output, that sits on a xrt_device.
Definition xrt_device.h:254
A space very similar to a OpenXR XrSpace but not a full one-to-one mapping, but used to power XrSpace...
Definition xrt_space.h:32
Header defining xrt input/output cache.