CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDMap.h
Go to the documentation of this file.
1 #ifndef DD_DDMap_h
2 #define DD_DDMap_h
3 
7 #include <string>
8 #include <iostream>
9 
10 class DDMap;
11 
13 std::ostream & operator<<(std::ostream & o, const DDMap & cons);
14 
17 
19 class DDMap : public DDBase<DDName, dd_map_type* >
20 {
21 public:
24 
27 
29  DDMap();
30 
32  DDMap(const DDName & name);
33 
35  DDMap(const DDName & name, dd_map_type* value);
36 
38  size_t size() const { return rep().size(); }
39 
41  const dd_map_type & values() const { return rep(); }
42 
44  const double & operator[](const std::string & name) const {
45  const dd_map_type & r(rep());
46  return r[name];
47  }
48 
50  value_type::const_iterator mapBegin() const { return rep().begin(); }
51 
53  value_type::const_iterator mapEnd() const { return rep().end(); }
54 
55 };
56 #endif // DD_DDMap_h
Definition: DDBase.h:10
const DDI::rep_traits< DDName, dd_map_type * >::reference rep() const
Definition: DDBase.h:84
const DDName & name() const
Definition: DDBase.h:78
value_type::const_iterator mapEnd() const
read-only iterator poining one place after the stored values
Definition: DDMap.h:53
ReadMapType< double > dd_map_type
simply a std::map&lt;std::string,double&gt; supporting an addional operator[] const
Definition: DDMap.h:16
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:14
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
uint16_t size_type
a named constant corresponding to the DDL-XML tag &lt;Constant&gt; and &lt;ConstantsVector&gt; ...
Definition: DDMap.h:19
dd_map_type value_type
the type of the managed object
Definition: DDMap.h:23
value_type::const_iterator mapBegin() const
read-only iterator pointing to the begin of the stored values
Definition: DDMap.h:50
size_t size() const
the size of the array of values
Definition: DDMap.h:38
const dd_map_type & values() const
the stored values
Definition: DDMap.h:41
dd_map_type::size_type size_t
size type for the size of the stored values
Definition: DDMap.h:26
const double & operator[](const std::string &name) const
returns the value on position pos; does not check boundaries!
Definition: DDMap.h:44
DDMap()
an uninitialized constant; one can assign an initialized constant to make it valid ...
Definition: DDMap.cc:3