CMS 3D CMS Logo

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

void addTo (FWConfiguration &) const override
 
 FWCompositeParameter (FWParameterizable *iParent, const std::string &iName, unsigned int iVersion=1)
 
void setFrom (const FWConfiguration &) override
 
 ~FWCompositeParameter () override
 
- Public Member Functions inherited from FWParameterBase
 FWParameterBase (FWParameterizable *iParent, const std::string &iName)
 
const std::string & name () const
 
 ~FWParameterBase () override
 
- 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 &)=delete
 
const FWCompositeParameteroperator= (const FWCompositeParameter &)=delete
 

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 32 of file FWCompositeParameter.cc.

33  : FWParameterBase(iParent, iName), m_version(iVersion) {}
FWParameterBase(FWParameterizable *iParent, const std::string &iName)
FWCompositeParameter::~FWCompositeParameter ( )
override

Definition at line 40 of file FWCompositeParameter.cc.

40 {}
FWCompositeParameter::FWCompositeParameter ( const FWCompositeParameter )
privatedelete

Member Function Documentation

void FWCompositeParameter::addTo ( FWConfiguration oTo) const
overridevirtual

Implements FWConfigurable.

Definition at line 74 of file FWCompositeParameter.cc.

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

74  {
76 
77  for (const_iterator it = begin(), itEnd = end(); it != itEnd; ++it) {
78  (*it)->addTo(conf);
79  }
80  // std::for_each(begin(), end(),
81  // boost::bind(&FWParameterBase::addTo,_1,conf));
82 
83  oTo.addKeyValue(name(), conf, true);
84 }
const_iterator begin() const
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
const std::string & name() const
const FWCompositeParameter& FWCompositeParameter::operator= ( const FWCompositeParameter )
privatedelete
void FWCompositeParameter::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 57 of file FWCompositeParameter.cc.

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

57  {
58  //need a way to handle versioning
59  const FWConfiguration* mine = iFrom.valueForKey(name());
60  const FWConfiguration::KeyValues* keyVals = mine->keyValues();
61 
62  assert(nullptr != mine);
63  assert(mine->version() == m_version);
64  assert(nullptr != keyVals);
65 
66  for (const_iterator it = begin(), itEnd = end(); it != itEnd; ++it) {
67  (*it)->setFrom(*mine);
68  }
69 }
const KeyValues * keyValues() const
const_iterator begin() const
unsigned int version() const
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
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 48 of file FWCompositeParameter.h.

Referenced by addTo(), and setFrom().