XRTraits C++ OpenXR Utilities
Classes | Functions
Initializing OpenXR Structs

Wrapper types and functions to build known-good OpenXR structs. More...

Classes

struct  xrtraits::Initialized< T >
 

Functions

template<typename T >
T * xrtraits::initXrType (T *storage)
 
template<typename T >
T * xrtraits::initXrType (void *storage)
 
template<typename T >
T * xrtraits::initXrType (T &storage)
 
template<typename T >
xrtraits::make_zeroed ()
 
template<typename T >
std::vector< T > xrtraits::make_zeroed_vector (size_t n)
 

Detailed Description

Wrapper types and functions to build known-good OpenXR structs.

Function Documentation

◆ initXrType() [1/3]

template<typename T >
T* xrtraits::initXrType ( T *  storage)
inline

#include <xrtraits/InitXrType.h>

Given a pointer to some storage to use as an OpenXR tagged type, zeros the storage and sets the type member.

Overload that automatically deduces the type from the passed pointer.

Referenced by xrtraits::initXrType().

◆ initXrType() [2/3]

template<typename T >
T* xrtraits::initXrType ( void *  storage)
inline

#include <xrtraits/InitXrType.h>

Given an OpenXR tagged type and a pointer to sufficient storage, zeros the storage and sets the type member.

References xrtraits::initXrType().

◆ initXrType() [3/3]

template<typename T >
T* xrtraits::initXrType ( T &  storage)
inline

#include <xrtraits/InitXrType.h>

Given a reference to some storage to use as an OpenXR tagged type, zeros the storage and sets the type member.

Overload that automatically deduces the type from the passed reference.

References xrtraits::initXrType().

◆ make_zeroed()

template<typename T >
T xrtraits::make_zeroed ( )
inline

#include <xrtraits/InitXrType.h>

Creates, initializes, and returns an instance of an OpenXR tagged type.

Sets the type member and zeros the rest of the storage.

◆ make_zeroed_vector()

template<typename T >
std::vector<T> xrtraits::make_zeroed_vector ( size_t  n)
inline

#include <xrtraits/InitXrType.h>

Creates, initializes, and returns a vector containing the given number of empty instances of an OpenXR tagged type.

Examples:
twocall-in-place-sized-and-initialized.cpp.

Referenced by xrtraits::doTwoCall(), and xrtraits::doTwoCallWithSizeHint().