Support Class Library
A set of tools providing classes and utility
Public Member Functions | Protected Attributes | List of all members
scl::exceptions::RuntimeException Class Reference

Base class for exceptions that could never be checked at compile-time. More...

#include "RuntimeException.h"

Inheritance diagram for scl::exceptions::RuntimeException:
Inheritance graph
[legend]
Collaboration diagram for scl::exceptions::RuntimeException:
Collaboration graph
[legend]

Public Member Functions

template<class T >
 RuntimeException (T &&reason)
 Construct an scl::exceptions::Exception from an error message. More...
 
const char *const reason () const override
 Retrieve the reason. More...
 
const char * what () const noexcept override
 Override that uses the user defined reason. More...
 
const char *const type () const noexcept override
 A string describing the name of the exception class. More...
 

Protected Attributes

const char *const _reason = ""
 The error message that comes with this Exception. More...
 

Detailed Description

Base class for exceptions that could never be checked at compile-time.

Definition at line 13 of file RuntimeException.h.

Constructor & Destructor Documentation

◆ RuntimeException()

template<class T >
scl::exceptions::RuntimeException::RuntimeException ( T &&  reason)
inline

Construct an scl::exceptions::Exception from an error message.

Template Parameters
Tbeing the reason's type
Parameters
reasonbeing the error message

Definition at line 28 of file RuntimeException.h.

Member Function Documentation

◆ reason()

const char* const scl::exceptions::RuntimeException::reason ( ) const
inlineoverridevirtual

Retrieve the reason.

Returns
the reason as a const char* const

Reimplemented from scl::exceptions::Throwable.

Definition at line 35 of file RuntimeException.h.

◆ type()

const char* const scl::exceptions::RuntimeException::type ( ) const
inlineoverridevirtualnoexcept

A string describing the name of the exception class.

Returns
the fully qualified name of this class

Implements scl::exceptions::Throwable.

Reimplemented in scl::exceptions::UninitializedMemoryAccess.

Definition at line 51 of file RuntimeException.h.

◆ what()

const char* scl::exceptions::RuntimeException::what ( ) const
inlineoverridenoexcept

Override that uses the user defined reason.

Returns
the reason

Definition at line 43 of file RuntimeException.h.

Member Data Documentation

◆ _reason

scl::exceptions::RuntimeException::_reason = ""
protected

The error message that comes with this Exception.

Definition at line 19 of file RuntimeException.h.


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