00001 #ifndef LCIO_EXCEPTION_H
00002 #define LCIO_EXCEPTION_H 1
00003
00004 #include <string>
00005 #include <exception>
00006 #include <stdexcept>
00007
00008
00009
00010
00011
00012
00013
00014 namespace EVENT {
00015
00021 class Exception : public std::exception {
00022
00023
00024 protected:
00025 std::string message{} ;
00026
00027 Exception(){ ; }
00028
00029 public:
00030 virtual ~Exception() throw() { ; }
00031
00032 Exception( const std::string& text ){
00033 message = "lcio::Exception: " + text ;
00034 }
00035
00036 virtual const char* what() const throw() { return message.c_str() ; }
00037
00038 };
00039
00044 class EventException : public Exception{
00045
00046 protected:
00047 EventException() { ; }
00048 public:
00049 virtual ~EventException() throw() { ; }
00050
00051 EventException( std::string text ){
00052 message = "lcio::EventException: " + text ;
00053 }
00054 };
00055
00060 class DataNotAvailableException : public EventException{
00061
00062 public:
00063 virtual ~DataNotAvailableException() throw() { ; }
00064
00065 DataNotAvailableException( std::string text ) {
00066 message = "lcio::DataNotAvailableException: " + text ;
00067 }
00068 };
00069
00074 class ReadOnlyException : public EventException{
00075
00076 public:
00077 virtual ~ReadOnlyException() throw() { ; }
00078
00079 ReadOnlyException( std::string text ){
00080 message = "lcio::ReadOnlyException: " + text ;
00081 }
00082 };
00083
00084 }
00085
00086 namespace IO {
00087
00092 class IOException : public EVENT::Exception{
00093
00094 protected:
00095 IOException() { } ;
00096
00097 public:
00098 IOException( std::string text ){
00099 message = "lcio::IOException: " + text ;
00100 }
00101 };
00102
00103
00108 class EndOfDataException : public IOException{
00109 public:
00110 virtual ~EndOfDataException() throw() { ; }
00111
00112 EndOfDataException( std::string text ){
00113 message = "lcio::EndOfDataException: " + text ;
00114 }
00115 };
00116
00117 }
00118 #endif