CMS 3D CMS Logo

List of all members | Public 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)
 
 FWCompositeParameter (const FWCompositeParameter &)=delete
 
const FWCompositeParameteroperator= (const FWCompositeParameter &)=delete
 
void setFrom (const FWConfiguration &) override
 
 ~FWCompositeParameter () override
 
- Public Member Functions inherited from FWParameterBase
 FWParameterBase (FWParameterizable *iParent, const std::string &iName)
 
 FWParameterBase (const FWParameterBase &)=delete
 
const std::string & name () const
 
const FWParameterBaseoperator= (const FWParameterBase &)=delete
 
 ~FWParameterBase () override
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
 FWConfigurable (const FWConfigurable &)=delete
 
const FWConfigurableoperator= (const FWConfigurable &)=delete
 
virtual ~FWConfigurable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
 FWParameterizable (const FWParameterizable &)=delete
 
const FWParameterizableoperator= (const FWParameterizable &)=delete
 
virtual ~FWParameterizable ()
 

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) {}
FWParameterBase(FWParameterizable *iParent, const std::string &iName)

◆ ~FWCompositeParameter()

FWCompositeParameter::~FWCompositeParameter ( )
override

Definition at line 40 of file FWCompositeParameter.cc.

40 {}

◆ FWCompositeParameter() [2/2]

FWCompositeParameter::FWCompositeParameter ( const FWCompositeParameter )
delete

Member Function Documentation

◆ addTo()

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  // std::bind(&FWParameterBase::addTo, std::placeholders::_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
const std::string & name() const
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)

◆ operator=()

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

◆ setFrom()

void FWCompositeParameter::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWConfigurable.

Definition at line 57 of file FWCompositeParameter.cc.

References cms::cuda::assert(), 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_iterator begin() const
std::vector< FWParameterBase * >::const_iterator const_iterator
assert(be >=bs)
const_iterator end() const
const std::string & name() const
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
const FWConfiguration * valueForKey(const std::string &iKey) const
const KeyValues * keyValues() const
unsigned int version() const

Member Data Documentation

◆ m_version

unsigned int FWCompositeParameter::m_version
private

Definition at line 48 of file FWCompositeParameter.h.

Referenced by addTo(), and setFrom().