#include <InputIter.h>
Public Types | |
typedef boost::shared_ptr< PSEvt::Event > | EventPtr |
typedef std::pair< EventType, EventPtr > | value_type |
StateNone = 0 | |
StateConfigured = 1 | |
StateRunning = 2 | |
StateScanning = 3 | |
NumStates = 4 | |
BeginJob | |
Returned at the begin of job. | |
BeginRun | |
Returned at the begin of run. | |
BeginCalibCycle | |
Returned at the begin of calib cycle. | |
Event | |
Returned for regular event. | |
EndCalibCycle | |
Returned at the end of calib cycle. | |
EndRun | |
Returned at the end of run. | |
EndJob | |
Returned at the end of job. | |
None | |
Returned if there are no more events. | |
NumEventTypes | |
Total number off event types. | |
enum | State { StateNone = 0, StateConfigured = 1, StateRunning = 2, StateScanning = 3, NumStates = 4 } |
State order must not change, state machine depends on ordering. More... | |
enum | EventType { BeginJob, BeginRun, BeginCalibCycle, Event, EndCalibCycle, EndRun, EndJob, None, NumEventTypes } |
Enumeration for the event types returned by iterator. More... | |
Public Member Functions | |
InputIter (const boost::shared_ptr< InputModule > &inputModule, const boost::shared_ptr< PSEnv::Env > &env) | |
Constructor takes instance of input module and environment object. | |
~InputIter () | |
PSEnv::Env & | env () const |
Get environment object. | |
value_type | next () |
void | finish () |
The purpose of this class is to provide iteration over "events" in psana framework with well-defined properties. Event in this context means not only regular events but also transitions like BeginRun, EndRun, etc. Instance of this class acts like iterator which returns two items for each iteration - event type and event contents (PSEvt::Event object). It guarantees correct nesting of transitions and events, so that regular events happen only inside BeginCalibCycle/EndCalibCycle, which in turn happen only inside BeginRun/EndRun.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 71 of file InputIter.h.
typedef boost::shared_ptr<PSEvt::Event> psana::InputIter::EventPtr |
Definition at line 90 of file InputIter.h.
typedef std::pair<EventType, EventPtr> psana::InputIter::value_type |
Definition at line 91 of file InputIter.h.
Enumeration for the event types returned by iterator.
Definition at line 78 of file InputIter.h.
State order must not change, state machine depends on ordering.
Definition at line 75 of file InputIter.h.
psana::InputIter::InputIter | ( | const boost::shared_ptr< InputModule > & | inputModule, | |
const boost::shared_ptr< PSEnv::Env > & | env | |||
) |
Constructor takes instance of input module and environment object.
Definition at line 52 of file InputIter.cpp.
References BeginCalibCycle, BeginJob, BeginRun, EndCalibCycle, EndJob, EndRun, None, StateConfigured, StateNone, StateRunning, and StateScanning.
psana::InputIter::~InputIter | ( | ) |
PSEnv::Env& psana::InputIter::env | ( | ) | const [inline] |
void psana::InputIter::finish | ( | ) |
Prepare to stop iteration, instructs iterator to stop reading data from input module and produce standard EndCalibCycle/EndRun/EndJob sequence on the following calls to next().
Definition at line 196 of file InputIter.cpp.
References StateNone.
InputIter::value_type psana::InputIter::next | ( | ) |
Method that runs one iteration and returns event type, and event object.
Definition at line 94 of file InputIter.cpp.
References psana::InputModule::Abort, psana::InputModule::BeginCalibCycle, psana::InputModule::BeginRun, psana::InputModule::DoEvent, psana::InputModule::EndCalibCycle, psana::InputModule::EndRun, Event, logger, MsgLog, None, psana::InputModule::Skip, StateConfigured, StateNone, StateRunning, StateScanning, psana::InputModule::Stop, and WithMsgLog.