Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
foray::Exception Class Reference

An extension of std::exception providing support for formatted error messages. Exceptions should always be catched via "catch (const std::exception& ex)", and thrown by value (Just use builtin static throw functions) More...

#include <foray_exception.hpp>

Inheritance diagram for foray::Exception:

Public Member Functions

 Exception ()
 
 Exception (std::string_view reason)
 
template<typename... Args>
 Exception (const char *const format, Args &&... args)
 
virtual const char * what () const noexcept override
 

Static Public Member Functions

static void Throw (std::string_view reason, const source_location location=source_location::current())
 Throws an exception.
 
template<typename... Args>
static void Throw (const source_location location, const char *const format, Args &&... args)
 Throws an exception.
 

Protected Attributes

std::string mReason = std::string("")
 

Detailed Description

An extension of std::exception providing support for formatted error messages. Exceptions should always be catched via "catch (const std::exception& ex)", and thrown by value (Just use builtin static throw functions)

Constructor & Destructor Documentation

◆ Exception() [1/3]

foray::Exception::Exception ( )
inline

◆ Exception() [2/3]

foray::Exception::Exception ( std::string_view  reason)
inlineexplicit

◆ Exception() [3/3]

template<typename... Args>
foray::Exception::Exception ( const char *const  format,
Args &&...  args 
)
inline

Member Function Documentation

◆ Throw() [1/2]

template<typename... Args>
static void foray::Exception::Throw ( const source_location  location,
const char *const  format,
Args &&...  args 
)
inlinestatic

Throws an exception.

All throwing should be values, catch via "const std::exception& ex".

Parameters
reasonUser defined error message
locationsource location
argsformat args

◆ Throw() [2/2]

static void foray::Exception::Throw ( std::string_view  reason,
const source_location  location = source_location::current() 
)
static

Throws an exception.

All throwing should be values, catch via "const std::exception& ex".

Parameters
reasonUser defined error message
locationAutomatically generated source location

◆ what()

virtual const char * foray::Exception::what ( ) const
inlineoverridevirtualnoexcept

Member Data Documentation

◆ mReason

std::string foray::Exception::mReason = std::string("")
protected

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