GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
29
30class TGo4EventSource : public TNamed {
31 public:
32
34
35 TGo4EventSource(const char *name);
36
37 virtual ~TGo4EventSource();
38
39 /* We overwrite the default TNamed::Clear that would
40 * erase our name and title!
41 * Implement this method in your parameter class
42 * if you would like to reset any values with the
43 * eraser button in the gui remote browser*/
44 void Clear(Option_t *opt = "") override;
45
47 Int_t GetCreateStatus() const { return fiCreateStatus; }
48
50 Int_t GetEventStatus() const { return fiEventStatus; }
51
53 const char *GetErrMess() const { return fxErrMess.Data(); }
54
57 virtual const char *GetActiveName() const;
58
60 virtual Bool_t CheckEventClass(TClass *cl);
61
63 virtual Bool_t BuildEvent(TGo4EventElement *dest) { return kTRUE; }
64
66 static const Int_t fgiTIMEOUTDEFAULT;
67
68
69 protected:
74 void SetErrMess(const char *txt) { fxErrMess = txt; }
75
77 void SetEventStatus(Int_t status) { fiEventStatus = status; }
78
80 void SetCreateStatus(Int_t status) { fiCreateStatus = status; }
81
83 void ThrowError(Int_t creastat, Int_t errstat, const char *message,...)
84 #if defined(__GNUC__) && !defined(__CLING__)
85 __attribute__((format(printf, 4, 5)))
86 #endif
87 ;
88
90 void ThrowEOF(Int_t creastat, Int_t errstat, const char *message,...)
91 #if defined(__GNUC__) && !defined(__CLING__)
92 __attribute__((format(printf, 4, 5)))
93 #endif
94 ;
95
97 enum { fguTXTLEN = 256 };
98
99 private:
100
103
106
108 TString fxErrMess;
109
110 ClassDefOverride(TGo4EventSource,1)
111};
112
113#endif //TGO4EVENTSOURCE_H
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
virtual const char * GetActiveName() const
Access to the name of the currently active source.
Int_t fiEventStatus
Contains return value of eventsource getevent (e.g.
virtual Bool_t BuildEvent(TGo4EventElement *dest)
Fill the destination event dest.
static const Int_t fgiTIMEOUTDEFAULT
Default timeout in seconds for event input.
void SetErrMess(const char *txt)
To be used for modification of the message by the event source implementation.
void SetEventStatus(Int_t status)
Status of the last event.
const char * GetErrMess() const
Status/ error message of the last event.
virtual Bool_t CheckEventClass(TClass *cl)
Check that event class is supported by event source.
Int_t GetEventStatus() const
Status of the last event.
void ThrowError(Int_t creastat, Int_t errstat, const char *message,...)
Exception thrower.
void ThrowEOF(Int_t creastat, Int_t errstat, const char *message,...)
EOF thrower.
Int_t fiCreateStatus
Contains return value of eventsource open (e.g.
TString fxErrMess
Most recent error message.
Int_t GetCreateStatus() const
Status value of server/file open.
virtual ~TGo4EventSource()
void SetCreateStatus(Int_t status)
Status value of event source init (file/server open).
void Clear(Option_t *opt="") override