00001 #ifndef OpticalObjectMgr_h 00002 #define OpticalObjectMgr_h 00003 /*--------------------------------------------------------------------------- 00004 ClassName: OpticalObjectMgr 00005 Author: P. Arce 00006 Changes: 02/05/01: creation 00007 ---------------------------------------------------------------------------*/ 00008 // Description: 00009 // Manages the set of optical objects 00010 00011 00012 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h" 00013 #include <map> 00014 #include "Alignment/CocoaModel/interface/OpticalObject.h" 00015 00016 typedef std::map<ALIstring, OpticalObject*, std::less<ALIstring> > msopto; 00017 00018 class OpticalObject; 00019 00020 class OpticalObjectMgr 00021 { 00022 public: 00023 00024 OpticalObjectMgr(){ }; 00025 ~OpticalObjectMgr(){ }; 00026 00028 static OpticalObjectMgr* getInstance(); 00029 00030 // register an OpticalObject 00031 void registerMe( OpticalObject* opto ){ 00032 theOptODict[opto->longName()] = opto; 00033 } 00034 // find an OpticalObject by long name (its name + name of its ancestors) 00035 OpticalObject* findOptO( const ALIstring& longName, bool exists = 0 ) const; 00036 // find a list of OpticalObject's by name 00037 std::vector<OpticalObject*> findOptOs( const ALIstring& name, bool exists = 0 ) const; 00038 00039 void dumpOptOs( std::ostream& out= std::cout ) const; 00040 00041 uint32_t buildCmsSwID(); 00042 00043 private: 00044 static OpticalObjectMgr* theInstance; 00045 msopto theOptODict; 00046 uint32_t theLastCmsSwID; 00047 }; 00048 00049 #endif