GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4UserException.h
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#ifndef TGO4USEREXCEPTION_H
15#define TGO4USEREXCEPTION_H
16
18
19#include "TString.h"
20
21/* will skip subsequent steps for this event silently and start next event */
22#define GO4_SKIP_EVENT throw TGo4UserException(1,"");
23
24/* will skip subsequent steps for this event and start next event,
25 * will send printf style message to gui */
26#define GO4_SKIP_EVENT_MESSAGE(...) throw TGo4UserException(1,__VA_ARGS__);
27
28/* will stop analysis without message to gui */
29#define GO4_STOP_ANALYSIS throw TGo4UserException(3,"");
30
31/* will stop analysis with a printf style message to gui */
32#define GO4_STOP_ANALYSIS_MESSAGE(...) throw TGo4UserException(3,__VA_ARGS__);
33
34
35
41
43
44 public:
45
46 TGo4UserException (Int_t prio, const char *text,...)
47 #if defined(__GNUC__) && !defined(__CLING__)
48 __attribute__((format(printf, 3, 4)))
49 #endif
50 ;
51
52 virtual ~TGo4UserException();
53
54 Int_t Handle() override;
55
57
59
61 Int_t GetPriority() const { return fiPriority; }
62
64 const char *GetMessage() const { return fxMessage.Data(); }
65
66 protected:
67
69 TString fxMessage;
70
72 Int_t fiPriority{0};
73
74 private:
76};
77
78#endif
TString fxMessage
User defined description of the exception reason.
TGo4UserException(Int_t prio, const char *text,...)
TGo4UserException & operator=(const TGo4UserException &right)
TGo4UserException()=delete
Int_t Handle() override
This is a default handler function for the respective exception type.
Int_t fiPriority
Priority of message.
Int_t GetPriority() const
Message priority.
const char * GetMessage() const
Status message of last Process() call.