CMS 3D CMS Logo

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

#include <Fireworks/Core/interface/FWCompositeParameter.h>

Inheritance diagram for FWCompositeParameter:
FWParameterBase FWParameterizable FWConfigurable

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 FWCompositeParameter (FWParameterizable *iParent, const std::string &iName, unsigned int iVersion=1)
 
virtual void setFrom (const FWConfiguration &)
 
virtual ~FWCompositeParameter ()
 
- Public Member Functions inherited from FWParameterBase
 FWParameterBase (FWParameterizable *iParent, const std::string &iName)
 
const std::string & name () const
 
virtual ~FWParameterBase ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 

Private Member Functions

 FWCompositeParameter (const FWCompositeParameter &)
 
const FWCompositeParameteroperator= (const FWCompositeParameter &)
 

Private Attributes

unsigned int m_version
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 30 of file FWCompositeParameter.h.

Constructor & Destructor Documentation

FWCompositeParameter::FWCompositeParameter ( FWParameterizable iParent,
const std::string &  iName,
unsigned int  iVersion = 1 
)

Definition at line 34 of file FWCompositeParameter.cc.

36  :
37  FWParameterBase(iParent,iName),
38  m_version(iVersion)
39 {
40 }
FWParameterBase(FWParameterizable *iParent, const std::string &iName)
FWCompositeParameter::~FWCompositeParameter ( )
virtual

Definition at line 47 of file FWCompositeParameter.cc.

48 {
49 }
FWCompositeParameter::FWCompositeParameter ( const FWCompositeParameter )
private

Member Function Documentation

void FWCompositeParameter::addTo ( FWConfiguration oTo) const
virtual

Implements FWConfigurable.

Definition at line 88 of file FWCompositeParameter.cc.

References FWConfiguration::addKeyValue(), FWParameterizable::begin(), dbtoconf::conf, FWParameterizable::end(), m_version, and FWParameterBase::name().

89 {
91 
92  for(const_iterator it =begin(), itEnd = end();
93  it != itEnd;
94  ++it) {
95  (*it)->addTo(conf);
96  }
97 // std::for_each(begin(), end(),
98 // boost::bind(&FWParameterBase::addTo,_1,conf));
99 
100  oTo.addKeyValue(name(),conf,true);
101 }
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
tuple conf
Definition: dbtoconf.py:185
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
const std::string & name() const
const FWCompositeParameter& FWCompositeParameter::operator= ( const FWCompositeParameter )
private
void FWCompositeParameter::setFrom ( const FWConfiguration iFrom)
virtual

Implements FWConfigurable.

Definition at line 67 of file FWCompositeParameter.cc.

References FWParameterizable::begin(), FWParameterizable::end(), FWConfiguration::keyValues(), m_version, FWParameterBase::name(), FWConfiguration::valueForKey(), and FWConfiguration::version().

68 {
69  //need a way to handle versioning
70  const FWConfiguration* mine = iFrom.valueForKey(name());
71  const FWConfiguration::KeyValues* keyVals = mine->keyValues();
72 
73  assert(0!=mine);
74  assert(mine->version()==m_version);
75  assert(0 != keyVals);
76 
77  for(const_iterator it =begin(), itEnd = end();
78  it != itEnd;
79  ++it) {
80  (*it)->setFrom(*mine);
81  }
82 }
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
std::vector< FWParameterBase * >::const_iterator const_iterator
const KeyValues * keyValues() const
const_iterator begin() const
unsigned int version() const
const_iterator end() const
const FWConfiguration * valueForKey(const std::string &iKey) const
const std::string & name() const

Member Data Documentation

unsigned int FWCompositeParameter::m_version
private

Definition at line 53 of file FWCompositeParameter.h.

Referenced by addTo(), and setFrom().