1 #ifndef _Q_BASE_MODULE_H_
2 #define _Q_BASE_MODULE_H_
80 double GetDouble(
const std::string& parname,
double defVal,
bool warnCfg =
true)
const;
87 std::vector<double>
GetVectorDouble(
const std::string& parname, std::vector<double> defVal,
bool warnCfg =
true)
const;
90 int GetInt(
const std::string& parname,
int defVal,
bool warnCfg =
true)
const;
92 std::vector<int>
GetVectorInt(
const std::string& parname, std::vector<int> defVal,
bool warnCfg =
true)
const;
95 bool GetBool(
const std::string& parname,
bool defVal,
bool warnCfg =
true)
const;
97 std::vector<bool>
GetVectorBool(
const std::string& parname, std::vector<bool> defVal,
bool warnCfg =
true)
const;
100 const std::string&
GetString(
const std::string& parname,
const std::string& defVal,
bool warnCfg =
true)
const;
102 std::vector<std::string>
GetVectorString(
const std::string& parname, std::vector<std::string> defVal,
bool warnCfg =
true)
const;
105 inline void Debug(
const char* descr, ...)
const;
107 inline void Info(
const char* descr, ...)
const;
109 inline void Warn(
const char* descr, ...)
const;
111 inline void Error(
const char* descr, ...)
const;
113 inline void Panic(
const char* descr, ...)
const;
212 va_start(args,descr);
213 vsnprintf(buf,4096,descr,args);
222 va_start(args,descr);
223 vsnprintf(buf,4096, descr,args);
232 va_start(args,descr);
233 vsnprintf(buf,4096,descr,args);
242 va_start(args,descr);
243 vsnprintf(buf,4096,descr,args);
252 va_start(args,descr);
253 vsnprintf(buf,4096,descr,args);
#define Q_BEGIN_NAMESPACE
std::string GetFullPath() const
Get Full Path of module "GetName() + "." + GetOccurrence".
const std::string & GetString(const std::string &parname, const std::string &defVal, bool warnCfg=true) const
Get a string parameter from config file ( see GetDouble() )
bool ProcessBase(QEventAssembler &ev, QEventList &evl, const bool exec, QEventList &ovl)
ProcessBase method is called for each event, getting the event and as argument.
void Debug(const char *descr,...) const
Send a debug message (used to debug the module) with printf syntax.
void Warn(const char *descr,...) const
Send a warning message (an error that the framework can recover) with printf syntax.
QModuleConfig & GetConfig()
Get module config.
virtual ~QBaseModule()
constructor
void EndBase()
EndBase method is called after event loop.
unsigned int GetIteration() const
Get Current sequence iteration.
virtual bool Process(QEventAssembler &ev, QEventList &evl, const bool exec, QEventList &ovl)=0
Process method is called for each event, getting the event and as argument and must be implemented by...
void SetVerbosity(MsgLevel l=WarnMsg)
std::vector< QEventLabel > fRequiredLabels
void Info(const char *descr,...) const
Send an info message (information) with printf syntax.
void UpdateConfigParameters(const std::string &p) const
update module config
void Error(const char *descr,...) const
Send an error message (an error that the framework cannot recover) with printf syntax.
double GetDouble(const std::string &parname, double defVal, bool warnCfg=true) const
Get a double parameter from config file.
bool GetRunAgain() const
Check if the sequence will be reiterated.
const std::string & GetLabel() const
Get Module name + the optional ExtraLabel ("name_extralabel")
void Panic(const char *descr,...) const
Send a panic message (stops the framework) with printf syntax.
const QSequence & GetSequence() const
get reference to this sequence
virtual void End()=0
End method is called after event loop and must be implemented by inheriting classes.
int GetInt(const std::string &parname, int defVal, bool warnCfg=true) const
Get an int parameter from config file ( see GetDouble() )
void UpdateEnableFlag()
update enable flag
std::vector< std::string > GetVectorString(const std::string &parname, std::vector< std::string > defVal, bool warnCfg=true) const
Get a vector<string> parameter from config file ( see GetVectorDouble() )
bool NeedNeighbours()
check wheter this module needs neighbours (available after the first event is processed)
bool GetBool(const std::string &parname, bool defVal, bool warnCfg=true) const
Get a bool parameter from config file ( see GetDouble() )
std::vector< bool > GetVectorBool(const std::string &parname, std::vector< bool > defVal, bool warnCfg=true) const
Get a vector<bool> parameter from config file ( see GetVectorDouble() )
std::vector< int > GetVectorInt(const std::string &parname, std::vector< int > defVal, bool warnCfg=true) const
Get an vector<int> parameter from config file ( see GetVectorDouble() )
void Update(QSequence *s, unsigned int occurrence)
set the occurrence in the same sequence. MV FIXME: should not be public
const std::vector< QEventLabel > & GetRequiredLabels() const
Get labels of objects required by this module.
void SetRunAgain(bool b)
Set that the sequence will be reiterated.
const QGlobalDataManager & GlobalData() const
interface for saving and loading global QObjects
MsgLevel GetVerbosity()
get verbosity level set from config file
virtual void Begin(QEventAssembler &ev)=0
Begin method is called before event loop and must be implemented by inheriting classes.
void BeginBase(QEventAssembler &ev)
Begin Base method is called before event loop.
bool isEnabled() const
check if module is enabled
void SetNeedNeighbours(bool need)
set wheter this module needs neighbours
unsigned int GetOccurrence() const
get the number of times the same module is loaded inside a QSequence
std::vector< double > GetVectorDouble(const std::string &parname, std::vector< double > defVal, bool warnCfg=true) const
Get a std::vector<double> parameter from config file with syntax "{x,y,z}".
QBaseModule(Type type)
constructor
const std::string & GetName() const
Get Module name.
Base class for diana drivers.
Visitor class of QEvent that provides full handling of QEvent.
list of references to const QEvent (s)
Base class for diana filters.
Object to manage I/O (DB, file, or memory) of diana global quantities.
static QMessageHandler * Get()
void Send(MsgLevel l, const std::string &sender, const std::string &msg)
abstract module factory and definition of macros that builds modulefactories and register function.
QObject to store a QBaseModule configuration.
module instantiation class
Simple base class for time profiling a module.
Base class for diana modules.
Diana Reconstruction program.
void SetRunAgain(bool b)
Run the sequence again.
bool GetRunAgain() const
Check if this sequence is going to be rerun.
unsigned int GetIteration() const
const QGlobalDataManager & GlobalData() const
Access to the global data manager for the sequence.
Abstract class for diana writers.