nmn::Exception< ThrowingClass > Class Template Reference

Useful class for exception handling. More...

#include <exception.h>

List of all members.

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::LevelsgetNotifyLevel () 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


Detailed Description

template<typename ThrowingClass>
class nmn::Exception< ThrowingClass >

Useful class for exception handling.

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.


Constructor & Destructor Documentation

template<typename ThrowingClass>
nmn::Exception< ThrowingClass >::Exception ( const std::string &  message = "",
const NotifyLevel::Levels level = NotifyLevel::INFO 
)

Constructor.

Parameters:
message the message associated to the exception to be notified (default is an empty string).
level notify level associated to the exception.
The exception's message and notify level are specified by the constructor's parameters. The default message is an empty string and the default level is INFO.

template<typename ThrowingClass>
nmn::Exception< ThrowingClass >::~Exception (  ) 

Destructor.


Member Function Documentation

template<typename ThrowingClass>
const std::string & nmn::Exception< ThrowingClass >::getMessage (  )  const

Returns the exception message.

Returns the exception message specified by the constructor.

template<typename ThrowingClass>
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.

template<typename ThrowingClass>
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.


Member Data Documentation

template<typename ThrowingClass>
std::string nmn::Exception< ThrowingClass >::_message [protected]

template<typename ThrowingClass>
NotifyLevel::Levels nmn::Exception< ThrowingClass >::_notify_level [protected]


The documentation for this class was generated from the following files:
Generated on Sun Nov 18 21:29:39 2007 for nmnurbs by  doxygen 1.4.7