 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/Path.h>
14 #include <framework/core/Module.h>
15 #include <framework/core/PathIterator.h>
16 #include <framework/core/ProcessStatistics.h>
17 #include <framework/datastore/StoreObjPtr.h>
18 #include <framework/dataobjects/EventMetaData.h>
31 class EventProcessor {
void callEvent(Module *module)
Calls event() on one single module, setting up logging and statistics as needed.
void process(const PathPtr &startPath, long maxEvent=0)
Processes the full module chain, starting with the first module in the given path.
void processTerminate(const ModulePtrList &modulePathList)
Terminates the modules.
int signal
see 'man 7 signal'.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
EventMetaData is used by processEvent()/processCore().
EventProcessor()
Constructor.
double m_lastMetadataUpdate
Time in seconds of last call for metadata update in event loop.
bool processEvent(PathIterator moduleIter, bool skipMasterModule)
Calls event() functions on all modules for the current event.
Exception thrown when execution is stopped by a signal.
static void writeToStdErr(const char msg[])
async-safe method to write something to STDERR.
Module * m_profileModule
Adress of the module which we want to profile, nullptr if no profiling is requested.
void processBeginRun(bool skipDB=false)
Calls the begin run methods of all modules.
bool m_inRun
Are we currently in a run? If yes, processEndRun() needs to do something.
virtual ~EventProcessor()
Destructor.
Abstract base class for different kinds of events.
Type-safe access to single objects in the data store.
std::list< ModulePtr > ModulePtrList
Defines a std::list of shared module pointers.
std::string m_profileModuleName
Name of the module which should be profiled, empty if no profiling is requested.
std::shared_ptr< Path > PathPtr
Defines a pointer to a path object as a boost shared pointer.
long getMaximumEventNumber(long maxEvent) const
Calculate the maximum event number out of the argument from command line and the environment.
ModulePtrList m_moduleList
List of all modules in order initialized.
double m_metadataUpdateInterval
Minimal time difference in seconds for metadata updates in event loop.
void processEndRun()
Calls the end run methods of all modules.
StoppedBySignalException(int signal)
Constructor.
void processInitialize(const ModulePtrList &modulePathList, bool setEventInfo=true)
Initializes the modules.
StoreObjPtr< ProcessStatistics > m_processStatisticsPtr
Also used in a number of places.
void processCore(const PathPtr &startPath, const ModulePtrList &modulePathList, long maxEvent=0, bool isInputProcess=true)
Processes the full module chain consisting of an arbitrary number of connected paths,...
void setProfileModuleName(const std::string &name)
Set the name of the module we want to profile.
Iterator over a Path (returning Module pointers).
const Module * m_master
The master module that determines the experiment/run/event number.
EventMetaData m_previousEventMetaData
Stores state of EventMetaData before it was last changed.
static void installSignalHandler(int sig, void(*fn)(int))
Install a signal handler 'fn' for given signal.
static void installMainSignalHandlers(void(*fn)(int)=nullptr)
Install signal handler for INT, TERM and QUIT signals.