XRTraits C++ OpenXR Utilities
Public Member Functions | Protected Member Functions | List of all members
xrtraits::exceptions::xr_exception Class Reference

#include <BaseExceptions.h>

Inheritance diagram for xrtraits::exceptions::xr_exception:
Inheritance graph
[legend]
Collaboration diagram for xrtraits::exceptions::xr_exception:
Collaboration graph
[legend]

Public Member Functions

const char * what () const noexcept override
 
bool hasResult () const noexcept
 
XrResult result () const noexcept
 

Protected Member Functions

 xr_exception (std::string &&what)
 
 xr_exception (std::string const &what, XrResult err)
 
 xr_exception (std::string &&what, XrResult err)
 

Detailed Description

Base class for all exceptions explicitly thrown by this implementation's code.

One constructor permits association of a suggested XrResult code, used in XRTRAITS_CATCH_FALLBACK.

Note
Do not instantiate directly - use exceptions::xr_logic_error or exceptions::xr_runtime_error, or a more specific exception if one exists.

Constructor & Destructor Documentation

◆ xr_exception() [1/3]

xrtraits::exceptions::xr_exception::xr_exception ( std::string &&  what)
protected

Protected constructor (without a result code) for use by derived classes.

◆ xr_exception() [2/3]

xrtraits::exceptions::xr_exception::xr_exception ( std::string const &  what,
XrResult  err 
)
protected

Protected constructor (with a result code) for use by derived classes.

◆ xr_exception() [3/3]

xrtraits::exceptions::xr_exception::xr_exception ( std::string &&  what,
XrResult  err 
)
protected

Protected constructor (with a result code) for use by derived classes.

Member Function Documentation

◆ hasResult()

bool xrtraits::exceptions::xr_exception::hasResult ( ) const
noexcept
Returns
true if an XrResult code was passed when creating this exception.

◆ result()

XrResult xrtraits::exceptions::xr_exception::result ( ) const
noexcept

Access the suggested/associated XrResult. If none was supplied at creation, it returns the default, XR_ERROR_RUNTIME_FAILURE.

◆ what()

const char* xrtraits::exceptions::xr_exception::what ( ) const
overridenoexcept

A human-readable string describing the exception.


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