GSI Object Oriented Online Offline (Go4)
GO4-6.3.0
|
#include <TGo4MbsSource.h>
Public Member Functions | |
TGo4MbsSource () | |
TGo4MbsSource (const char *name, Int_t mode) | |
TGo4MbsSource (TGo4MbsSourceParameter *par, Int_t mode) | |
virtual | ~TGo4MbsSource () |
Bool_t | CheckEventClass (TClass *cl) override |
Bool_t | BuildEvent (TGo4EventElement *dest) override |
virtual Int_t | Close () |
virtual Int_t | Open () |
virtual Int_t | NextEvent () |
void | BuildMbsEvent (TGo4MbsEvent *target) |
TGo4MbsSubEvent * | BuildMbsSubEvent (TGo4MbsEvent *target, Int_t fullID, Short_t *source, Int_t datalength) |
void | SetStartEvent (UInt_t firstindex) |
void | SetStopEvent (UInt_t lastindex) |
void | SetEventInterval (UInt_t skipinterval) |
void | SetTimeout (Int_t time) |
void | SetPort (Int_t port) |
s_filhe * | GetInfoHeader () const |
virtual s_bufhe * | GetBufferHeader () |
void | SetPrintEvent (Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0) |
void | SetDataCopyMode (Bool_t on) |
![]() | |
TGo4EventSource () | |
TGo4EventSource (const char *name) | |
virtual | ~TGo4EventSource () |
void | Clear (Option_t *opt="") override |
Int_t | GetCreateStatus () const |
Int_t | GetEventStatus () const |
const char * | GetErrMess () const |
virtual const char * | GetActiveName () const |
Static Public Member Functions | |
static void | SetPollingMode (Bool_t on=kTRUE) |
Static Public Attributes | |
static const UInt_t | fguLONGBYCHAR = sizeof(Int_t) / sizeof(Char_t) |
static const UInt_t | fguSHORTBYCHAR = sizeof(Short_t) / sizeof(Char_t) |
static const UInt_t | fguLONGBYSHORT = sizeof(Int_t) / sizeof(Short_t) |
static const UInt_t | fguEVHEBYCHAR = sizeof(s_evhe) / sizeof(Char_t) |
![]() | |
static const Int_t | fgiTIMEOUTDEFAULT =1 |
Protected Attributes | |
s_evt_channel * | fxInputChannel {nullptr} |
s_ve10_1 * | fxEvent {nullptr} |
s_bufhe * | fxBuffer {nullptr} |
s_filhe * | fxInfoHeader {nullptr} |
Bool_t | fbIsOpen {kFALSE} |
Bool_t | fbDataCopyMode {kFALSE} |
ULong_t | fuEventCounter {0} |
Bool_t | fbFirstEvent {kFALSE} |
ULong_t | fuStartEvent {0} |
ULong_t | fuStopEvent {0} |
ULong_t | fuEventInterval {0} |
Int_t | fiTimeout {0} |
Bool_t | fbPollingMode {kFALSE} |
Int_t | fiPort {0} |
if true, use short timeout to keep gSystem->ProcessEvents() running More... | |
TGo4MbsSourcePrintPar | fxPrEventPar |
Static Protected Attributes | |
static Bool_t | gbPollingMode = kFALSE |
Private Member Functions | |
Int_t | GetMode () const |
number of allowed reconnect retries More... | |
Private Attributes | |
Int_t | fiMode {0} |
Int_t | fiRetryCnt {0} |
Additional Inherited Members | |
![]() | |
enum | { fguTXTLEN = 256 } |
![]() | |
void | SetErrMess (const char *txt) |
void | SetEventStatus (Int_t status) |
void | SetCreateStatus (Int_t status) |
void | ThrowError (Int_t creastat, Int_t errstat, const char *message,...) |
void | ThrowEOF (Int_t creastat, Int_t errstat, const char *message,...) |
Definition at line 60 of file TGo4MbsSource.h.
TGo4MbsSource::TGo4MbsSource | ( | ) |
default for streamer
Definition at line 77 of file TGo4MbsSource.cxx.
References f_evt_control(), fxInputChannel, and GO4TRACE.
TGo4MbsSource::TGo4MbsSource | ( | const char * | name, |
Int_t | mode | ||
) |
Definition at line 58 of file TGo4MbsSource.cxx.
References f_evt_control(), TGo4EventSource::fgiTIMEOUTDEFAULT, fxInputChannel, GO4TRACE, and SetTimeout().
TGo4MbsSource::TGo4MbsSource | ( | TGo4MbsSourceParameter * | par, |
Int_t | mode | ||
) |
Definition at line 38 of file TGo4MbsSource.cxx.
References f_evt_control(), fxInputChannel, and GO4TRACE.
|
virtual |
Definition at line 91 of file TGo4MbsSource.cxx.
References Close(), fxInputChannel, and GO4TRACE.
|
overridevirtual |
Fill the destination event
dest |
Reimplemented from TGo4EventSource.
Definition at line 117 of file TGo4MbsSource.cxx.
References BuildMbsEvent(), TGo4Log::Debug(), TGo4EventSource::GetErrMess(), GETEVT__SUCCESS, and NextEvent().
void TGo4MbsSource::BuildMbsEvent | ( | TGo4MbsEvent * | target | ) |
This methods actually fills the target event class which is passed as pointer. Uses the latest event which is referenced by fxEvent or fxBuffer. Does not fetch a new event from source, therefore one source event may be used to fill several TGo4MbsEvent classes. To get a new event call NextEvent() before this method.
Definition at line 130 of file TGo4MbsSource.cxx.
References TGo4MbsEvent::AddSubEvent(), TGo4Log::Debug(), f_evt_type(), fbDataCopyMode, fguEVHEBYCHAR, fguSHORTBYCHAR, TGo4MbsSourcePrintPar::fiData, TGo4MbsSourcePrintPar::fiHex, TGo4MbsSourcePrintPar::fiLong, TGo4MbsSourcePrintPar::fiNum, TGo4MbsSourcePrintPar::fiSid, fxBuffer, fxEvent, fxPrEventPar, TGo4EventSource::GetErrMess(), TGo4EventSource::GetEventStatus(), GETEVT__SUCCESS, GO4TRACE, s_ve10_1::i_dummy, s_ves10_1::i_subtype, s_ve10_1::i_subtype, s_ve10_1::i_trigger, s_ves10_1::i_type, s_ve10_1::i_type, s_ve10_1::l_count, s_evhe::l_dlen, s_ve10_1::l_dlen, s_ves10_1::l_dlen, TGo4MbsEvent::SetCount(), TGo4MbsEvent::SetDlen(), TGo4MbsEvent::SetDummy(), TGo4EventSource::SetErrMess(), TGo4MbsSubEvent::SetSubtype(), TGo4MbsEvent::SetSubtype(), TGo4MbsEvent::SetTrigger(), TGo4MbsSubEvent::SetType(), TGo4MbsEvent::SetType(), and TGo4EventElement::SetValid().
Referenced by BuildEvent().
TGo4MbsSubEvent * TGo4MbsSource::BuildMbsSubEvent | ( | TGo4MbsEvent * | target, |
Int_t | fullID, | ||
Short_t * | source, | ||
Int_t | datalength | ||
) |
Auxiliary function to fill datalength words (Short_t) from source into the next subevent of target with matching header fullID longword. Returns handle to this subevent.
Definition at line 243 of file TGo4MbsSource.cxx.
References TGo4MbsEvent::AddSubEvent(), and fbDataCopyMode.
|
overridevirtual |
Check that filled event is a proper class
Reimplemented from TGo4EventSource.
Definition at line 112 of file TGo4MbsSource.cxx.
|
virtual |
Close the file or connection.
Reimplemented in TGo4MbsFile, and TGo4MbsRandom.
Definition at line 405 of file TGo4MbsSource.cxx.
References f_evt_get_close(), fbIsOpen, fxInputChannel, TGo4EventSource::GetCreateStatus(), GETEVT__SUCCESS, and GO4TRACE.
Referenced by NextEvent(), TGo4MbsEventServer::~TGo4MbsEventServer(), ~TGo4MbsSource(), TGo4MbsStream::~TGo4MbsStream(), TGo4MbsTransport::~TGo4MbsTransport(), and TGo4RevServ::~TGo4RevServ().
|
virtual |
User access to current event buffer header.
Reimplemented in TGo4MbsRandom.
Definition at line 419 of file TGo4MbsSource.cxx.
References f_evt_get_buffer_ptr(), and fxInputChannel.
Referenced by TGo4MbsEvent::GetMbsBufferHeader().
|
inline |
User access to info header. May contain additional run information
Definition at line 111 of file TGo4MbsSource.h.
Referenced by TGo4MbsEvent::GetMbsSourceHeader().
|
inlineprivate |
number of allowed reconnect retries
Definition at line 145 of file TGo4MbsSource.h.
Referenced by Open().
|
virtual |
Requests the next event from mbs source. Returns event status value.
Reimplemented in TGo4MbsFile, and TGo4MbsRandom.
Definition at line 256 of file TGo4MbsSource.cxx.
References Close(), f_evt_error(), f_evt_get_event(), fbFirstEvent, fbIsOpen, fbPollingMode, TGo4EventSource::fguTXTLEN, fiMode, fiRetryCnt, fuEventCounter, fuEventInterval, fuStartEvent, fuStopEvent, fxBuffer, fxEvent, fxInputChannel, TGo4EventSource::GetErrMess(), TGo4EventSource::GetEventStatus(), GETEVT__EVENT, GETEVT__NOMORE, GETEVT__REVSERV, GETEVT__STREAM, GETEVT__TIMEOUT, GETEVT__TRANS, GO4TRACE, HandleAnlysisEvents(), TGo4Log::Info(), Open(), TGo4EventSource::SetErrMess(), TGo4EventSource::SetEventStatus(), and TGo4Log::Warn().
Referenced by BuildEvent().
|
virtual |
Open the file or connection.
Reimplemented in TGo4MbsFile, and TGo4MbsRandom.
Definition at line 347 of file TGo4MbsSource.cxx.
References s_evt_channel::cb_polling, TGo4Log::Debug(), f_evt_error(), f_evt_get_open(), f_evt_source_port(), f_evt_timeout(), fbIsOpen, fbPollingMode, TGo4EventSource::fguTXTLEN, fiMode, fiPort, fiTimeout, fxInfoHeader, fxInputChannel, gbPollingMode, TGo4EventSource::GetCreateStatus(), GETEVT__EVENT, GETEVT__FILE, GETEVT__REVSERV, GETEVT__STREAM, GETEVT__SUCCESS, GETEVT__TRANS, GetMode(), GO4TRACE, HandleAnlysisEvents(), TGo4EventSource::SetCreateStatus(), and TGo4EventSource::SetErrMess().
Referenced by NextEvent(), TGo4MbsEventServer::TGo4MbsEventServer(), TGo4MbsStream::TGo4MbsStream(), TGo4MbsTransport::TGo4MbsTransport(), and TGo4RevServ::TGo4RevServ().
|
inline |
Definition at line 134 of file TGo4MbsSource.h.
|
inline |
Definition at line 104 of file TGo4MbsSource.h.
|
static |
|
inline |
Definition at line 108 of file TGo4MbsSource.h.
void TGo4MbsSource::SetPrintEvent | ( | Int_t | num = 1 , |
Int_t | sid = -1 , |
||
Int_t | longw = 1 , |
||
Int_t | hexw = 1 , |
||
Int_t | dataw = 0 |
||
) |
Set mbs source into printout (verbose) mode for the next num events. Subevent id sid may be specific (-1 is all subevents). Parameters longw, hexw, dataw switch output data formats. See MbsAPI function f_evt_type().
Definition at line 103 of file TGo4MbsSource.cxx.
References TGo4MbsSourcePrintPar::fiData, TGo4MbsSourcePrintPar::fiHex, TGo4MbsSourcePrintPar::fiLong, TGo4MbsSourcePrintPar::fiNum, TGo4MbsSourcePrintPar::fiSid, and fxPrEventPar.
Referenced by TGo4ComSetPrintEvent::ExeCom(), and TGo4MbsEvent::SetPrintEvent().
|
inline |
Define the Start index for the NextEvent
Definition at line 100 of file TGo4MbsSource.h.
|
inline |
Definition at line 102 of file TGo4MbsSource.h.
|
inline |
Definition at line 106 of file TGo4MbsSource.h.
Referenced by TGo4MbsSource().
|
protected |
switches buildmbs event mode: if true, data buffer is copied to own buffer of subevent. If false (default), mbs subevent uses reference to external data buffer of eventapi.
Definition at line 165 of file TGo4MbsSource.h.
Referenced by BuildMbsEvent(), and BuildMbsSubEvent().
|
protected |
Indicates if first event should be extracted
Definition at line 171 of file TGo4MbsSource.h.
Referenced by TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::OpenFile().
|
protected |
Definition at line 160 of file TGo4MbsSource.h.
Referenced by TGo4MbsRandom::Close(), TGo4MbsFile::Close(), Close(), NextEvent(), TGo4MbsRandom::Open(), TGo4MbsFile::Open(), and Open().
|
protected |
Definition at line 185 of file TGo4MbsSource.h.
Referenced by NextEvent(), and Open().
|
static |
ratio sizeof(s_evhe) by sizeof(char).
Definition at line 126 of file TGo4MbsSource.h.
Referenced by BuildMbsEvent().
|
static |
ratio sizeof(long) by sizeof(char).
Definition at line 117 of file TGo4MbsSource.h.
|
static |
ratio sizeof(long) by sizeof(short).
Definition at line 123 of file TGo4MbsSource.h.
Referenced by TGo4MbsSubEvent::Clear().
|
static |
ratio sizeof(short) by sizeof(char).
Definition at line 120 of file TGo4MbsSource.h.
Referenced by BuildMbsEvent().
|
private |
Mode of operation
Definition at line 141 of file TGo4MbsSource.h.
Referenced by NextEvent(), and Open().
|
protected |
if true, use short timeout to keep gSystem->ProcessEvents() running
Optional port parameter, if non-positive default port number for transport will be used
Definition at line 188 of file TGo4MbsSource.h.
Referenced by Open().
|
private |
Definition at line 143 of file TGo4MbsSource.h.
Referenced by NextEvent().
|
protected |
Timeout in seconds for mbs getevent. If -1, no timeout (default)
Definition at line 183 of file TGo4MbsSource.h.
Referenced by Open().
|
protected |
Current event index counter
Definition at line 168 of file TGo4MbsSource.h.
Referenced by TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::NextFile().
|
protected |
Number of events to skip from file in between two read events
Definition at line 180 of file TGo4MbsSource.h.
Referenced by TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::NextFile().
|
protected |
Index of first event to process.
Definition at line 174 of file TGo4MbsSource.h.
Referenced by TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::NextFile().
|
protected |
Index of last event to process.
Definition at line 177 of file TGo4MbsSource.h.
Referenced by TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::NextFile().
|
protected |
Points to the current gsi buffer structure filled by the event source.
Definition at line 155 of file TGo4MbsSource.h.
Referenced by BuildMbsEvent(), and NextEvent().
|
protected |
Definition at line 152 of file TGo4MbsSource.h.
Referenced by BuildMbsEvent(), TGo4MbsRandom::Close(), TGo4MbsFile::NextEvent(), TGo4MbsRandom::NextEvent(), NextEvent(), and TGo4MbsRandom::Open().
|
protected |
Reference to header info delivered by source.
Definition at line 158 of file TGo4MbsSource.h.
Referenced by Open(), and TGo4MbsFile::OpenFile().
|
protected |
Event channel structure used by event source.
Definition at line 150 of file TGo4MbsSource.h.
Referenced by Close(), TGo4MbsFile::CloseFile(), GetBufferHeader(), TGo4MbsFile::NextEvent(), NextEvent(), Open(), TGo4MbsFile::OpenFile(), TGo4MbsSource(), and ~TGo4MbsSource().
|
protected |
This structure keeps parameters for printevent mode
Definition at line 191 of file TGo4MbsSource.h.
Referenced by BuildMbsEvent(), and SetPrintEvent().
|
staticprotected |
Definition at line 193 of file TGo4MbsSource.h.
Referenced by Open(), and SetPollingMode().