psana::InputIter Class Reference
[psana package]

Implementation of the iterator for input events. More...

#include <InputIter.h>

List of all members.

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::Envenv () const
 Get environment object.
value_type next ()
void finish ()


Detailed Description

Implementation of the iterator for input events.

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.

Version:
Id
InputIter.h 7529 2014-01-13 21:45:29Z salnikov@SLAC.STANFORD.EDU
Author:
Andy Salnikov

Definition at line 71 of file InputIter.h.


Member Typedef Documentation

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.


Member Enumeration Documentation

enum psana::InputIter::EventType

Enumeration for the event types returned by iterator.

Enumerator:
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.

Definition at line 78 of file InputIter.h.

enum psana::InputIter::State

State order must not change, state machine depends on ordering.

Enumerator:
StateNone 
StateConfigured 
StateRunning 
StateScanning 
NumStates 

Definition at line 75 of file InputIter.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 80 of file InputIter.cpp.

References StateNone.


Member Function Documentation

PSEnv::Env& psana::InputIter::env (  )  const [inline]

Get environment object.

Definition at line 103 of file InputIter.h.

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.


The documentation for this class was generated from the following files:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7