CMS 3D CMS Logo

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