 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/Module.h>
14 #include <framework/core/EventProcessor.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <boost/optional.hpp>
27 class SubEventModule :
public Module,
public EventProcessor {
39 void initSubEvent(
const std::string& objectName,
const std::string& loopOver, std::shared_ptr<Path> path);
41 void initSubLoop(std::shared_ptr<Path> path,
const std::string& condition,
unsigned int maxIterations);
45 virtual void endRun()
override;
46 virtual void event()
override;
63 std::shared_ptr<Path>
m_path;
std::unique_ptr< ModuleCondition > m_loopCondition
Condition object to evaluate if the loop is finished in case of doWhile()
unsigned int m_maxIterations
maximum number of iterations before giving up in case of doWhile()
int m_mode
Mode for this module.
boost::optional< std::string > m_objectName
name of our loop variable in case of forEach.
Module * m_loopConditionModule
pointer to the module to provide the returnValue in case of doWhile()
boost::optional< std::string > m_loopOverName
name for m_loopOver in case of forEach.
Framework-internal module that implements the functionality of Path::forEach() as well as Path::doWhi...
virtual void endRun() override
This method is called if the current run ends.
boost::optional< std::string > m_loopConditionString
String for the condition when looping.
virtual void terminate() override
This method is called at the end of the event processing.
virtual void initialize() override
Initialize the Module.
void initSubLoop(std::shared_ptr< Path > path, const std::string &condition, unsigned int maxIterations)
ised by Path::doWhile() to actually set parameters
virtual void event() override
This method is the core of the module.
void initSubEvent(const std::string &objectName, const std::string &loopOver, std::shared_ptr< Path > path)
used by Path::forEach() to actually set parameters.
Abstract base class for different kinds of events.
void setDoWhileConditions()
Set the necessary pointers for do_while(): the pointer to the module whose return value we'll use as ...
virtual void beginRun() override
Called when entering a new run.
int m_processID
when using multi-processing contains the ID of the process where event() is called (in that process o...
StoreArray< TObject > m_loopOver
array looped over in case of forEach
void setProperties()
Set properties for this module based on the modules found in m_path.
std::shared_ptr< Path > m_path
Path to execute.
EModes
Define the constants for the different modes.