test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
DDMap Class Reference

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

#include <DDMap.h>

Inheritance diagram for DDMap:
DDBase< DDName, dd_map_type * >

Public Types

typedef dd_map_type::size_type size_t
 size type for the size of the stored values More...
 
typedef dd_map_type value_type
 the type of the managed object More...
 
- Public Types inherited from DDBase< DDName, dd_map_type * >
typedef std::pair< const
DDName *, bool > 
def_type
 
typedef dd_map_typepimpl_type
 
typedef DDI::rep_type< DDName,
pimpl_type > * 
prep_type
 
typedef DDI::Singleton
< DDI::Store< DDName,
dd_map_type * > > 
StoreT
 

Public Member Functions

 DDMap ()
 an uninitialized constant; one can assign an initialized constant to make it valid More...
 
 DDMap (const DDName &name)
 a refenrence to a constant More...
 
 DDMap (const DDName &name, dd_map_type *value)
 creation of a new named constant; if it already existed with the given name, it's overwritten with new values More...
 
value_type::const_iterator mapBegin () const
 read-only iterator pointing to the begin of the stored values More...
 
value_type::const_iterator mapEnd () const
 read-only iterator poining one place after the stored values More...
 
const double & operator[] (const std::string &name) const
 returns the value on position pos; does not check boundaries! More...
 
size_t size () const
 the size of the array of values More...
 
const dd_map_typevalues () const
 the stored values More...
 
- Public Member Functions inherited from DDBase< DDName, dd_map_type * >
 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,
dd_map_type * >::reference 
rep () const
 
DDI::rep_traits< DDName,
dd_map_type * >::reference 
rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName,
dd_map_type * >::reference 
val () const
 
const DDI::rep_traits< DDName,
dd_map_type * >::reference 
val ()
 
virtual ~DDBase ()
 

Additional Inherited Members

- Static Public Member Functions inherited from DDBase< DDName, dd_map_type * >
static DDI::Store< DDName,
dd_map_type * >::iterator 
begin ()
 
static void clear ()
 
static DDI::Store< DDName,
dd_map_type * >::iterator 
end ()
 
static size_t size ()
 
- Protected Attributes inherited from DDBase< DDName, dd_map_type * >
prep_type prep_
 

Detailed Description

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

Definition at line 19 of file DDMap.h.

Member Typedef Documentation

typedef dd_map_type::size_type DDMap::size_t

size type for the size of the stored values

Definition at line 26 of file DDMap.h.

the type of the managed object

Definition at line 23 of file DDMap.h.

Constructor & Destructor Documentation

DDMap::DDMap ( )

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

Definition at line 3 of file DDMap.cc.

DDMap::DDMap ( const DDName name)

a refenrence to a constant

Definition at line 6 of file DDMap.cc.

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

7 {
8  prep_ = StoreT::instance().create(name);
9 }
static value_type & instance()
DDMap::DDMap ( const DDName name,
dd_map_type value 
)

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

Definition at line 11 of file DDMap.cc.

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

12 {
13  prep_ = StoreT::instance().create(name,vals);
14 }
static value_type & instance()

Member Function Documentation

value_type::const_iterator DDMap::mapBegin ( ) const
inline

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

Definition at line 50 of file DDMap.h.

References DDBase< DDName, dd_map_type * >::rep().

50 { return rep().begin(); }
const DDI::rep_traits< DDName, dd_map_type * >::reference rep() const
Definition: DDBase.h:89
value_type::const_iterator DDMap::mapEnd ( ) const
inline

read-only iterator poining one place after the stored values

Definition at line 53 of file DDMap.h.

References DDBase< DDName, dd_map_type * >::rep().

53 { return rep().end(); }
const DDI::rep_traits< DDName, dd_map_type * >::reference rep() const
Definition: DDBase.h:89
const double& DDMap::operator[] ( const std::string &  name) const
inline

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

Definition at line 44 of file DDMap.h.

References DDBase< DDName, dd_map_type * >::name(), alignCSCRings::r, and DDBase< DDName, dd_map_type * >::rep().

44  {
45  const dd_map_type & r(rep());
46  return r[name];
47  }
const DDI::rep_traits< DDName, dd_map_type * >::reference rep() const
Definition: DDBase.h:89
const DDName & name() const
Definition: DDBase.h:82
size_t DDMap::size ( void  ) const
inline

the size of the array of values

Definition at line 38 of file DDMap.h.

References DDBase< DDName, dd_map_type * >::rep().

Referenced by operator<<().

38 { return rep().size(); }
const DDI::rep_traits< DDName, dd_map_type * >::reference rep() const
Definition: DDBase.h:89
const dd_map_type& DDMap::values ( ) const
inline

the stored values

Definition at line 41 of file DDMap.h.

References DDBase< DDName, dd_map_type * >::rep().

Referenced by operator<<().

41 { return rep(); }
const DDI::rep_traits< DDName, dd_map_type * >::reference rep() const
Definition: DDBase.h:89