Main   Class Hierarchy   Classes   Compound List   Files   Compound Members   File Members   Pages  

error.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 /** @file error.h
00003     Base exception class.
00004 
00005     $Id: error_8h-source.html,v 1.1.1.1 2003/08/07 19:41:38 emarkus Exp $
00006     $Source: /usr/cvsroot/www_pathfind/libpathfind/0.1.0/doc/error_8h-source.html,v $
00007 */
00008 //-----------------------------------------------------------------------------
00009 
00010 #ifndef PATHFIND_ERROR_H
00011 #define PATHFIND_ERROR_H
00012 
00013 #include <exception>
00014 #include <string>
00015 #include <vector>
00016 
00017 //-----------------------------------------------------------------------------
00018 
00019 namespace PathFind
00020 {
00021     using namespace std;
00022 
00023     /** Base class for exceptions. */
00024     class Error
00025         : public exception
00026     {
00027     public:
00028         Error()
00029         { }
00030 
00031         Error(const string& what)
00032             : m_message(what)
00033         { }
00034 
00035         ~Error() throw();
00036         
00037         void setMessage(const string& message)
00038         {
00039             m_message = message;
00040         }
00041 
00042         const char* what() const throw()
00043         {
00044             return m_message.c_str();
00045         }
00046         
00047     private:
00048         string m_message;
00049     };
00050 }
00051 
00052 //-----------------------------------------------------------------------------
00053 
00054 #endif


Generated on Thu Aug 7 13:04:49 2003 by Doxygen1.3.1