test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDVector.h
Go to the documentation of this file.
1 #ifndef DDVector_h
2 #define DDVector_h
3 
6 #include <vector>
7 #include <iostream>
8 
9 class DDVector;
10 
12 std::ostream & operator<<(std::ostream & o, const DDVector & cons);
13 
14 //typedef std::vector<double> dd_constant_type;
15 
17 class DDVector : public DDBase<DDName, std::vector<double>* >
18 {
19 public:
20 
23 
25  //typedef std::vector<double>::const_iterator const_iterator;
26 
28  typedef std::vector<double> value_type;
29 
31  DDVector();
32 
34  DDVector(const DDName & name);
35 
37  DDVector(const DDName & name, std::vector<double>* value);
38 
40  size_t size() const { return rep().size(); }
41 
43  const value_type & values() const { return rep(); }
44 
46  double operator[](size_t pos) const { return rep()[pos]; }
47 
49  double 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 double() const { return rep()[0]; }
59 
61  operator std::vector<double>() const { return rep(); }
62 
64  operator std::vector<int>() const;
65 };
66 #endif
Definition: DDBase.h:10
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
double operator[](size_t pos) const
returns the value on position pos; does not check boundaries!
Definition: DDVector.h:46
const DDName & name() const
Definition: DDBase.h:78
size_t size() const
the size of the array of values
Definition: DDVector.h:40
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
double value() const
return the first stored value; does not check boundaries!
Definition: DDVector.h:49
uint16_t size_type
value_type::const_iterator vectorBegin() const
read-only iterator pointing to the begin of the stored values
Definition: DDVector.h:52
a named constant corresponding to the DDL-XML tag &lt;Constant&gt; and &lt;ConstantsVector&gt; ...
Definition: DDVector.h:17
std::vector< double >::size_type size_t
size type for the size of the stored values
Definition: DDVector.h:22
DDVector()
an uninitialized constant; one can assign an initialized constant to make it valid ...
Definition: DDVector.cc:9
const value_type & values() const
the stored values
Definition: DDVector.h:43
value_type::const_iterator vectorEnd() const
read-only iterator poining one place after the stored values
Definition: DDVector.h:55
std::vector< double > value_type
iterator for read-only acces to stored values
Definition: DDVector.h:28