1 #ifndef _fwk_VModule_h_
2 #define _fwk_VModule_h_
4 #include <utl/ObjectRegistrar.h>
5 #include <utl/ObjectFactory.h>
6 #include <utl/ErrorLogger.h>
7 #include <utl/Stopwatch.h>
9 #include <boost/algorithm/string.hpp>
145 #define REGISTER_MODULE(_moduleName_, _ModuleType_) \
147 static std::string GetRegistrationId() \
148 { return _moduleName_; } \
154 static _ModuleType_ module; \
159 utl::ObjectRegistrar<_ModuleType_, fwk::VModuleFactory> fAutoModuleReg
161 #define INFOFinal(y) if (InfoLevel::eInfoFinal <= fInfoLevel) INFO(y)
162 #define INFOIntermediate(y) if (InfoLevel::eInfoIntermediate <= fInfoLevel) INFO(y)
163 #define INFODebug(y) if (InfoLevel::eInfoDebug <= fInfoLevel) INFO(y)
const utl::Stopwatch & GetStopwatch() const
utl::Stopwatch fStopwatch
Report success to RunController.
virtual ResultFlag Finish()=0
Finish: invoked at end of the run (NOT end of the event)
Skip remaining modules in the current loop and continue with next iteration of the loop...
std::string GetVersionInfo(const VersionInfoType v) const
Retrieve different sorts of module version info.
ResultFlag RunWithTiming(evt::Event &event)
VersionInfoType
Different types of version info that can be retrieved from GetVersionInfo.
Break current loop. It works for nested loops too!
VModule & operator=(const VModule &)
utl::ObjectFactory< VModule *, std::string > VModuleFactory
static std::string GetResultFlagByName(const ResultFlag flag)
virtual ResultFlag Run(evt::Event &event)=0
Run: invoked once per event.
Template for object factory.
virtual ~VModule()=default
ResultFlag
Flag returned by module methods to the RunController.
utl::Stopwatch & GetStopwatch()
Report failure to RunController, causing RunController to terminate execution.
virtual ResultFlag Init()=0
Initialize: invoked at beginning of run (NOT beginning of event)