Public Member Functions | |
virtual | ~QLCFlowController () |
dtor | |
void | Register (const std::string &measName, const std::set< int > &channels, int minNumMeas) |
register a new measurement named measName that will involve the logical channels contained in channels and that will require at least minNumMeas events per configuration per channel. | |
void | Decrement (const std::string &measName, int lg, int id) |
decrement counter for the requested measName and channel | |
bool | ConfDone () const |
check whether all the measurments with the current configuration are done (i.e. the counters for all the measurements and for all the channels are zero) | |
void | NextConf () |
move to the next configuration (i.e. reset all counters to their initial value) | |
void | Reset () |
remove all registered counters | |
void | Dump (std::ostream &os) const |
int | GetMissing (const std::string &measName, int lg) const |
get number of missing measurements for the given measName and lg | |
Static Public Member Functions | |
static QLCFlowController & | GetInstance () |
singleton getter | |
Private Member Functions | |
QLCFlowController () | |
Private Attributes | |
std::map< std::string, std::map< int, int > > | fCounters |
std::map< std::string, std::map< int, int > > | fLastIds |
std::map< std::string, std::map< int, bool > > | fAllowDecrement |
std::map< std::string, std::pair< std::set< int > , int > > | fReference |
Static Private Attributes | |
static QLCFlowController * | gMe = NULL |
QLCFlowController::QLCFlowController | ( | ) | [private] |
ctor
References QOnlineMessenger::EnableMsgServer(), and QOnlineMessenger::SetVerbosity().
Referenced by GetInstance().
void QLCFlowController::Register | ( | const std::string & | measName, | |
const std::set< int > & | channels, | |||
int | minNumMeas | |||
) |
register a new measurement named measName that will involve the logical channels contained in channels and that will require at least minNumMeas events per configuration per channel.
Possible pre-existing entries with the same measName are overwritten
References fReference.
Referenced by MLCEleCheckController::InitFlowController(), and MLCBoloCheckController::InitFlowController().
void QLCFlowController::Decrement | ( | const std::string & | measName, | |
int | lg, | |||
int | id | |||
) |
decrement counter for the requested measName and channel
id | id associated to the current electroincs configuration. See detailed description for the meaning of this parameter. |
References fAllowDecrement, fCounters, fLastIds, QOnlineMessenger::OLDebug(), and QOnlineMessenger::OLWarn().
void QLCFlowController::Dump | ( | std::ostream & | os | ) | const |
dump current status of this object to os
References fCounters.
int QLCFlowController::GetMissing | ( | const std::string & | measName, | |
int | lg | |||
) | const |
get number of missing measurements for the given measName and lg
References fCounters.
std::map<std::string, std::map<int, int> > QLCFlowController::fCounters [private] |
map storing counters for each measurement type and channel
works as counter[MeasType][channel] = num. of missing measurements
Referenced by ConfDone(), Decrement(), Dump(), GetMissing(), NextConf(), and Reset().
std::map<std::string, std::map<int, int> > QLCFlowController::fLastIds [private] |
Stores electronics configuration id used before the last call to NextConfig(). It is used, together with fAllowDecrement, to handle the transition between two electronics configurations (i.e. to avoid decrementing the counter for the new configuration when the id passed to Decrement() is actually from the past configuration).
Referenced by Decrement(), NextConf(), and Reset().
std::map<std::string, std::map<int, bool> > QLCFlowController::fAllowDecrement [private] |
see documentation for fLastIds
Referenced by Decrement(), NextConf(), and Reset().
std::map<std::string, std::pair<std::set<int>, int> > QLCFlowController::fReference [private] |
map containing reference values for registered measurement types
works as fReference[MeasType] = pair<set of active channels, minNumMeas>;
Referenced by NextConf(), Register(), and Reset().
QLCFlowController * QLCFlowController::gMe = NULL [static, private] |
static ptr to this object
Referenced by GetInstance().