API Documentation
Loading...
Searching...
No Matches
XRErrorHandling.h File Reference
#include "DLLInfo.h"
#include "Base/Headers/String.h"
#include "Base/Headers/Exception.h"
#include "Base/Headers/Translator.h"
#include <openxr/openxr.h>
#include <openxr/openxr_reflection.h>
Include dependency graph for XRErrorHandling.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  NDEVR
 

Macros

#define CHECK(exp)
 
#define CHECK_MSG(exp, msg)
 
#define CHECK_XRCMD(cmd)
 
#define CHECK_XRRESULT(res, cmdStr)
 
#define CHK_STRINGIFY(x)
 
#define ENUM_CASE_STR(name, val)
 
#define FILE_AND_LINE   __FILE__ ":" TOSTRING(__LINE__)
 
#define MAKE_TO_STRING_FUNC(enumType)
 
#define THROW(msg)
 
#define THROW_XR(xr, cmd)
 
#define TOSTRING(x)
 

Functions

XrResult CheckXrResult (XrResult res, const char *originator=nullptr, const char *sourceLocation=nullptr)
 
void Throw (String failureMessage, const char *originator=nullptr, const char *sourceLocation=nullptr)
 
void ThrowXrResult (XrResult res, const char *originator=nullptr, const char *sourceLocation=nullptr)
 
const char * to_string (XrEnvironmentBlendMode e)
 
const char * to_string (XrFormFactor e)
 
const char * to_string (XrReferenceSpaceType e)
 
const char * to_string (XrResult e)
 
const char * to_string (XrSessionState e)
 
const char * to_string (XrViewConfigurationType e)
 

Macro Definition Documentation

◆ CHECK

#define CHECK ( exp)
Value:
{ \
if (!(exp)) { \
Throw("Check failed", #exp, FILE_AND_LINE); \
} \
}
#define FILE_AND_LINE
Definition XRErrorHandling.h:35

◆ CHECK_MSG

#define CHECK_MSG ( exp,
msg )
Value:
{ \
if (!(exp)) { \
Throw(msg, #exp, FILE_AND_LINE); \
} \
}

◆ CHECK_XRCMD

#define CHECK_XRCMD ( cmd)
Value:
CheckXrResult(cmd, #cmd, FILE_AND_LINE);

◆ CHECK_XRRESULT

#define CHECK_XRRESULT ( res,
cmdStr )
Value:
CheckXrResult(res, cmdStr, FILE_AND_LINE);

◆ CHK_STRINGIFY

#define CHK_STRINGIFY ( x)
Value:
#x

◆ ENUM_CASE_STR

#define ENUM_CASE_STR ( name,
val )
Value:
case name: return #name;

◆ FILE_AND_LINE

#define FILE_AND_LINE   __FILE__ ":" TOSTRING(__LINE__)

◆ MAKE_TO_STRING_FUNC

#define MAKE_TO_STRING_FUNC ( enumType)
Value:
inline const char* to_string(enumType e) { \
switch (e) { \
XR_LIST_ENUM_##enumType(ENUM_CASE_STR) \
default: return "Unknown " #enumType; \
} \
}
const char * to_string(XrReferenceSpaceType e)
Definition XRErrorHandling.h:26
#define ENUM_CASE_STR(name, val)
Definition XRErrorHandling.h:16

◆ THROW

#define THROW ( msg)
Value:
Throw(msg, nullptr, FILE_AND_LINE);

◆ THROW_XR

#define THROW_XR ( xr,
cmd )
Value:
ThrowXrResult(xr, #cmd, FILE_AND_LINE);

◆ TOSTRING

#define TOSTRING ( x)
Value:
#define CHK_STRINGIFY(x)
Definition XRErrorHandling.h:33

Function Documentation

◆ to_string() [1/6]

const char * to_string ( XrEnvironmentBlendMode e)
inline

◆ to_string() [2/6]

const char * to_string ( XrFormFactor e)
inline

◆ to_string() [3/6]

const char * to_string ( XrReferenceSpaceType e)
inline

◆ to_string() [4/6]

const char * to_string ( XrResult e)
inline

◆ to_string() [5/6]

const char * to_string ( XrSessionState e)
inline

◆ to_string() [6/6]

const char * to_string ( XrViewConfigurationType e)
inline