SFrame 3.6
|
00001 // Dear emacs, this is -*- c++ -*- 00002 // $Id: SError.h 120 2009-08-27 12:02:57Z krasznaa $ 00003 /*************************************************************************** 00004 * @Project: SFrame - ROOT-based analysis framework for ATLAS 00005 * @Package: Core 00006 * 00007 * @author Stefan Ask <Stefan.Ask@cern.ch> - Manchester 00008 * @author David Berge <David.Berge@cern.ch> - CERN 00009 * @author Johannes Haller <Johannes.Haller@cern.ch> - Hamburg 00010 * @author A. Krasznahorkay <Attila.Krasznahorkay@cern.ch> - CERN/Debrecen 00011 * 00012 ***************************************************************************/ 00013 00014 #ifndef SFRAME_CORE_SError_H 00015 #define SFRAME_CORE_SError_H 00016 00017 // STD include(s): 00018 #include <exception> 00019 #include <sstream> 00020 00030 class SError : public std::exception, 00031 public std::ostringstream { 00032 00033 public: 00035 00039 enum Severity { 00040 SkipEvent = 1, 00041 SkipFile = 2, 00042 SkipInputData = 3, 00043 SkipCycle = 4, 00044 StopExecution = 5 00045 }; 00046 00048 SError( Severity severity = SkipEvent ) throw(); 00050 SError( const char* description, Severity severity = SkipEvent ) throw(); 00052 SError( const SError& parent ) throw(); 00053 00055 virtual ~SError() throw(); 00056 00058 void SetDescription( const char* description ) throw(); 00060 void SetSeverity( Severity severity ) throw(); 00061 00063 virtual const char* what() const throw(); 00065 virtual Severity request() const throw(); 00066 00068 00074 template < class T > SError& operator<< ( T arg ) { 00075 ( * ( std::ostringstream* ) this ) << arg; 00076 return *this; 00077 } 00078 00079 private: 00081 00085 Severity m_severity; 00086 00087 }; // class SError 00088 00089 #endif // SFRAME_CORE_SError_H