|
Elements
6.0.1
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... | |
Public Member Functions inherited from std::exception | |
| 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 47 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 54 of file Exception.h.
References Elements::Kernel::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 64 of file Exception.h.
References Elements::Kernel::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 71 of file Exception.h.
References Elements::Kernel::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 81 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 118 of file Exception.h.
References std::stringstream::str().

|
inlinenoexcept |
Return the exit code of the Exception
Definition at line 106 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 98 of file Exception.h.
Referenced by ExtProgramExample::mainMethod(), Elements::Examples::ProgramExample::mainMethod(), Elements::ProgramManager::onTerminate(), and Elements::ProgramManager::setup().
| Elements::Exception::code |
Definition at line 81 of file Exception.h.
| Elements::Exception::m_error_msg = std::string(message) |
Definition at line 85 of file Exception.h.
|
protected |
Error message.
Definition at line 127 of file Exception.h.
|
protected |
Definition at line 128 of file Exception.h.
| char* Elements::Exception::message = new char[len] |
Definition at line 83 of file Exception.h.
| delete [] Elements::Exception::message |
Definition at line 86 of file Exception.h.
1.8.5