18 #ifndef COPASI_CCopasiParameterGroup
19 #define COPASI_CCopasiParameterGroup
65 const std::string &
objectType =
"ParameterGroup");
137 template <
class CType >
156 static_cast<parameterGroup *
>(
const_cast<void *
>((
const void *) & value));
189 template <
class CType >
192 const CType & defaultValue)
196 if (pParm && pParm->
getType() == type)
return pParm;
210 bool addGroup(
const std::string & name);
337 std::string
getKey(
const std::string & name)
const;
344 std::string
getKey(
const size_t & index)
const;
352 virtual const std::string &
getName(
const size_t & index)
const;
360 template <
class CType>
367 if (pParameter)
return pParameter->
setValue(value);
378 template <
class CType>
385 if (pParameter)
return pParameter->
setValue(value);
397 bool swap(
const size_t & iFrom,
426 size_t getIndex(
const std::string & name)
const;
442 virtual void print(std::ostream * ostream)
const;
479 template <
typename ElevateTo,
typename ElevateFrom>
488 ElevateFrom * pFrom =
dynamic_cast<ElevateFrom *
>(pParm);
498 ElevateTo * pTo = NULL;
505 std::vector< CCopasiParameter * >::iterator it =
506 pGrp->CCopasiParameter::getValue().pGROUP->begin();
507 std::vector< CCopasiParameter * >::iterator end =
508 pGrp->CCopasiParameter::getValue().pGROUP->end();
510 while (it != end && *it != pParm) ++it;
518 pTo =
new ElevateTo(*pFrom);
521 pGrp->CCopasiContainer::add(pTo,
true);
525 pTo =
new ElevateTo(*pFrom);
529 #endif // COPASI_CCopasiParameterGroup
std::string getUniqueParameterName(const CCopasiParameter *pParameter) const
virtual const std::string & getName(const size_t &index) const
bool setValue(const CType &value)
friend std::ostream & operator<<(std::ostream &os, const CCopasiParameterGroup &o)
bool swap(const size_t &iFrom, const size_t &iTo)
virtual bool elevateChildren()
bool isValidValue(const C_FLOAT64 &value) const
virtual ~CCopasiParameterGroup()
size_t getIndex(const std::string &name) const
friend bool operator==(const CCopasiParameterGroup &lhs, const CCopasiParameterGroup &rhs)
std::vector< CCopasiParameter * > * pGROUP
virtual void print(std::ostream *ostream) const
index_iterator endIndex() const
bool addParameter(const std::string &name, const CCopasiParameter::Type type, const CType &value)
name_iterator beginName() const
CCopasiContainer::objectMap::iterator name_iterator
bool removeParameter(const std::string &name)
ElevateTo * elevate(CCopasiParameter *pParm)
const CCopasiParameter::Type & getType() const
std::vector< CCopasiParameter * > parameterGroup
bool addGroup(const std::string &name)
virtual const std::string & getKey() const
index_iterator beginIndex() const
const Value & getValue() const
bool setValue(const size_t &index, const CType &value)
bool setValue(const std::string &name, const CType &value)
CCopasiParameterGroup * assertGroup(const std::string &name)
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameterGroup & operator=(const CCopasiParameterGroup &rhs)
bool addParameter(const CCopasiParameter ¶meter)
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
CCopasiParameterGroup * getGroup(const std::string &name)
name_iterator endName() const
parameterGroup::iterator index_iterator
CCopasiContainer * getObjectParent() const