CepGen 1.2.5
Central exclusive processes event generator
|
A simple exception handler. More...
#include <CepGen/Utils/Message.h>
Public Types | |
enum class | MessageType { undefined = -1 , debug , verbatim , info , warning } |
Enumeration of message type. More... | |
Public Member Functions | |
LoggedMessage (const char *mod, const char *from="", MessageType type=MessageType::undefined, const char *file="", short lineno=0) noexcept | |
Generic constructor. | |
LoggedMessage (const LoggedMessage &) noexcept | |
Copy constructor. | |
virtual | ~LoggedMessage () noexcept override |
Default destructor. | |
template<typename T > | |
const LoggedMessage & | log (T &&lam) noexcept |
Lambda function handler. | |
std::string | message () const |
Human-readable message. | |
const std::string & | from () const |
Origin of the exception. | |
const std::string & | file () const |
File where the exception occured. | |
short | lineNumber () const |
Line number where the exception occured. | |
const MessageType & | type () const |
Message type. | |
void | dump (std::ostream *os=nullptr) const noexcept override |
Human-readable dump of the message. | |
std::ostream & | stream () |
Output stream object. | |
Static Public Member Functions | |
static std::string | now () |
Human-readable date/time. | |
Protected Attributes | |
std::ostringstream | message_ |
Message to throw. | |
std::string | from_ |
Origin of the exception. | |
std::string | file_ |
File. | |
short | line_num_ |
Line number. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const MessageType &) |
Printout operator for message type. | |
template<typename T > | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const T &var) noexcept |
Generic templated message feeder operator. | |
const LoggedMessage & | operator<< (const LoggedMessage &, const bool &) noexcept |
Specialised feeder operator for booleans. | |
const LoggedMessage & | operator<< (const LoggedMessage &, const std::wstring &) noexcept |
Specialised feeder operator for wide strings. | |
template<typename T , typename U > | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const std::pair< T, U > &pair_var) noexcept |
Generic templated pair-variables feeder operator. | |
template<typename T > | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const std::set< T > &set_var) noexcept |
Generic templated vector-variables feeder operator. | |
template<typename T > | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const std::vector< T > &vec_var) noexcept |
Generic templated vector-variables feeder operator. | |
template<typename T , std::size_t N> | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const std::array< T, N > &vec_var) noexcept |
Generic templated vector-variables feeder operator. | |
template<typename T , typename U > | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const std::map< T, U > &map_var) noexcept |
Generic templated mapping-variables feeder operator. | |
template<typename T , typename U > | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, const std::unordered_map< T, U > &map_var) noexcept |
Generic templated mapping-variables feeder operator. | |
const LoggedMessage & | operator<< (const LoggedMessage &exc, std::ios_base &(*f)(std::ios_base &)) noexcept |
Pipe modifier operator. | |
|
strong |
|
explicitnoexcept |
[in] | mod | exception classifier |
[in] | from | method invoking the exception |
[in] | type | exception type |
[in] | file | file where this occured |
[in] | lineno | Line number where exception occured |
Definition at line 25 of file Message.cpp.
|
noexcept |
Definition at line 29 of file Message.cpp.
|
overridevirtualnoexcept |
Definition at line 37 of file Message.cpp.
|
overridevirtualnoexcept |
Implements Message.
Definition at line 55 of file Message.cpp.
|
noexcept |
|
staticinherited |
Definition at line 23 of file Message.cpp.
const MessageType & type | ( | ) | const |
|
friend |
Definition at line 42 of file Message.cpp.
|
friend |
Definition at line 49 of file Message.cpp.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 97 of file Message.cpp.