XRTraits C++ OpenXR Utilities
Classes | Functions
xrtraits::exceptions Namespace Reference

Namespace for custom exception types that may be thrown internal to the utilities. More...

Classes

struct  bad_tagged_cast
 
struct  get_from_chain_error
 
struct  type_error
 
class  xr_exception
 
struct  xr_logic_error
 
struct  xr_runtime_error
 

Functions

void throwIfNotSucceeded (XrResult result, const char *errorMessage)
 
void throwIfNotUnqualifiedSuccess (XrResult result, const char *errorMessage)
 

Detailed Description

Namespace for custom exception types that may be thrown internal to the utilities.

Note that these declarations (as well as any possibly-throwing functionality elsewhere in the library) are only available if XRTRAITS_USE_EXCEPTIONS is defined and the source files compiled. Without that flag, the source files are not needed, and exceptions are not explicitly thrown.

Function Documentation

◆ throwIfNotSucceeded()

void xrtraits::exceptions::throwIfNotSucceeded ( XrResult  result,
const char *  errorMessage 
)

Throw an xr_runtime_error with the given message if the result fails XR_SUCCEEDED.

Particularly useful for application-side utilities to allow non-XrResult return values in the usual case.

See also
throwIfNotUnqualifiedSuccess

◆ throwIfNotUnqualifiedSuccess()

void xrtraits::exceptions::throwIfNotUnqualifiedSuccess ( XrResult  result,
const char *  errorMessage 
)

Throw an xr_runtime_error with the given message if the result fails XR_UNQUALIFIED_SUCCESS.

That is, if result is not exactly XR_SUCCESS.

Particularly useful for application-side utilities to allow non-XrResult return values in the usual case.

See also
throwIfNotUnqualifiedSuccess

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