12 fBoolLabel = GetString(
"BoolLabel",
"NODEFAULT@NODEFAULT");
13 std::string modeString = GetString(
"Mode",
"ALL");
14 if(modeString ==
"ALL") fMode = M_ALL;
15 else if(modeString ==
"ONE") fMode = M_ONE;
17 Error(
"Mode \"%s\" not allowed (allowed are \"ALL\" and \"ONE\") setting mode to \"ALL\"");
20 ev.RequireByLabel<
QBool>(fBoolLabel);
25 if(neigh.
Empty())
return false;
27 for(
size_t i =0; i< neigh.
Size(); i++) {
28 const bool result = neigh[i].GetByLabel<
QBool>(fBoolLabel);
29 if(fMode == M_ALL && !result)
return false;
30 else if(fMode == M_ONE && result)
return true;
33 if(fMode == M_ALL)
return true;
#define REGISTER_MODULE(clazz)
Filter a main QEvent using a QBool variable in neighbours.
bool Filter(const Diana::QEvent &ev, const Diana::QEventList &neigh)
return true if ev passes the cuts
bool wrapped into a QObject
list of references to const QEvent (s)
bool Empty() const
check if the list is empty
size_t Size() const
number of QEvent (s)
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...