CMS 3D CMS Logo

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