#include <Module.h>
Inheritance diagram for psana::Module:
Public Types | |
OK | |
processing finished normally | |
Skip | |
skip all remaining modules for this event | |
Stop | |
finish with the events | |
Abort | |
abort immediately, no finalization | |
enum | Status { OK, Skip, Stop, Abort } |
Event processing status. More... | |
Public Member Functions | |
virtual | ~Module () |
virtual void | beginJob (Event &evt, Env &env) |
Method which is called once at the beginning of the job. | |
virtual void | beginRun (Event &evt, Env &env) |
Method which is called at the beginning of new run. | |
virtual void | beginCalibCycle (Event &evt, Env &env) |
Method which is called at the beginning of new calibration cycle (step). | |
virtual void | event (Event &evt, Env &env)=0 |
Method which is called with event data. | |
virtual void | endCalibCycle (Event &evt, Env &env) |
Method which is called at the end of the calibration cycle (step). | |
virtual void | endRun (Event &evt, Env &env) |
Method which is called at the end of the run. | |
virtual void | endJob (Event &evt, Env &env) |
Method which is called once at the end of the job. | |
void | reset () |
reset module status | |
Status | status () const |
get status | |
bool | observeAllEvents () const |
Returns true if this module is interested in all events including skipped. | |
Protected Member Functions | |
Module (const std::string &name, bool observeAllEvents=false) | |
The one and only constructor, needs module name. | |
void | skip () |
Signal framework to skip current event and do not call other downstream modules. | |
void | stop () |
Signal framework to stop event loop and finish job gracefully. | |
void | terminate () |
Signal framework to terminate immediately. |
This is the major customization point available to users. All analysis code should inherit from this class and provide implementation of one or few methods which have access to all event and non-event data being processed by framework.
User modules have some influence on the framework event loop, by calling one of the skip(), stop(), or terminate() methods user module can signal the framework to either skip the processing of the current event, stop analysis gracefully (after closing all output files) or abort anaylis immediately.
Subclasses must implement at least event() method, other methods have default implementation which does nothing useful.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 90 of file Module.h.
Event processing status.
The value returned from status() signals to framework what it should do next.
psana::Module::~Module | ( | ) | [virtual] |
Definition at line 49 of file Module.cpp.
psana::Module::Module | ( | const std::string & | name, | |
bool | observeAllEvents = false | |||
) | [protected] |
Method which is called at the beginning of new calibration cycle (step).
[in,out] | evt | Event object. In this call it does not have any event data but can be used to pass information between modules. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
Method which is called once at the beginning of the job.
[in,out] | evt | Event object. In this call it does not have any event data but can be used to pass information between modules. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
Method which is called at the beginning of new run.
[in,out] | evt | Event object. In this call it does not have any event data but can be used to pass information between modules. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
Method which is called at the end of the calibration cycle (step).
[in,out] | evt | Event object. In this call it does not have any event data but can be used to pass information between modules. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
Method which is called once at the end of the job.
[in,out] | evt | Event object. In this call it does not have any event data but can be used to pass information between modules. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
Method which is called at the end of the run.
[in,out] | evt | Event object. In this call it does not have any event data but can be used to pass information between modules. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
Method which is called with event data.
[in,out] | evt | Event object. |
[in] | env | Environment object. |
Referenced by psana::EventLoop::EventLoop().
bool psana::Module::observeAllEvents | ( | ) | const [inline] |
void psana::Module::reset | ( | ) | [inline] |
void psana::Module::skip | ( | ) | [inline, protected] |
Signal framework to skip current event and do not call other downstream modules.
Note that this method does not skip code in the current module, control is returned back to the module. If you want to stop processing after this call then add a return statement.
Definition at line 196 of file Module.h.
References Skip.
void psana::Module::stop | ( | ) | [inline, protected] |
void psana::Module::terminate | ( | ) | [inline, protected] |