#include <IDatagramSource.h>
Inheritance diagram for PSXtcInput::IDatagramSource:
Public Member Functions | |
virtual | ~IDatagramSource () |
virtual void | init ()=0 |
virtual bool | next (std::vector< XtcInput::Dgram > &eventDg, std::vector< XtcInput::Dgram > &nonEventDg)=0 |
Return next datagram(s) from the source. | |
virtual bool | liveAvail (int numEvents) |
Protected Member Functions | |
IDatagramSource () |
Datagram source is an abstraction of a sequence of datagrams that can be iterated over. Instance method next() is called repeatedly to obtain next available datagram until this method returns empty instance.
In the future this interface could be extended to support direct access based on some index (e.g. time-based).
Definition at line 59 of file IDatagramSource.h.
virtual PSXtcInput::IDatagramSource::~IDatagramSource | ( | ) | [inline, virtual] |
Definition at line 63 of file IDatagramSource.h.
PSXtcInput::IDatagramSource::IDatagramSource | ( | ) | [inline, protected] |
Definition at line 103 of file IDatagramSource.h.
virtual void PSXtcInput::IDatagramSource::init | ( | ) | [pure virtual] |
Initialization method for datagram source, this is typically called in beginJob() method and it may contain initialization code which cannot be executed during construction of an instance.
Implemented in PSShmemInput::DgramSourceShmem, PSXtcInput::DgramSourceFile, and PSXtcInput::DgramSourceIndex.
virtual bool PSXtcInput::IDatagramSource::liveAvail | ( | int | numEvents | ) | [inline, virtual] |
Returns true if live mode and the available events on disk is > the argument numEvents
Reimplemented in PSXtcInput::DgramSourceFile.
Definition at line 98 of file IDatagramSource.h.
virtual bool PSXtcInput::IDatagramSource::next | ( | std::vector< XtcInput::Dgram > & | eventDg, | |
std::vector< XtcInput::Dgram > & | nonEventDg | |||
) | [pure virtual] |
Return next datagram(s) from the source.
This method returns two sets of datagrams - eventDg is the set of histograms belonging to the next event, nonEventDg is the set of datagrams which has some other data (like EPICS) which is needed for correct interpretation of current event. Currently eventDg should contain one datagram but potentially in the future we may start event building in offline and that list can grow longer. It nonEventDg is non-empty then it has to be processed first as those datagram should come from earlier time than eventDg and eventDg may contain data that overrides data in nonEventDg (e.g. some EPICS PV data may be contained in both nonEventDg and eventDg).
This method will called repeatedly until it returns false.
[out] | eventDg | returned set of datagrams for current event |
[out] | nonEventDg | returned set of datagrams containing other information. |
Implemented in PSShmemInput::DgramSourceShmem, PSXtcInput::DgramSourceFile, and PSXtcInput::DgramSourceIndex.