File indexing completed on 2024-04-06 12:11:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <cassert>
0015 #include <algorithm>
0016
0017
0018 #include "Fireworks/Core/interface/FWCompositeParameter.h"
0019 #include "Fireworks/Core/interface/FWConfiguration.h"
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 FWCompositeParameter::FWCompositeParameter(FWParameterizable* iParent, const std::string& iName, unsigned int iVersion)
0033 : FWParameterBase(iParent, iName), m_version(iVersion) {}
0034
0035
0036
0037
0038
0039
0040 FWCompositeParameter::~FWCompositeParameter() {}
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 void FWCompositeParameter::setFrom(const FWConfiguration& iFrom) {
0058
0059 const FWConfiguration* mine = iFrom.valueForKey(name());
0060 const FWConfiguration::KeyValues* keyVals = mine->keyValues();
0061
0062 assert(nullptr != mine);
0063 assert(mine->version() == m_version);
0064 assert(nullptr != keyVals);
0065
0066 for (const_iterator it = begin(), itEnd = end(); it != itEnd; ++it) {
0067 (*it)->setFrom(*mine);
0068 }
0069 }
0070
0071
0072
0073
0074 void FWCompositeParameter::addTo(FWConfiguration& oTo) const {
0075 FWConfiguration conf(m_version);
0076
0077 for (const_iterator it = begin(), itEnd = end(); it != itEnd; ++it) {
0078 (*it)->addTo(conf);
0079 }
0080
0081
0082
0083 oTo.addKeyValue(name(), conf, true);
0084 }
0085
0086
0087
0088