CMS 3D CMS Logo

OpticalObjectMgr.h
Go to the documentation of this file.
1 #ifndef OpticalObjectMgr_h
2 #define OpticalObjectMgr_h
3 /*---------------------------------------------------------------------------
4 ClassName: OpticalObjectMgr
5 Author: P. Arce
6 Changes: 02/05/01: creation
7 ---------------------------------------------------------------------------*/
8 // Description:
9 // Manages the set of optical objects
10 
12 #include <map>
14 
15 typedef std::map<ALIstring, OpticalObject*, std::less<ALIstring> > msopto;
16 
17 class OpticalObject;
18 
20 public:
23 
25  static OpticalObjectMgr* getInstance();
26 
27  // register an OpticalObject
28  void registerMe(OpticalObject* opto) { theOptODict[opto->longName()] = opto; }
29  // find an OpticalObject by long name (its name + name of its ancestors)
30  OpticalObject* findOptO(const ALIstring& longName, bool exists = false) const;
31  // find a list of OpticalObject's by name
32  std::vector<OpticalObject*> findOptOs(const ALIstring& name, bool exists = false) const;
33 
34  void dumpOptOs(std::ostream& out = std::cout) const;
35 
37 
38 private:
42 };
43 
44 #endif
OpticalObject * findOptO(const ALIstring &longName, bool exists=false) const
static OpticalObjectMgr * theInstance
static OpticalObjectMgr * getInstance()
Get the only instance.
void registerMe(OpticalObject *opto)
std::map< ALIstring, OpticalObject *, std::less< ALIstring > > msopto
const ALIstring longName() const
void dumpOptOs(std::ostream &out=std::cout) const
std::vector< OpticalObject * > findOptOs(const ALIstring &name, bool exists=false) const
std::string ALIstring
Definition: CocoaGlobals.h:9
unsigned int ALIuint
Definition: CocoaGlobals.h:17