Monado OpenXR Runtime
Loading...
Searching...
No Matches
xrt::util::DeviceBase< T, functions > Class Template Reference

CRTP glue wrapper for xrt_device. More...

#include <glue/g_device.hpp>

Public Member Functions

 DeviceBase () noexcept
 Fully resets and sets function pointers on xrt_device.
 
 ~DeviceBase () noexcept=default
 Destructor.
 
const T & derived () const noexcept
 
T & derived () noexcept
 
const xrt_devicegetXDev () const noexcept
 Gets the underlying xrt_device pointer.
 
xrt_devicegetXDev () noexcept
 Gets the underlying xrt_device pointer.
 

Static Public Member Functions

static const T * fromXDev (const xrt_device *xdev) noexcept
 Gets the pointer to the derived class from a xrt_device.
 
static T * fromXDev (xrt_device *xdev) noexcept
 Gets the pointer to the derived class from a xrt_device.
 

Detailed Description

template<class T, DeviceFunctions functions>
class xrt::util::DeviceBase< T, functions >

CRTP glue wrapper for xrt_device.

Relies on standard layout to recover the derived object from the C struct, and has some requirements and limitations because of that. See C++ glue wrappers for the guide and conventions for these wrappers.

Unlike the other wrappers it wires function pointers selectively: the functions DeviceFunctions bitmask decides which C function pointers are installed, so T only has to implement C++ methods for the features it turns on.

Constructor & Destructor Documentation

◆ DeviceBase()

template<class T , DeviceFunctions functions>
xrt::util::DeviceBase< T, functions >::DeviceBase ( )
inlinenoexcept

◆ ~DeviceBase()

template<class T , DeviceFunctions functions>
xrt::util::DeviceBase< T, functions >::~DeviceBase ( )
defaultnoexcept

Destructor.

Member Function Documentation

◆ fromXDev() [1/2]

template<class T , DeviceFunctions functions>
static const T * xrt::util::DeviceBase< T, functions >::fromXDev ( const xrt_device xdev)
inlinestaticnoexcept

Gets the pointer to the derived class from a xrt_device.

◆ fromXDev() [2/2]

template<class T , DeviceFunctions functions>
static T * xrt::util::DeviceBase< T, functions >::fromXDev ( xrt_device xdev)
inlinestaticnoexcept

Gets the pointer to the derived class from a xrt_device.

◆ getXDev() [1/2]

template<class T , DeviceFunctions functions>
const xrt_device * xrt::util::DeviceBase< T, functions >::getXDev ( ) const
inlinenoexcept

Gets the underlying xrt_device pointer.

Referenced by xrt::util::DeviceBase< T, functions >::DeviceBase().

◆ getXDev() [2/2]

template<class T , DeviceFunctions functions>
xrt_device * xrt::util::DeviceBase< T, functions >::getXDev ( )
inlinenoexcept

Gets the underlying xrt_device pointer.


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