Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

sword::Exception Class Reference

Inheritance diagram for sword::Exception:

sword::InternalException sword::UnimplementedException

Public Methods

 Exception ()
 Builds an exception using the message stream 'estream'.

 Exception (const std::string &message)
 Builds an exception using the provided message.

 Exception (const char *message)
 Builds an exception using the provided message.

virtual const char * what () const throw ()
 Returns the exception message (implements std::exception).

const char * file () const throw ()
word line () const throw ()

Detailed Description

The base class for all SWORD exceptions. It contains a textual message, which you can access using the what() method. It implements the std::exception interface.

When you build an exception, the content of the stream "sword::estream" is automatically used as the message, and then the stream is cleared. The exception message stream is thread-local, so different exception messages can be built simultaneously in different threads.

     sword::estream << "The error context is : value=" << value;
     throw sword::Exception();
  

You can also define your own exception classes by deriving from sword::Exception:

     class MyException : public sword::Exception {};
  


Constructor & Destructor Documentation

sword::Exception::Exception  
 

Builds an exception using the message stream 'estream'.

sword::Exception::Exception const std::string &    message
 

Builds an exception using the provided message.

sword::Exception::Exception const char *    message
 

Builds an exception using the provided message.


Member Function Documentation

virtual const char* sword::Exception::what   const throw () [virtual]
 

Returns the exception message (implements std::exception).


Generated on Tue Dec 23 20:08:57 2003 for SWORD by doxygen1.3-rc2