59 if (pObjectInterface != NULL)
61 return pObjectInterface;
66 std::string::size_type pos = UniqueName.find_last_of(
'[');
67 std::string Name = UniqueName.substr(0, pos);
74 for (; it != end; ++it)
76 if ((*it)->getObjectName() == Name)
103 std::vector< std::string > ToBeRemoved;
104 std::vector< CCopasiParameter * > ToBeAdded;
109 while (itRHS != endRHS && itLHS != endLHS)
112 if ((pRHS = dynamic_cast< CCopasiParameter * >(itRHS->second)) == NULL)
119 if ((pLHS = dynamic_cast< CCopasiParameter * >(itLHS->second)) == NULL)
130 if (NameLHS < NameRHS)
132 ToBeRemoved.push_back(NameLHS);
138 if (NameLHS > NameRHS)
140 ToBeAdded.push_back(pRHS);
152 while (itLHS != endLHS)
155 if ((pLHS = dynamic_cast< CCopasiParameter * >(itLHS->second)) != NULL)
162 while (itRHS != endRHS)
165 if ((pRHS = dynamic_cast< CCopasiParameter * >(itRHS->second)) != NULL)
166 ToBeAdded.push_back(pRHS);
172 std::vector< std::string >::const_iterator itToBeRemoved = ToBeRemoved.begin();
173 std::vector< std::string >::const_iterator endToBeRemoved = ToBeRemoved.end();
175 for (; itToBeRemoved != endToBeRemoved; ++itToBeRemoved)
180 std::vector< CCopasiParameter * >::const_iterator itToBeAdded = ToBeAdded.begin();
181 std::vector< CCopasiParameter * >::const_iterator endToBeAdded = ToBeAdded.end();
183 for (; itToBeAdded != endToBeAdded; ++itToBeAdded)
185 if ((*itToBeAdded)->getType() ==
GROUP)
201 os <<
"<<< Parameter Group: " << o.
getObjectName() << std::endl;
203 CCopasiParameterGroup::parameterGroup::const_iterator it =
204 o.CCopasiParameter::getValue().pGROUP->begin();
205 CCopasiParameterGroup::parameterGroup::const_iterator end =
206 o.CCopasiParameter::getValue().pGROUP->end();
208 for (; it != end; ++it)
214 os <<
">>> Parameter Group: " << o.
getObjectName() << std::endl;
225 CCopasiParameterGroup::parameterGroup::const_iterator itLhs =
227 CCopasiParameterGroup::parameterGroup::const_iterator endLhs =
230 CCopasiParameterGroup::parameterGroup::const_iterator itRhs =
233 for (; itLhs != endLhs; ++itLhs, ++itRhs)
234 if (!(**itLhs == **itRhs))
return false;
258 if (pParameter == NULL)
return;
301 if (pGrp)
return pGrp;
345 std::pair < CCopasiContainer::objectMap::const_iterator,
346 CCopasiContainer::objectMap::const_iterator > range =
349 if (range.first == range.second)
return NULL;
357 std::pair < CCopasiContainer::objectMap::const_iterator,
358 CCopasiContainer::objectMap::const_iterator > range =
361 if (range.first == range.second)
return NULL;
442 if (pParameter)
return pParameter->
getType();
452 if (pParameter)
return pParameter->
getType();
462 if (pParameter)
return pParameter->
getKey();
472 if (pParameter)
return pParameter->
getKey();
479 static std::string Invalid(
"Invalid Index");
495 return swap(from, to);
522 for (; it != end; ++it)
pdelete(*it);
533 for (
size_t i = 0; it != end; ++it, ++i)
534 if (name == (*it)->getObjectName())
return i;;
549 for (; it != end; ++it)
551 if ((*it)->getObjectName() == Name)
555 if (*it == pParameter)
567 std::stringstream UniqueName;
568 UniqueName << Name <<
"[" << Index <<
"]";
570 return UniqueName.str();
std::string getUniqueParameterName(const CCopasiParameter *pParameter) const
virtual const std::string & getName(const size_t &index) const
bool swap(const size_t &iFrom, const size_t &iTo)
virtual bool elevateChildren()
virtual ~CCopasiParameterGroup()
size_t getIndex(const std::string &name) const
const std::string & getObjectName() const
CCopasiObjectName getRemainder() const
virtual const objectMap & getObjects() const
std::vector< CCopasiParameter * > * pGROUP
virtual void print(std::ostream *ostream) const
index_iterator endIndex() const
name_iterator beginName() const
bool operator==(const CCopasiParameterGroup &lhs, const CCopasiParameterGroup &rhs)
CCopasiContainer::objectMap::iterator name_iterator
std::multimap< std::string, CCopasiObject * > objectMap
bool removeParameter(const std::string &name)
const CCopasiParameter::Type & getType() const
std::ostream & operator<<(std::ostream &os, const CCopasiParameterGroup &o)
bool addGroup(const std::string &name)
virtual const std::string & getKey() const
index_iterator beginIndex() const
const Value & getValue() const
unsigned C_INT32 strToUnsignedInt(const char *str, char const **pTail)
CCopasiParameterGroup * assertGroup(const std::string &name)
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameterGroup & operator=(const CCopasiParameterGroup &rhs)
bool addParameter(const CCopasiParameter ¶meter)
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
CCopasiParameterGroup * getGroup(const std::string &name)
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
name_iterator endName() const
bool setObjectName(const std::string &name)
parameterGroup::iterator index_iterator
std::string getObjectName() const