CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
DDVector Class Reference

a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector> More...

#include <DDVector.h>

Inheritance diagram for DDVector:
DDBase< DDName, std::unique_ptr< std::vector< double > > >

Public Types

using size_t = std::vector< double >::size_type
 size type for the size of the stored values More...
 
using value_type = std::vector< double >
 value type of the managed object More...
 
- Public Types inherited from DDBase< DDName, std::unique_ptr< std::vector< double > > >
using def_type = std::pair< const DDName *, bool >
 
using StoreT = DDI::Singleton< DDI::Store< DDName, std::unique_ptr< std::vector< double > > > >
 

Public Member Functions

 DDVector ()
 an uninitialized constant; one can assign an initialized constant to make it valid More...
 
 DDVector (const DDName &name)
 a refenrence to a constant More...
 
 DDVector (const DDName &name, std::unique_ptr< std::vector< double > > value)
 creation of a new named constant; if it already existed with the given name, it's overwritten with new values More...
 
 operator double () const
 convert to a double More...
 
 operator std::vector< double > () const
 convert to a std::vector<double> More...
 
 operator std::vector< int > () const
 convert to a std::vector<int> (expensive!) More...
 
double operator[] (size_t pos) const
 returns the value on position pos; does not check boundaries! More...
 
size_t size () const
 the size of the array of values More...
 
double value () const
 return the first stored value; does not check boundaries! More...
 
const value_typevalues () const
 the stored values More...
 
value_type::const_iterator vectorBegin () const
 read-only iterator pointing to the begin of the stored values More...
 
value_type::const_iterator vectorEnd () const
 read-only iterator poining one place after the stored values More...
 
- Public Member Functions inherited from DDBase< DDName, std::unique_ptr< std::vector< double > > >
void create (const DDName &name)
 
void create (const DDName &name, std::unique_ptr< std::vector< double > > vals)
 
 DDBase ()
 
const DDNameddname () const
 
def_type isDefined () const
 
bool isValid () const
 true, if the wrapped pointer is valid More...
 
const DDNamename () const
 
 operator bool () const
 
bool operator< (const DDBase &b) const
 
bool operator== (const DDBase &b) const
 
bool operator> (const DDBase &b) const
 
DDI::rep_traits< DDName, std::unique_ptr< std::vector< double > > >::reference rep ()
 
const DDI::rep_traits< DDName, std::unique_ptr< std::vector< double > > >::reference rep () const
 
std::string toString () const
 
const DDI::rep_traits< DDName, std::unique_ptr< std::vector< double > > >::reference val ()
 
const DDI::rep_traits< DDName, std::unique_ptr< std::vector< double > > >::reference val () const
 
virtual ~DDBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from DDBase< DDName, std::unique_ptr< std::vector< double > > >
static auto begin ()
 
static auto end ()
 

Detailed Description

a named constant corresponding to the DDL-XML tag <Constant> and <ConstantsVector>

Definition at line 18 of file DDVector.h.

Member Typedef Documentation

◆ size_t

using DDVector::size_t = std::vector<double>::size_type

size type for the size of the stored values

Definition at line 21 of file DDVector.h.

◆ value_type

using DDVector::value_type = std::vector<double>

value type of the managed object

Definition at line 24 of file DDVector.h.

Constructor & Destructor Documentation

◆ DDVector() [1/3]

DDVector::DDVector ( )

an uninitialized constant; one can assign an initialized constant to make it valid

Definition at line 5 of file DDVector.cc.

◆ DDVector() [2/3]

DDVector::DDVector ( const DDName name)

◆ DDVector() [3/3]

DDVector::DDVector ( const DDName name,
std::unique_ptr< std::vector< double > >  value 
)

creation of a new named constant; if it already existed with the given name, it's overwritten with new values

Member Function Documentation

◆ operator double()

DDVector::operator double ( ) const
inline

convert to a double

Definition at line 54 of file DDVector.h.

54 { return rep()[0]; }

References DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep().

◆ operator std::vector< double >()

DDVector::operator std::vector< double > ( ) const
inline

convert to a std::vector<double>

Definition at line 57 of file DDVector.h.

57 { return rep(); }

References DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep().

◆ operator std::vector< int >()

DDVector::operator std::vector< int > ( ) const

convert to a std::vector<int> (expensive!)

Definition at line 27 of file DDVector.cc.

27  {
28  std::vector<int> result(rep().size());
30  std::vector<double>::const_iterator it(rep().begin()), ed(rep().end());
31  for (; it != ed; ++it) {
32  result[sz] = int(*it);
33  ++sz;
34  }
35  return result;
36 }

References begin, end, createfilelist::int, cuy::rep, mps_fire::result, and findQualityFiles::size.

◆ operator[]()

double DDVector::operator[] ( size_t  pos) const
inline

returns the value on position pos; does not check boundaries!

Definition at line 42 of file DDVector.h.

42 { return rep()[pos]; }

References DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep().

◆ size()

size_t DDVector::size ( void  ) const
inline

◆ value()

double DDVector::value ( ) const
inline

◆ values()

const value_type& DDVector::values ( ) const
inline

the stored values

Definition at line 39 of file DDVector.h.

39 { return rep(); }

References DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep().

Referenced by operator<<().

◆ vectorBegin()

value_type::const_iterator DDVector::vectorBegin ( ) const
inline

read-only iterator pointing to the begin of the stored values

Definition at line 48 of file DDVector.h.

48 { return rep().begin(); }

References DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep().

◆ vectorEnd()

value_type::const_iterator DDVector::vectorEnd ( ) const
inline

read-only iterator poining one place after the stored values

Definition at line 51 of file DDVector.h.

51 { return rep().end(); }

References DDBase< DDName, std::unique_ptr< std::vector< double > > >::rep().

pos
Definition: PixelAliasList.h:18
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 > > >::end
static auto end()
Definition: DDBase.h:52
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
createfilelist.int
int
Definition: createfilelist.py:10
DDBase< DDName, std::unique_ptr< std::vector< double > > >::begin
static auto begin()
Definition: DDBase.h:53
DDBase< DDName, std::unique_ptr< std::vector< double > > >::create
void create(const DDName &name, std::unique_ptr< std::vector< double > > vals)
Definition: DDBase.h:96
mps_fire.result
result
Definition: mps_fire.py:303
DDBase
Definition: DDBase.h:10
DDVector::size
size_t size() const
the size of the array of values
Definition: DDVector.h:36