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 
14 //typedef std::vector<double> dd_constant_type;
15 
17 class DDStrVector : public DDBase<DDName, std::vector<std::string>* >
18 {
19 public:
20 
23 
25  //typedef std::vector<std::string>::const_iterator const_iterator;
26 
28  typedef std::vector<std::string> value_type;
29 
31  DDStrVector();
32 
34  DDStrVector(const DDName & name);
35 
37  DDStrVector(const DDName & name, std::vector<std::string>* value);
38 
40  size_t size() const { return rep().size(); }
41 
43  const value_type & values() const { return rep(); }
44 
46  std::string operator[](size_t pos) const { return rep()[pos]; }
47 
49  std::string value() const { return rep()[0]; }
50 
52  value_type::const_iterator vectorBegin() const { return rep().begin(); }
53 
55  value_type::const_iterator vectorEnd() const { return rep().end(); }
56 
58  operator std::string() const { return rep()[0]; }
59 
61  operator std::vector<std::string>() const { return rep(); }
62 
63 };
64 #endif
Definition: DDBase.h:14
const DDI::rep_traits< DDName, std::vector< std::string > * >::reference rep() const
Definition: DDBase.h:89
DDStrVector()
an uninitialized constant; one can assign an initialized constant to make it valid ...
Definition: DDStrVector.cc:6
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:22
a named constant corresponding to the DDL-XML tag &lt;Constant&gt; and &lt;ConstantsStrVector&gt; ...
Definition: DDStrVector.h:17
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:40
uint16_t size_type
value_type::const_iterator vectorEnd() const
read-only iterator poining one place after the stored values
Definition: DDStrVector.h:55
value_type::const_iterator vectorBegin() const
read-only iterator pointing to the begin of the stored values
Definition: DDStrVector.h:52
std::string value() const
return the first stored value; does not check boundaries!
Definition: DDStrVector.h:49
std::vector< std::string > value_type
iterator for read-only acces to stored values
Definition: DDStrVector.h:28
const value_type & values() const
the stored values
Definition: DDStrVector.h:43
std::string operator[](size_t pos) const
returns the value on position pos; does not check boundaries!
Definition: DDStrVector.h:46