Exception class.
More...
#include <Exceptions.h>
Inherits exception.
|
| Exception ()=delete |
|
| Exception (const Exception &)=default |
|
virtual | ~Exception ()=default |
|
| Exception (const std::string &message) |
| Constructor. More...
|
|
| Exception (unsigned int line, const std::string &func, const std::string &fname, const std::string &message) |
| Constructor. More...
|
|
template<typename T > |
| Exception (const T &rhs, unsigned int line, const std::string &func, const std::string &fname, const std::string &message) |
| Constructor. More...
|
|
const char * | what () const noexcept override |
| Get the full exception message. More...
|
|
|
std::string | createMessage (unsigned int line, const std::string &func, const std::string &fname, const std::string &message) const |
| Helper function creating the full exception message. More...
|
|
std::string | createMessage (const std::string &previous, unsigned int line, const std::string &func, const std::string &fname, const std::string &message) const |
| Helper function creating the full exception message. More...
|
|
Exception class.
Smart exception class. Tracking of:
- file name
- line number
- function name of the exception location. The exception message can be stack with any other previously thrown exception. Use the pre-processor macro to throw an exception: An exception can rethrown: In this case, the message will appended to the previous exception message
Definition at line 60 of file Exceptions.h.
◆ Exception() [1/5]
marlinmt::Exception::Exception |
( |
| ) |
|
|
delete |
◆ Exception() [2/5]
marlinmt::Exception::Exception |
( |
const Exception & |
| ) |
|
|
default |
◆ ~Exception()
virtual marlinmt::Exception::~Exception |
( |
| ) |
|
|
virtualdefault |
◆ Exception() [3/5]
marlinmt::Exception::Exception |
( |
const std::string & |
message | ) |
|
Constructor.
- Parameters
-
message | the exception message |
Definition at line 5 of file Exceptions.cc.
◆ Exception() [4/5]
marlinmt::Exception::Exception |
( |
unsigned int |
line, |
|
|
const std::string & |
func, |
|
|
const std::string & |
fname, |
|
|
const std::string & |
message |
|
) |
| |
Constructor.
- Parameters
-
line | the exception line number |
func | the function name in which the exception has been thrown |
fname | the file in which the exception has been thrown |
message | the exception message |
Definition at line 12 of file Exceptions.cc.
◆ Exception() [5/5]
template<typename T >
marlinmt::Exception::Exception |
( |
const T & |
rhs, |
|
|
unsigned int |
line, |
|
|
const std::string & |
func, |
|
|
const std::string & |
fname, |
|
|
const std::string & |
message |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
rhs | any possible class having a method what() returning a string |
line | the exception line number |
func | the function name in which the exception has been thrown |
fname | the file in which the exception has been thrown |
message | the exception message |
Definition at line 131 of file Exceptions.h.
References marlinmt::MARLINMT_DEFINE_EXCEPTION().
◆ createMessage() [1/2]
std::string marlinmt::Exception::createMessage |
( |
unsigned int |
line, |
|
|
const std::string & |
func, |
|
|
const std::string & |
fname, |
|
|
const std::string & |
message |
|
) |
| const |
|
protected |
Helper function creating the full exception message.
- Parameters
-
line | the exception line number |
func | the function name in which the exception has been thrown |
fname | the file in which the exception has been thrown |
message | the exception message |
Definition at line 25 of file Exceptions.cc.
Referenced by createMessage().
◆ createMessage() [2/2]
std::string marlinmt::Exception::createMessage |
( |
const std::string & |
previous, |
|
|
unsigned int |
line, |
|
|
const std::string & |
func, |
|
|
const std::string & |
fname, |
|
|
const std::string & |
message |
|
) |
| const |
|
protected |
Helper function creating the full exception message.
- Parameters
-
a | previous message to prepend in the message (plus a line break) |
line | the exception line number |
func | the function name in which the exception has been thrown |
fname | the file in which the exception has been thrown |
message | the exception message |
Definition at line 31 of file Exceptions.cc.
References createMessage().
◆ what()
const char * marlinmt::Exception::what |
( |
| ) |
const |
|
overridenoexcept |
◆ _message
const std::string marlinmt::Exception::_message {} |
|
protected |
The documentation for this class was generated from the following files: