#include <exception.h>
Public Member Functions | |
Exception (const std::string &message="", const NotifyLevel::Levels &level=NotifyLevel::INFO) | |
Constructor. | |
~Exception () | |
Destructor. | |
const std::string & | getMessage () const |
Returns the exception message. | |
const NotifyLevel::Levels & | getNotifyLevel () const |
Returns the notify level associated to the exception. | |
void | notify () const |
Prints the exception's message to the standard output. | |
Protected Attributes | |
std::string | _message |
NotifyLevel::Levels | _notify_level |
The template argument is used to identify the type of the object that throws the exception. When an exception is thrown a message will be print by the notify( ) method to the standard output, only if the exception's associated notify level is lesser or equal to the static notify level specified by the NotifyLevel class.
nmn::Exception< ThrowingClass >::Exception | ( | const std::string & | message = "" , |
|
const NotifyLevel::Levels & | level = NotifyLevel::INFO | |||
) |
Constructor.
message | the message associated to the exception to be notified (default is an empty string). | |
level | notify level associated to the exception. |
nmn::Exception< ThrowingClass >::~Exception | ( | ) |
Destructor.
const std::string & nmn::Exception< ThrowingClass >::getMessage | ( | ) | const |
Returns the exception message.
Returns the exception message specified by the constructor.
const NotifyLevel::Levels & nmn::Exception< ThrowingClass >::getNotifyLevel | ( | ) | const |
Returns the notify level associated to the exception.
Returns the notify level associated to the exception specified by the constructor.
void nmn::Exception< ThrowingClass >::notify | ( | ) | const |
Prints the exception's message to the standard output.
Prints the exception's message to the standard output, but only if the exception's notify level is lesser or equal to the static notify level specified by the NotifyLevel class.
std::string nmn::Exception< ThrowingClass >::_message [protected] |
NotifyLevel::Levels nmn::Exception< ThrowingClass >::_notify_level [protected] |