OMK::Exception Class Reference

Base class for all exceptions generated by an execution of OpenMASK. More...

#include <OMKException.h>

Inheritance diagram for OMK::Exception:

Inheritance graph
[legend]
Collaboration diagram for OMK::Exception:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Exception (const std::string &mess)
 constructor with a message
 Exception (const Exception &orig)
 copy constructor
virtual ~Exception ()
 destructor
virtual std::ostream & insertInStream (std::ostream &out) const
 the member function to redefine to print more informations about the exception message
Exceptionoperator<< (const char *f)
 add informations to the message associated to that exception
Exceptionoperator<< (const Flowable &f)
 add information to the message associated to that exception

Protected Attributes

std::string messageException
 the associated message

Friends

std::ostream & operator<< (std::ostream &stream, const Exception &Source)
 print the message associated to the exception

Detailed Description

Base class for all exceptions generated by an execution of OpenMASK.

Definition at line 37 of file OMKException.h.


Constructor & Destructor Documentation

Exception::Exception ( const std::string &  mess  ) 

constructor with a message

Definition at line 26 of file OMKException.cpp.

00027 : messageException( mess )
00028 {
00029 #ifdef _DEBUGEXEC
00030    cerr << "Exception::Exception: creating an exception: " << mess << endl ;
00031 #endif
00032 }

Exception::Exception ( const Exception orig  ) 

copy constructor

Definition at line 38 of file OMKException.cpp.

References messageException.

00039 {
00040   messageException = orig.messageException ;
00041 }

Exception::~Exception (  )  [virtual]

destructor

Definition at line 34 of file OMKException.cpp.

00035 {
00036 }


Member Function Documentation

ostream & Exception::insertInStream ( std::ostream &  out  )  const [virtual]

the member function to redefine to print more informations about the exception message

Reimplemented in OMK::UnInitialisedAttributeException.

Definition at line 58 of file OMKException.cpp.

References messageException.

Referenced by OMK::UnInitialisedAttributeException::insertInStream(), and operator<<().

00059 {
00060   out << messageException;
00061   return out ;
00062 }

Exception & Exception::operator<< ( const char *  f  ) 

add informations to the message associated to that exception

Definition at line 43 of file OMKException.cpp.

References messageException.

00044 {
00045   messageException += f ;
00046   return *this ;
00047 }

Exception & Exception::operator<< ( const Flowable f  ) 

add information to the message associated to that exception

Definition at line 49 of file OMKException.cpp.

References messageException.

00050 {
00051   std::ostringstream txt ;
00052   txt << f ;
00053   messageException += txt.str().c_str() ;
00054 
00055   return *this ;
00056 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Exception Source 
) [friend]

print the message associated to the exception

Definition at line 64 of file OMKException.cpp.

00065 {
00066   return Source.insertInStream(stream) ;
00067 }


Member Data Documentation

std::string OMK::Exception::messageException [protected]

the associated message

Definition at line 65 of file OMKException.h.

Referenced by Exception(), insertInStream(), and operator<<().


logo OpenMask

Documentation generated on Mon Jun 9 11:46:01 2008

Generated with doxygen by Dimitri van Heesch ,   1997-2007