CMS 3D CMS Logo

DDStrVector.h
Go to the documentation of this file.
1 #ifndef DDStrVector_h
2 #define DDStrVector_h
3 
4 #include <iostream>
5 #include <string>
6 #include <vector>
7 
10 
11 class DDStrVector;
12 
14 std::ostream & operator<<(std::ostream & o, const DDStrVector & cons);
15 
17 class DDStrVector : public DDBase<DDName, std::vector<std::string>* >
18 {
19 public:
20 
23 
25  typedef std::vector<std::string> value_type;
26 
28  DDStrVector();
29 
31  DDStrVector(const DDName & name);
32 
34  DDStrVector(const DDName & name, std::vector<std::string>* value);
35 
37  size_t size() const { return rep().size(); }
38 
40  const value_type & values() const { return rep(); }
41 
43  std::string operator[](size_t pos) const { return rep()[pos]; }
44 
46  std::string value() const { return rep()[0]; }
47 
49  value_type::const_iterator vectorBegin() const { return rep().begin(); }
50 
52  value_type::const_iterator vectorEnd() const { return rep().end(); }
53 
55  operator std::string() const { return rep()[0]; }
56 
58  operator std::vector<std::string>() const { return rep(); }
59 
60 };
61 #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:7
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
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 <Constant> and <ConstantsStrVector> ...
Definition: DDStrVector.h:17
size_t size() const
the size of the array of values
Definition: DDStrVector.h:37
uint16_t size_type
value_type::const_iterator vectorEnd() const
read-only iterator poining one place after the stored values
Definition: DDStrVector.h:52
value_type::const_iterator vectorBegin() const
read-only iterator pointing to the begin of the stored values
Definition: DDStrVector.h:49
std::ostream & operator<<(std::ostream &o, const DDStrVector &cons)
output operator for printing ...
Definition: DDStrVector.cc:21
Definition: value.py:1
std::string value() const
return the first stored value; does not check boundaries!
Definition: DDStrVector.h:46
std::vector< std::string > value_type
value type of the managed object
Definition: DDStrVector.h:25
const value_type & values() const
the stored values
Definition: DDStrVector.h:40
std::string operator[](size_t pos) const
returns the value on position pos; does not check boundaries!
Definition: DDStrVector.h:43