StdAir Logo  0.44.0
C++ Standard Airline IT Object Library
stdair_exceptions.hpp
Go to the documentation of this file.
00001 #ifndef __STDAIR_STDAIR_EXCEPTIONS_HPP
00002 #define __STDAIR_STDAIR_EXCEPTIONS_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <string>
00009 
00010 namespace stdair {
00011 
00019   class RootException : public std::exception { 
00020   public:
00024     RootException (const std::string& iWhat) : _what (iWhat) {}
00028     RootException() : _what ("No further details") {}
00029     
00033     virtual ~RootException() throw() {}
00034     
00038     const char* what() const throw() {
00039       return _what.c_str();
00040     }
00041     
00042   protected:
00046     std::string _what;
00047   };
00048   
00050   class FileNotFoundException : public RootException { 
00051   public:
00053     FileNotFoundException (const std::string& iWhat) : RootException (iWhat) {}
00054   };
00055   
00057   class NonInitialisedLogServiceException : public RootException { 
00058   public:
00060     NonInitialisedLogServiceException (const std::string& iWhat) 
00061       : RootException (iWhat) {}
00062   };
00063   
00065   class NonInitialisedServiceException : public RootException {
00066   public:
00068     NonInitialisedServiceException (const std::string& iWhat) 
00069       : RootException (iWhat) {}
00070   };
00071   
00073   class NonInitialisedContainerException : public RootException { 
00074   public:
00076     NonInitialisedContainerException (const std::string& iWhat) 
00077       : RootException (iWhat) {}
00078   };
00079   
00081   class NonInitialisedRelationShipException : public RootException { 
00082   public:
00084     NonInitialisedRelationShipException (const std::string& iWhat) 
00085       : RootException (iWhat) {}
00086   };
00087   
00089   class MemoryAllocationException : public RootException { 
00090   public:
00092     MemoryAllocationException (const std::string& iWhat) 
00093       : RootException (iWhat) {}
00094   };
00095   
00097   class ObjectLinkingException : public RootException { 
00098   public:
00100     ObjectLinkingException (const std::string& iWhat) : RootException (iWhat) {}
00101   };
00102   
00104   class DocumentNotFoundException : public RootException {
00105   public:
00107     DocumentNotFoundException (const std::string& iWhat) 
00108       : RootException (iWhat) {}
00109   };
00110   
00112   class ParserException : public RootException { 
00113   public:
00115     ParserException (const std::string& iWhat) : RootException (iWhat) {}
00116   };
00117   
00119   class SerialisationException : public RootException { 
00120   public:
00122     SerialisationException (const std::string& iWhat) : RootException (iWhat) {}
00123   };
00124   
00126   class KeyNotFoundException : public RootException { 
00127   public:
00129     KeyNotFoundException (const std::string& iWhat) : RootException (iWhat) {}
00130   };
00131   
00133   class CodeConversionException : public ParserException {  
00134   public:
00136     CodeConversionException (const std::string& iWhat)
00137       : ParserException (iWhat) {}
00138   };
00139   
00141   class CodeDuplicationException : public ParserException { 
00142   public:
00144     CodeDuplicationException (const std::string& iWhat)
00145       : ParserException(iWhat) {}
00146   };
00147   
00149   class ObjectCreationgDuplicationException : public ParserException {
00150   public:
00152     ObjectCreationgDuplicationException (const std::string& iWhat) 
00153       : ParserException (iWhat) {} 
00154   };
00155   
00157   class ObjectNotFoundException : public RootException {
00158   public:
00160     ObjectNotFoundException (const std::string& iWhat)
00161       : RootException (iWhat) {}
00162   };
00163 
00165   class ParsingFileFailedException : public ParserException {
00166   public:
00168     ParsingFileFailedException (const std::string& iWhat)
00169       : ParserException (iWhat) {}
00170   };
00171   
00173   class SQLDatabaseException : public RootException {
00174   public:
00176     SQLDatabaseException (const std::string& iWhat) : RootException (iWhat) {}
00177   };
00178   
00180   class NonInitialisedDBSessionManagerException : public RootException { 
00181   public:
00183     NonInitialisedDBSessionManagerException (const std::string& iWhat) 
00184       : RootException (iWhat) {}
00185   };
00186   
00188   class SQLDatabaseConnectionImpossibleException : public SQLDatabaseException {
00189   public:
00191     SQLDatabaseConnectionImpossibleException (const std::string& iWhat)
00192       : SQLDatabaseException (iWhat) {}
00193   };
00194 
00196   class EventException : public RootException { 
00197   public:
00199     EventException (const std::string& iWhat) : RootException (iWhat) {}
00200   };
00201 
00203   class EventQueueException : public RootException { 
00204   public:
00206     EventQueueException (const std::string& iWhat) : RootException (iWhat) {}
00207   };
00208 
00209 }
00210 #endif // __STDAIR_STDAIR_EXCEPTIONS_HPP