CMS 3D CMS Logo

DDMap.h
Go to the documentation of this file.
1 #ifndef DD_DDMap_h
2 #define DD_DDMap_h
3 
4 #include <iostream>
5 #include <map>
6 #include <memory>
7 #include <string>
8 
12 
13 class DDMap;
14 
16 std::ostream& operator<<(std::ostream& o, const DDMap& cons);
17 
20 
22 class DDMap : public DDBase<DDName, std::unique_ptr<dd_map_type> > {
23 public:
26 
28  using size_t = dd_map_type::size_type;
29 
31  DDMap();
32 
34  DDMap(const DDName& name);
35 
37  DDMap(const DDName& name, std::unique_ptr<dd_map_type> value);
38 
40  size_t size() const { return rep().size(); }
41 
43  const dd_map_type& values() const { return rep(); }
44 
46  const double& operator[](const std::string& name) const {
47  const dd_map_type& r(rep());
48  return r[name];
49  }
50 
52  value_type::const_iterator mapBegin() const { return rep().begin(); }
53 
55  value_type::const_iterator mapEnd() const { return rep().end(); }
56 };
57 #endif // DD_DDMap_h
DDMap
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector>
Definition: DDMap.h:22
DDBase.h
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
dd_map_type
ReadMapType< double > dd_map_type
simply a std::map<std::string,double> supporting an addional operator[] const
Definition: DDMap.h:19
DDReadMapType.h
DDMap::mapEnd
value_type::const_iterator mapEnd() const
read-only iterator poining one place after the stored values
Definition: DDMap.h:55
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DDBase< DDName, std::unique_ptr< dd_map_type > >::name
const DDName & name() const
Definition: DDBase.h:59
DDBase< DDName, std::unique_ptr< dd_map_type > >::rep
const DDI::rep_traits< DDName, std::unique_ptr< dd_map_type > >::reference rep() const
Definition: DDBase.h:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
operator<<
std::ostream & operator<<(std::ostream &o, const DDMap &cons)
output operator for printing ...
Definition: DDMap.cc:11
value
Definition: value.py:1
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDMap::values
const dd_map_type & values() const
the stored values
Definition: DDMap.h:43
ReadMapType< double >
DDMap::DDMap
DDMap()
an uninitialized constant; one can assign an initialized constant to make it valid
Definition: DDMap.cc:5
DDName.h
DDMap::mapBegin
value_type::const_iterator mapBegin() const
read-only iterator pointing to the begin of the stored values
Definition: DDMap.h:52
DDMap::operator[]
const double & operator[](const std::string &name) const
returns the value on position pos; does not check boundaries!
Definition: DDMap.h:46
DDBase
Definition: DDBase.h:10
DDMap::size
size_t size() const
the size of the array of values
Definition: DDMap.h:40