18 const bool & createMissing):
32 const bool & createMissing)
39 for (; itSrc != endSrc; ++itSrc)
42 (*itSrc)->getCompareResult() !=
Missing)
44 copy(**itSrc, createMissing);
55 const bool & createMissing)
80 pCopy =
new CModelParameterGroup(*static_cast< const CModelParameterGroup * >(&src),
this, createMissing);
124 return pModelParameter;
128 add(pModelParameter);
130 return pModelParameter;
143 for (; it != End; ++it)
145 if (*it == pModelParameter)
196 for (; it != End; ++it)
208 for (; it != End; ++it)
210 (*it)->setParent(NULL);
220 const bool & createMissing)
240 std::map< CCopasiObjectName, CModelParameter * > Map;
242 for (; itConst != endConst; ++itConst)
244 Map[(*itConst)->getCN()] = *itConst;
250 for (; itThis != endThis; ++itThis)
252 std::map< CCopasiObjectName, CModelParameter * >::const_iterator itOther = Map.find((*itThis)->getCN());
254 if (itOther == Map.end())
256 (*itThis)->setCompareResult(
Obsolete);
262 if ((*itThis)->diff(*itOther->second, framework, createMissing) !=
Identical)
267 Map.erase(itOther->first);
272 std::map< CCopasiObjectName, CModelParameter * >::const_iterator itMissing = Map.begin();
273 std::map< CCopasiObjectName, CModelParameter * >::const_iterator endMissing = Map.end();
275 for (; itMissing != endMissing; ++itMissing)
279 if (pMissing != NULL)
287 else if (Map.size() > 0)
289 std::map< CCopasiObjectName, CModelParameter * >::const_iterator itMissing = Map.begin();
290 std::map< CCopasiObjectName, CModelParameter * >::const_iterator endMissing = Map.end();
292 for (; itMissing != endMissing; ++itMissing)
313 for (; it != End; ++it)
315 success &= (*it)->updateModel();
344 std::vector< CModelParameter * > ToBeDeleted;
346 for (; it != End; ++it)
348 if (modifyExistence &&
351 ToBeDeleted.push_back(*it);
355 success &= (*it)->refreshFromModel(modifyExistence);
359 std::vector< CModelParameter * >::iterator itDelete = ToBeDeleted.begin();
360 std::vector< CModelParameter * >::iterator endDelete = ToBeDeleted.end();
362 for (; itDelete != endDelete; ++itDelete)
364 success &= (*itDelete)->refreshFromModel(modifyExistence);
377 for (; it != End && pModelParameter == NULL; ++it)
379 if (cn == (*it)->getCN())
381 pModelParameter = *it;
391 return pModelParameter;
402 for (; it != End && pModelParameter == NULL; ++it)
404 if (type == (*it)->getType() &&
405 name == (*it)->getName())
407 pModelParameter = *it;
417 return pModelParameter;
CModelParameterGroup(CModelParameterGroup *pParent, const CModelParameter::Type &type=CModelParameter::Group)
virtual const CModelParameter * getChild(const size_t &index) const
std::vector< CModelParameter * >::iterator iterator
CModelParameter * getModelParameter(const std::string &cn) const
void setCompareResult(const CompareResult &compareResult)
std::vector< CModelParameter * > mModelParameters
virtual size_t getNumChildren() const
void assignGroupContent(const CModelParameterGroup &src, const bool &createMissing)
CModelParameter * copy(const CModelParameter &src, const bool &createMissing)
CompareResult mCompareResult
virtual bool updateModel()
void remove(CModelParameter *pModelParameter)
std::vector< CModelParameter * >::const_iterator const_iterator
virtual const CompareResult & diff(const CModelParameter &other, const CModelParameter::Framework &framework, const bool &createMissing=false)
virtual ~CModelParameterGroup()
virtual bool refreshFromModel(const bool &modifyExistence)
const Type & getType() const
CModelParameter * add(const CModelParameter::Type &type)