GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4EventSource.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 TGO4EVENTSOURCE_H
15 #define TGO4EVENTSOURCE_H
16 
17 #include "TNamed.h"
18 
27 class TGo4EventElement;
28 
29 class TGo4EventSource : public TNamed {
30  public:
31 
33 
34  TGo4EventSource(const char *name);
35 
36  virtual ~TGo4EventSource();
37 
38  /* We overwrite the default TNamed::Clear that would
39  * erase our name and title!
40  * Implement this method in your parameter class
41  * if you would like to reset any values with the
42  * eraser button in the gui remote browser*/
43  void Clear(Option_t *opt = "") override;
44 
46  Int_t GetCreateStatus() const { return fiCreateStatus; }
47 
49  Int_t GetEventStatus() const { return fiEventStatus; }
50 
52  const char *GetErrMess() const { return fxErrMess.Data(); }
53 
56  virtual const char *GetActiveName() const;
57 
59  virtual Bool_t CheckEventClass(TClass *cl);
60 
62  virtual Bool_t BuildEvent(TGo4EventElement *dest) { return kTRUE; }
63 
65  static const Int_t fgiTIMEOUTDEFAULT;
66 
67 
68  protected:
73  void SetErrMess(const char *txt) { fxErrMess = txt; }
74 
76  void SetEventStatus(Int_t status) { fiEventStatus = status; }
77 
79  void SetCreateStatus(Int_t status) { fiCreateStatus = status; }
80 
82  void ThrowError(Int_t creastat, Int_t errstat, const char *message,...)
83  #if defined(__GNUC__) && !defined(__CINT__)
84  __attribute__((format(printf, 4, 5)))
85  #endif
86  ;
87 
89  void ThrowEOF(Int_t creastat, Int_t errstat, const char *message,...)
90  #if defined(__GNUC__) && !defined(__CINT__)
91  __attribute__((format(printf, 4, 5)))
92  #endif
93  ;
94 
96  enum { fguTXTLEN = 256 };
97 
98  private:
99 
101  Int_t fiCreateStatus{0};
102 
104  Int_t fiEventStatus{0};
105 
107  TString fxErrMess;
108 
109  ClassDefOverride(TGo4EventSource,1)
110 };
111 
112 #endif //TGO4EVENTSOURCE_H
void ThrowEOF(Int_t creastat, Int_t errstat, const char *message,...)
virtual ~TGo4EventSource()
const char * GetErrMess() const
Int_t GetCreateStatus() const
virtual Bool_t CheckEventClass(TClass *cl)
void SetCreateStatus(Int_t status)
virtual const char * GetActiveName() const
void ThrowError(Int_t creastat, Int_t errstat, const char *message,...)
void SetErrMess(const char *txt)
virtual Bool_t BuildEvent(TGo4EventElement *dest)
static const Int_t fgiTIMEOUTDEFAULT
void SetEventStatus(Int_t status)
void Clear(Option_t *opt="") override
Int_t GetEventStatus() const