QLCFlowController.hh
Go to the documentation of this file.00001
00002 #ifndef _QLC_FLOW_CONTROLLER_HH_
00003 #define _QLC_FLOW_CONTROLLER_HH_
00004
00005 #include <map>
00006 #include <set>
00007 #include <utility>
00008 #include <string>
00009 #include <ostream>
00010
00011 #include "QOnlineMessenger.hh"
00012
00039 class QLCFlowController: public QOnlineMessenger
00040 {
00041 public:
00043 static QLCFlowController& GetInstance();
00044
00046 virtual ~QLCFlowController();
00047
00055 void Register(const std::string& measName,
00056 const std::set<int>& channels,
00057 int minNumMeas);
00058
00069 void Decrement(const std::string& measName, int lg, int id);
00070
00076 bool ConfDone() const;
00077
00082 void NextConf();
00083
00085 void Reset();
00086
00088 void Dump(std::ostream& os) const;
00089
00095 int GetMissing(const std::string& measName, int lg) const;
00096
00097 private:
00102 std::map<std::string, std::map<int, int> > fCounters;
00103
00111 std::map<std::string, std::map<int, int> > fLastIds;
00112
00114 std::map<std::string, std::map<int, bool> > fAllowDecrement;
00115
00120 std::map<std::string, std::pair<std::set<int>, int> > fReference;
00121
00123 static QLCFlowController* gMe;
00124
00126 QLCFlowController();
00127 };
00128 #endif