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

Exception.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.cs.cmu.edu/~lemur/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 #ifndef _EXCEPTION_HPP
00014 #define _EXCEPTION_HPP
00015 #include <iostream>
00016 using namespace std;
00017 
00019 
00057 class Exception {
00058 public:
00059   Exception(char *throwerString=" unknown thrower", char *whatString="unknown exception"):
00060     thrower(throwerString), what(whatString) {}
00061   ~Exception() {}
00062   void writeMessage(ostream &os = cerr);
00063 private:
00064   char *thrower;
00065   char *what;
00066 };
00067 
00068 
00069 inline void Exception::writeMessage(ostream &os)
00070 {
00071   os << "Exception [by "<< thrower << "]:"<< what << endl;
00072 }
00073 #endif

Generated at Fri Jul 26 18:22:26 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000