CMS 3D CMS Logo

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 > * >

List of all members.

Public Types

typedef std::vector< double >
::size_type 
size_t
 size type for the size of the stored values
typedef std::vector< double > value_type
 iterator for read-only acces to stored values

Public Member Functions

 DDVector ()
 an uninitialized constant; one can assign an initialized constant to make it valid
 DDVector (const DDName &name)
 a refenrence to a constant
 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
 operator double () const
 convert to a double
 operator std::vector< double > () const
 convert to a std::vector<double>
 operator std::vector< int > () const
 convert to a std::vector<int> (expensive!)
double operator[] (size_t pos) const
 returns the value on position pos; does not check boundaries!
size_t size () const
 the size of the array of values
double value () const
 return the first stored value; does not check boundaries!
const value_typevalues () const
 the stored values
value_type::const_iterator vectorBegin () const
 read-only iterator pointing to the begin of the stored values
value_type::const_iterator vectorEnd () const
 read-only iterator poining one place after the stored values

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 9 of file DDVector.cc.

DDVector::DDVector ( const DDName name)

a refenrence to a constant

Definition at line 12 of file DDVector.cc.

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

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 17 of file DDVector.cc.

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

{
  prep_ = StoreT::instance().create(name,vals);
}  

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().

{ return rep()[0]; }
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().

{ return rep(); }
DDVector::operator std::vector< int > ( ) const

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

Definition at line 44 of file DDVector.cc.

References begin, end, cuy::rep, query::result, and findQualityFiles::size.

{
   std::vector<int> result(rep().size());
   std::vector<int>::size_type sz=0;
   std::vector<double>::const_iterator it(rep().begin()), ed(rep().end());
   for (; it != ed; ++it) { 
     result[sz] = int(*it);
     ++sz;
   }  
   return result;
}
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 pos, and DDBase< DDName, std::vector< double > * >::rep().

{ return rep()[pos]; }
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 operator<<().

{ return rep().size(); }
double DDVector::value ( ) const [inline]

return the first stored value; does not check boundaries!

Definition at line 49 of file DDVector.h.

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

{ return rep()[0]; }
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<<().

{ return rep(); }
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().

{ return rep().begin(); }
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().

{ return rep().end(); }