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() [1/2]

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) {}

◆ ~FWCompositeParameter()

FWCompositeParameter::~FWCompositeParameter ( )
override

Definition at line 40 of file FWCompositeParameter.cc.

40 {}

◆ FWCompositeParameter() [2/2]

FWCompositeParameter::FWCompositeParameter ( const FWCompositeParameter )
privatedelete

Member Function Documentation

◆ addTo()

void FWCompositeParameter::addTo ( FWConfiguration oTo) const
overridevirtual

Implements FWConfigurable.

Definition at line 74 of file FWCompositeParameter.cc.

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 }

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

◆ operator=()

const FWCompositeParameter& FWCompositeParameter::operator= ( const FWCompositeParameter )
privatedelete

◆ setFrom()

void FWCompositeParameter::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 57 of file FWCompositeParameter.cc.

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 }

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

Member Data Documentation

◆ m_version

unsigned int FWCompositeParameter::m_version
private

Definition at line 48 of file FWCompositeParameter.h.

Referenced by addTo(), and setFrom().

FWParameterizable::const_iterator
std::vector< FWParameterBase * >::const_iterator const_iterator
Definition: FWParameterizable.h:34
cms::cuda::assert
assert(be >=bs)
FWParameterizable::end
const_iterator end() const
Definition: FWParameterizable.h:38
FWParameterizable::begin
const_iterator begin() const
Definition: FWParameterizable.h:36
FWConfiguration::KeyValues
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
Definition: FWConfiguration.h:40
FWConfiguration::valueForKey
const FWConfiguration * valueForKey(const std::string &iKey) const
Definition: FWConfiguration.cc:122
FWParameterBase::FWParameterBase
FWParameterBase(FWParameterizable *iParent, const std::string &iName)
Definition: FWParameterBase.cc:31
FWCompositeParameter::m_version
unsigned int m_version
Definition: FWCompositeParameter.h:48
FWParameterBase::name
const std::string & name() const
Definition: FWParameterBase.h:39
FWConfiguration::version
unsigned int version() const
Definition: FWConfiguration.h:49
FWConfiguration::addKeyValue
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
Definition: FWConfiguration.cc:58
FWConfiguration::keyValues
const KeyValues * keyValues() const
Definition: FWConfiguration.h:51
FWConfiguration
Definition: FWConfiguration.h:31