Elements 6.3.3
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 *string_format, Args &&... args) | |
Constructs a new Exception with a message using format specifiers. | |
Exception (const Exception &rhs)=default | |
virtual | ~Exception () noexcept |
const char * | what () const noexcept override |
ExitCode | exitCode () const noexcept |
template<typename T> | |
void | appendMessage (const T &message) |
Appends in the end of the exception message the parameter. | |
Public Member Functions inherited from std::exception | |
T | what (T... args) |
T | ~exception (T... args) |
T | operator= (T... args) |
T | exception (T... args) |
Protected Attributes | |
std::string | m_error_msg {} |
const ExitCode | m_exit_code {ExitCode::NOT_OK} |
Elements base exception class.
Definition at line 44 of file Exception.h.
|
explicit |
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 27 of file Exception.cpp.
References m_exit_code.
Referenced by Exception(), Elements::OptionException::OptionException(), and what().
|
explicit |
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 29 of file Exception.cpp.
References m_error_msg, and m_exit_code.
|
explicit |
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 31 of file Exception.cpp.
References m_error_msg, and m_exit_code.
|
explicit |
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 |
|
default |
|
virtualdefaultnoexcept |
void Elements::Exception::appendMessage | ( | const T & | message | ) |
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 |
References appendMessage().
Referenced by appendMessage().
|
noexcept |
Return the exit code of the Exception
Definition at line 39 of file Exception.cpp.
References m_exit_code.
Referenced by Elements::ProgramManager::onTerminate(), and ~Exception().
|
overridenoexcept |
Returns a pointer to the (constant) error description.
Definition at line 35 of file Exception.cpp.
References Exception(), m_error_msg, and what().
Referenced by Elements::ProgramManager::onTerminate(), what(), and ~Exception().
|
protected |
Error message.
Definition at line 119 of file Exception.h.
Referenced by Exception(), Exception(), and what().
|
protected |
Definition at line 120 of file Exception.h.
Referenced by Exception(), Exception(), Exception(), and exitCode().