Elements
5.10
A C++ base framework for the Euclid Software.
|
Elements base exception class. More...
#include <Exception.h>
Classes | |
struct | ExitCodeHelper |
struct | ExitCodeHelper< First, Rest...> |
struct | ExitCodeHelper< Last > |
Public Member Functions | |
Exception (ExitCode e=ExitCode::NOT_OK) | |
Exception (const char *message, ExitCode e=ExitCode::NOT_OK) | |
Exception (const std::string &message, ExitCode e=ExitCode::NOT_OK) | |
template<typename... Args> | |
Exception (const char *stringFormat, Args &&...args) | |
Constructs a new Exception with a message using format specifiers. More... | |
snprintf (message, len, stringFormat, std::forward< Args >(args)...) | |
virtual | ~Exception () noexcept=default |
const char * | what () const noexceptoverride |
ExitCode | exitCode () const noexcept |
template<typename T > | |
void | appendMessage (const T &message) |
Appends in the end of the exception message the parameter. More... | |
![]() | |
T | what (T...args) |
T | ~exception (T...args) |
T | operator= (T...args) |
T | exception (T...args) |
Public Attributes | |
code | |
char * | message = new char[len] |
m_error_msg = std::string {message} | |
delete[] | message |
Protected Attributes | |
std::string | m_error_msg {} |
const ExitCode | m_exit_code {ExitCode::NOT_OK} |
Elements base exception class.
Definition at line 46 of file Exception.h.
|
inlineexplicit |
Default constructor. The message is set to the empty string.
e,: | this is an optional exit code. By default is is set to NOT_OK. |
Definition at line 53 of file Exception.h.
References Elements::Units::e.
|
inlineexplicit |
Constructor (C strings).
message | C-style string error message. The string contents are copied upon construction. Hence, responsibility for deleting the char* lies with the caller. |
e,: | this is an optional exit code. By default is is set to NOT_OK. |
Definition at line 65 of file Exception.h.
References Elements::Units::e.
|
inlineexplicit |
Constructor (C++ STL strings).
message | The error message. |
e,: | this is an optional exit code. By default is is set to NOT_OK. |
Definition at line 74 of file Exception.h.
References Elements::Units::e.
|
inlineexplicit |
Constructs a new Exception with a message using format specifiers.
stringFormat | The message containing the format specifiers |
args | The values to replace the format specifiers with |
Definition at line 85 of file Exception.h.
|
virtualdefaultnoexcept |
Virtual destructor.
|
inline |
Appends in the end of the exception message the parameter.
The passed parameters can be of any type the << operator of the std::stringstream can handle.
message | The message to append |
Definition at line 123 of file Exception.h.
References std::stringstream::str().
|
inlinenoexcept |
Return the exit code of the Exception
Definition at line 111 of file Exception.h.
Referenced by Elements::ProgramManager::onTerminate(), and Elements::ProgramManager::setup().
Elements::Exception::snprintf | ( | message | , |
len | , | ||
stringFormat | , | ||
std::forward< Args >(args) | ... | ||
) |
|
inlineoverridenoexcept |
Returns a pointer to the (constant) error description.
Definition at line 103 of file Exception.h.
Referenced by Elements::Examples::ProgramExample::mainMethod(), Elements::ProgramManager::onTerminate(), and Elements::ProgramManager::setup().
Elements::Exception::code |
Definition at line 86 of file Exception.h.
Elements::Exception::m_error_msg = std::string {message} |
Definition at line 90 of file Exception.h.
|
protected |
Error message.
Definition at line 132 of file Exception.h.
|
protected |
Definition at line 133 of file Exception.h.
char* Elements::Exception::message = new char[len] |
Definition at line 88 of file Exception.h.
delete [] Elements::Exception::message |
Definition at line 91 of file Exception.h.