Alida-C++ 0.1

exceptions/ALDException.h

Go to the documentation of this file.
00001 #ifndef EXCEPTION_H_INCLUDED
00002 #define EXCEPTION_H_INCLUDED
00003 
00004 #include <exception>
00005 #include <iostream>
00006 
00007 // ********************************************************************
00008 // static file variables and defines / declarations
00009 // ********************************************************************
00010 
00011 namespace Alida
00012 {
00013 
00014 // ********************************************************************
00015 
00017 class ALDException : public  std::exception
00018 {
00019  protected:
00020 
00022   const std::string className;
00023 
00025   const std::string function;
00026 
00028   const std::string errorMsg;
00029 
00030  public:
00031   
00033   ALDException(std::string c,
00034          std::string f,
00035          std::string e) :
00036     className( c), function( f), errorMsg( e){
00037   };
00038 
00040   virtual ~ALDException() throw() {};
00041   
00043   void printMsg() {
00044     std::cerr << className << "::" << function 
00045           << " - " << errorMsg << std::endl;
00046   };
00047 };
00048 
00049 }
00050 
00051 // ********************************************************************
00052 
00053 #endif // EXCEPTION_H_INCLUDED
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines