00001 // $Id: TGo4UserException.h 507 2009-11-06 13:47:05Z adamczew $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4USEREXCEPTION_H 00015 #define TGO4USEREXCEPTION_H 00016 00017 #include "TGo4RuntimeException.h" 00018 00019 #include "TString.h" 00020 00021 /* will skip subsequent steps for this event silently and start next event */ 00022 #define GO4_SKIP_EVENT throw TGo4UserException(1,""); 00023 00024 /* will skip subsequent steps for this event and start next event, 00025 * will send printf style message to gui */ 00026 #define GO4_SKIP_EVENT_MESSAGE(...) throw TGo4UserException(1,__VA_ARGS__); 00027 00028 /* will stop analysis without message to gui */ 00029 #define GO4_STOP_ANALYSIS throw TGo4UserException(3,""); 00030 00031 /* will stop analysis with a printf style message to gui */ 00032 #define GO4_STOP_ANALYSIS_MESSAGE(...) throw TGo4UserException(3,__VA_ARGS__); 00033 00034 00035 00042 class TGo4UserException : public TGo4RuntimeException { 00043 00044 public: 00045 00046 TGo4UserException (Int_t prio, const char* text,...); 00047 00048 virtual ~TGo4UserException(); 00049 00050 Int_t Handle (); 00051 00052 TGo4UserException(const TGo4UserException &right); 00053 00054 TGo4UserException & operator = (const TGo4UserException & right); 00055 00057 Int_t GetPriority() const { return fiPriority; } 00058 00060 const char* GetMessage() const { return fxMessage.Data(); } 00061 00062 protected: 00063 00065 TString fxMessage; 00066 00068 Int_t fiPriority; 00069 00070 private: 00071 TGo4UserException(); 00072 }; 00073 00074 #endif // #define