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::vector< double > * >

Public Types

typedef std::vector< double >::size_type size_t
 size type for the size of the stored values More...
 
typedef std::vector< double > value_type
 iterator for read-only acces to stored values More...
 
- Public Types inherited from DDBase< DDName, std::vector< double > * >
typedef std::pair< const DDName *, bool > def_type
 
typedef std::vector< double > * pimpl_type
 
typedef DDI::rep_type< DDName, pimpl_type > * prep_type
 
typedef DDI::Singleton< DDI::Store< DDName, std::vector< double > * > > StoreT
 

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::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::vector< double > * >
 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
 
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep () const
 
DDI::rep_traits< DDName, std::vector< double > * >::reference rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName, std::vector< double > * >::reference val () const
 
const DDI::rep_traits< DDName, std::vector< double > * >::reference val ()
 
virtual ~DDBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from DDBase< DDName, std::vector< double > * >
static auto begin ()
 
static void clear ()
 
static auto end ()
 
static size_t size ()
 
- Protected Attributes inherited from DDBase< DDName, std::vector< double > * >
prep_type prep_
 

Detailed Description

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

Definition at line 17 of file DDVector.h.

Member Typedef Documentation

typedef std::vector<double>::size_type DDVector::size_t

size type for the size of the stored values

Definition at line 22 of file DDVector.h.

typedef std::vector<double> DDVector::value_type

iterator for read-only acces to stored values

value type of the managed object

Definition at line 28 of file DDVector.h.

Constructor & Destructor Documentation

DDVector::DDVector ( )

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

Definition at line 7 of file DDVector.cc.

DDVector::DDVector ( const DDName name)

a refenrence to a constant

Definition at line 10 of file DDVector.cc.

References DDI::Singleton< I >::instance(), and DDBase< DDName, std::vector< double > * >::prep_.

11 {
12  prep_ = StoreT::instance().create(name);
13 }
Definition: DDBase.h:10
static value_type & instance()
DDVector::DDVector ( const DDName name,
std::vector< double > *  value 
)

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

Definition at line 15 of file DDVector.cc.

References DDI::Singleton< I >::instance(), and DDBase< DDName, std::vector< double > * >::prep_.

Member Function Documentation

DDVector::operator double ( ) const
inline

convert to a double

Definition at line 58 of file DDVector.h.

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

58 { return rep()[0]; }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
DDVector::operator std::vector< double > ( ) const
inline

convert to a std::vector<double>

Definition at line 61 of file DDVector.h.

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

61 { return rep(); }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
DDVector::operator std::vector< int > ( ) const

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

Definition at line 42 of file DDVector.cc.

References DDBase< DDName, std::vector< double > * >::begin(), DDBase< DDName, std::vector< double > * >::end(), createfilelist::int, DDBase< DDName, std::vector< double > * >::rep(), mps_fire::result, and size().

43 {
44  std::vector<int> result(rep().size());
46  std::vector<double>::const_iterator it(rep().begin()), ed(rep().end());
47  for (; it != ed; ++it) {
48  result[sz] = int(*it);
49  ++sz;
50  }
51  return result;
52 }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
size_t size() const
the size of the array of values
Definition: DDVector.h:40
uint16_t size_type
double DDVector::operator[] ( size_t  pos) const
inline

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

Definition at line 46 of file DDVector.h.

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

46 { return rep()[pos]; }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
size_t DDVector::size ( void  ) const
inline

the size of the array of values

Definition at line 40 of file DDVector.h.

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

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), DDCutTubsFromPoints::initialize(), operator std::vector< int >(), and operator<<().

40 { return rep().size(); }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
double DDVector::value ( ) const
inline
const value_type& DDVector::values ( ) const
inline

the stored values

Definition at line 43 of file DDVector.h.

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

Referenced by operator<<().

43 { return rep(); }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
value_type::const_iterator DDVector::vectorBegin ( ) const
inline

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

Definition at line 52 of file DDVector.h.

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

52 { return rep().begin(); }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84
value_type::const_iterator DDVector::vectorEnd ( ) const
inline

read-only iterator poining one place after the stored values

Definition at line 55 of file DDVector.h.

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

55 { return rep().end(); }
const DDI::rep_traits< DDName, std::vector< double > * >::reference rep() const
Definition: DDBase.h:84