CMS 3D CMS Logo

DDVector.h
Go to the documentation of this file.
1 #ifndef DDVector_h
2 #define DDVector_h
3 
6 #include <memory>
7 #include <vector>
8 #include <iostream>
9 
10 class DDVector;
11 
13 std::ostream& operator<<(std::ostream& o, const DDVector& cons);
14 
15 //typedef std::vector<double> dd_constant_type;
16 
18 class DDVector : public DDBase<DDName, std::unique_ptr<std::vector<double> > > {
19 public:
22 
24  using value_type = std::vector<double>;
25 
27  DDVector();
28 
30  DDVector(const DDName& name);
31 
33  DDVector(const DDName& name, std::unique_ptr<std::vector<double> > value);
34 
36  size_t size() const { return rep().size(); }
37 
39  const value_type& values() const { return rep(); }
40 
42  double operator[](size_t pos) const { return rep()[pos]; }
43 
45  double value() const { return rep()[0]; }
46 
48  value_type::const_iterator vectorBegin() const { return rep().begin(); }
49 
51  value_type::const_iterator vectorEnd() const { return rep().end(); }
52 
54  operator double() const { return rep()[0]; }
55 
57  operator std::vector<double>() const { return rep(); }
58 
60  operator std::vector<int>() const;
61 };
62 #endif
DDBase.h
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDVector
a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector>
Definition: DDVector.h:18
pos
Definition: PixelAliasList.h:18
DDVector::values
const value_type & values() const
the stored values
Definition: DDVector.h:39
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DDBase< DDName, std::unique_ptr< std::vector< double > > >::name
const DDName & name() const
Definition: DDBase.h:59
DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep
const DDI::rep_traits< DDName, std::unique_ptr< std::vector< double > > >::reference rep() const
Definition: DDBase.h:65
DDVector::vectorEnd
value_type::const_iterator vectorEnd() const
read-only iterator poining one place after the stored values
Definition: DDVector.h:51
DDVector::vectorBegin
value_type::const_iterator vectorBegin() const
read-only iterator pointing to the begin of the stored values
Definition: DDVector.h:48
value
Definition: value.py:1
DDVector::DDVector
DDVector()
an uninitialized constant; one can assign an initialized constant to make it valid
Definition: DDVector.cc:5
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
DDVector::value_type
std::vector< double > value_type
value type of the managed object
Definition: DDVector.h:24
DDName.h
operator<<
std::ostream & operator<<(std::ostream &o, const DDVector &cons)
output operator for printing ...
Definition: DDVector.cc:11
DDBase
Definition: DDBase.h:10
DDVector::operator[]
double operator[](size_t pos) const
returns the value on position pos; does not check boundaries!
Definition: DDVector.h:42
DDVector::size
size_t size() const
the size of the array of values
Definition: DDVector.h:36
DDVector::value
double value() const
return the first stored value; does not check boundaries!
Definition: DDVector.h:45