test
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 29 of file FWCompositeParameter.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file FWCompositeParameter.cc.

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

Definition at line 46 of file FWCompositeParameter.cc.

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

Member Function Documentation

void FWCompositeParameter::addTo ( FWConfiguration oTo) const
virtual

Implements FWConfigurable.

Definition at line 87 of file FWCompositeParameter.cc.

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

88 {
90 
91  for(const_iterator it =begin(), itEnd = end();
92  it != itEnd;
93  ++it) {
94  (*it)->addTo(conf);
95  }
96 // std::for_each(begin(), end(),
97 // boost::bind(&FWParameterBase::addTo,_1,conf));
98 
99  oTo.addKeyValue(name(),conf,true);
100 }
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
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 66 of file FWCompositeParameter.cc.

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

67 {
68  //need a way to handle versioning
69  const FWConfiguration* mine = iFrom.valueForKey(name());
70  const FWConfiguration::KeyValues* keyVals = mine->keyValues();
71 
72  assert(0!=mine);
73  assert(mine->version()==m_version);
74  assert(0 != keyVals);
75 
76  for(const_iterator it =begin(), itEnd = end();
77  it != itEnd;
78  ++it) {
79  (*it)->setFrom(*mine);
80  }
81 }
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
std::vector< FWParameterBase * >::const_iterator const_iterator
const KeyValues * keyValues() const
const_iterator begin() const
assert(m_qm.get())
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 52 of file FWCompositeParameter.h.

Referenced by addTo(), and setFrom().