MAGE  v0.171.0
Matthias Advanced Game Engine
mage::Exception Class Reference

#include <exception.hpp>

Inheritance diagram for mage::Exception:

Public Member Functions

 Exception ()
 
template<typename... ArgsT>
 Exception (std::string_view format_str, const ArgsT &... args)
 
 Exception (const Exception &exception)
 
 Exception (Exception &&exception)
 
virtual ~Exception ()
 
Exceptionoperator= (const Exception &exception)
 
Exceptionoperator= (Exception &&exception)
 
virtual const char * what () const noexcept override
 

Private Attributes

char m_text [s_buffer_size]
 

Static Private Attributes

static constexpr std::size_t s_buffer_size = 2048u
 

Detailed Description

A class of formatted exceptions.

Constructor & Destructor Documentation

◆ Exception() [1/4]

mage::Exception::Exception ( )

Constructs a formatted exception.

◆ Exception() [2/4]

template<typename... ArgsT>
mage::Exception::Exception ( std::string_view  format_str,
const ArgsT &...  args 
)
explicit

Constructs a formatted exception.

Template Parameters
ArgsTThe format argument types.
Parameters
[in]format_strThe format string.
[in]argsA reference to the format arguments.

◆ Exception() [3/4]

mage::Exception::Exception ( const Exception exception)
default

Constructs a formatted exception from the given formatted exception.

Parameters
[in]exceptionA reference to a formatted exception to copy.

◆ Exception() [4/4]

mage::Exception::Exception ( Exception &&  exception)
default

Constructs a formatted exception by moving the given formatted exception.

Parameters
[in]exceptionA reference to a formatted exception to move.

◆ ~Exception()

mage::Exception::~Exception ( )
virtualdefault

Destructs this formatted exception.

Member Function Documentation

◆ operator=() [1/2]

Exception & mage::Exception::operator= ( const Exception exception)
default

Copies the given formatted exception to this formatted exception.

Parameters
[in]exceptionA reference to a formatted exception to copy.
Returns
A reference to the copy of the given formatted exception (i.e. this formatted exception).

◆ operator=() [2/2]

Exception & mage::Exception::operator= ( Exception &&  exception)
default

Moves the given formatted exception to this formatted exception.

Parameters
[in]exceptionA reference to a formatted exception to move.
Returns
A reference to the moved formatted exception (i.e. this formatted exception).

◆ what()

const char * mage::Exception::what ( ) const
overridevirtualnoexcept

Returns a null-terminated byte string that may be used to identify the exception.

Returns
A null-terminated byte string that may be used to identify the exception.

Member Data Documentation

◆ m_text

char mage::Exception::m_text[s_buffer_size]
private

The text buffer of this formatted exception.

◆ s_buffer_size

constexpr std::size_t mage::Exception::s_buffer_size = 2048u
staticprivate

The buffer size of exceptions.