25 std::string logicFlag =
GetString(
"Logic",
"CASE");
26 if(logicFlag ==
"AND") {
28 }
else if(logicFlag ==
"OR") {
30 }
else if(logicFlag ==
"CASE") {
33 Error(
"Unknown logic flag, resetting Logic to \"AND\"");
49 std::string alias =
GetString(
"Alias",
"",
false);
51 Debug(
"Setting alias: Filter_%s",alias.c_str());
52 alias = std::string(
"Filter_") + alias;
53 ev.
SetAlias(
"Passed",
"fValue",alias);
61 Info(
"Skipping events with non valid but required objects");
70 QBool thisPassed =
false;
74 if(!thisPassed)
return thisPassed;
83 passedHandle.
Get() = thisPassed;
90 for(
int i = 0; i < (int)neigh.
Size(); i++) {
92 for(
int j = 0; j < (int)oneigh.
Size(); j++)
93 if(&oneigh[j] == &neigh[i]) oexec =
true;
95 nneigh.
Push(&neigh[i]);
108 bool thisPassed =
false;
110 bool globalPassed = exec;
112 bool requiredAreValid =
true;
115 for(
size_t l = 0; l < labels.size(); l++) {
116 const char* owner = labels[l].owner.c_str();
117 const char* name = labels[l].name.c_str();
121 requiredAreValid =
false;
126 if(requiredAreValid) {
132 if(
fLogicFlag ==
AND) thisPassed = globalPassed && thisPassed;
133 else if(
fLogicFlag ==
OR) thisPassed = globalPassed || thisPassed;
154 Panic(
"Missing method: \"bool Filter(const QEvent& ev)\" or \"bool Filter(const QEvent& ev, const QEventList& neigh)\" not implemented");
QRunDataHandle rHandle(753)
#define Q_BEGIN_NAMESPACE
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() )
void Debug(const char *descr,...) const
Send a debug message (used to debug the module) with printf syntax.
void Info(const char *descr,...) const
Send an info message (information) with printf syntax.
void Error(const char *descr,...) const
Send an error message (an error that the framework cannot recover) with printf syntax.
void Panic(const char *descr,...) const
Send a panic message (stops the framework) with printf syntax.
bool GetBool(const std::string &parname, bool defVal, bool warnCfg=true) const
Get a bool parameter from config file ( see GetDouble() )
const std::vector< QEventLabel > & GetRequiredLabels() const
Get labels of objects required by this module.
void SetNeedNeighbours(bool need)
set wheter this module needs neighbours
bool wrapped into a QObject
Visitor class of QEvent that provides full handling of QEvent.
QEvent & GetEvent()
Get the QEvent.
list of references to const QEvent (s)
void Push(const QEvent *obj)
add a QEvent
size_t Size() const
number of QEvent (s)
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
void Add(WriteHandle< Q > &handle)
Add a QObject to the event.
void SetAlias(const std::string &name, const std::string &pathInObject, const std::string &alias)
set alias for objects or variables in objects owned by currentmodule.
virtual void GetCuts(const QEvent &ev)=0
Initialize all cuts, possibly from config file.
bool Process(QEventAssembler &ev, QEventList &neigh, const bool exec, QEventList &oneigh)
Process method is called for each event, and calls FilterAlgorithm()
bool fWrite
save QBool into files
unsigned long long fSelNeighEvents
bool fSkipRequiredNotValid
void End()
End method is called after event loop, and calls no method of inheriting classes.
virtual void Done()
optionally one can also implement actions after the event loop
unsigned long long fSelEvents
bool FilterAlgorithm(const QEvent &ev, QEventList &neigh, const bool exec)
called for each event, and calls Filter() of inheriting classes
unsigned long long fTotEvents
void Begin(QEventAssembler &ev)
Begin method is called before event loop, and calls GetCuts()
bool fSave
store QBool result into event
unsigned long long fTotNeighEvents
read handle to access QEvent QObject's.
write handle to access and add QEvent QObject's.