Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Exception Class Reference

Default Exception class. More...

#include <Exception.hpp>

List of all members.

Public Methods

 Exception (char *throwerString="unknown thrower",char *whatString="unknown exception")
 ~Exception ()
void writeMessage (ostream &os=cerr)


Detailed Description

Default Exception class.

This is the base Exception class that all other exceptions should inherit from. Some guidelines for using Exception:

(1) Define your main function as "int AppMain(int argc, char *argv[])" rather than the normal "main" function. (2) When throwing an exception from a class (e.g., MyClass), do

" throw Exception("MyClass", "description of exception");" (3) If you want to process the exception, do

 
             try { 
	     ... ... 
	        throw Exception("MyClass", "an exception");
              }
	      catch  (Exception &ex) {
	         process exception...
             }

    

(4) If the exception is not caught in the application, it will be caught be the main function in the lemur toolkit. The default exception handler prints the following message on stderr and terminates the program.

     Exception [ by MyClass]: an exception
     Program aborted due to exception
 

(5) You can define more specific exceptions by subclassing Exception. All exceptions will be caught by the default main function if not caught by an application.


Constructor & Destructor Documentation

Exception::Exception ( char * throwerString = " unknown thrower",
char * whatString = "unknown exception" ) [inline]
 

Exception::~Exception ( ) [inline]
 


Member Function Documentation

void Exception::writeMessage ( ostream & os = cerr ) [inline]
 


The documentation for this class was generated from the following file:
Generated at Fri Jul 26 18:22:47 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000