CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DetectorDescription/Core/interface/DDMap.h

Go to the documentation of this file.
00001 #ifndef DD_DDMap_h
00002 #define DD_DDMap_h
00003 
00004 #include "DetectorDescription/Core/interface/DDBase.h"
00005 #include "DetectorDescription/Core/interface/DDName.h"
00006 #include "DetectorDescription/Base/interface/DDReadMapType.h"
00007 #include <string>
00008 #include <iostream>
00009 
00010 class DDMap;
00011 
00013 std::ostream & operator<<(std::ostream & o, const DDMap & cons);
00014 
00016 typedef ReadMapType<double> dd_map_type;
00017 
00019 class DDMap : public DDBase<DDName, dd_map_type* >
00020 {
00021 public:
00023    typedef dd_map_type value_type;
00024    
00026    typedef dd_map_type::size_type size_t;
00027       
00029    DDMap();
00030    
00032    DDMap(const DDName & name);
00033    
00035    DDMap(const DDName & name, dd_map_type* value);
00036       
00038    size_t size() const { return rep().size(); }
00039    
00041    const dd_map_type & values() const { return rep(); }
00042    
00044    const double & operator[](const std::string & name) const throw (DDException) {
00045      const dd_map_type & r(rep()); 
00046      return r[name];
00047    } 
00048    
00050    value_type::const_iterator mapBegin() const { return rep().begin(); }
00051    
00053    value_type::const_iterator mapEnd() const { return rep().end(); }
00054    
00055 };
00056 #endif // DD_DDMap_h