00001 #ifndef LCConditionsMgr_h 00002 #define LCConditionsMgr_h 00003 00004 // 00005 #include "lccd.h" 00006 #include "IConditionsHandler.hh" 00007 00008 // -- lcio headers 00009 // #include "lcio.h" 00010 // #include "EVENT/LCCollection.h" 00011 00012 // -- C++ headers 00013 #include <map> 00014 00015 namespace lccd { 00016 00017 typedef std::map< std::string, IConditionsHandler* > HandlerMap ; 00018 00019 00031 class LCConditionsMgr { 00032 00033 public: 00034 00035 LCConditionsMgr() ; 00036 00037 ~LCConditionsMgr() {} ; 00038 00041 static LCConditionsMgr* instance() ; 00042 00043 00048 void registerChangeListener( IConditionsChangeListener* cl, const std::string& name) ; 00049 00050 00053 void registerHandler(const std::string& name, IConditionsHandler* handler ) ; 00054 00055 00058 void removeHandler(const std::string& name ) ; 00059 00060 00064 IConditionsHandler * getHandler( const std::string& name) ; 00065 00068 void updateEvent( lcio::LCEvent* evt ) ; 00069 00072 void update( LCCDTimeStamp timestamp ) ; 00073 00075 void clear() ; 00076 00077 private: 00078 HandlerMap _map ; 00079 00080 static LCConditionsMgr* _me ; 00081 00082 }; 00083 00084 } ; //end namespace 00085 00086 #endif // LCConditionsMgr_h