copasi API
0.1
|
#include <CCopasiObject.h>
Public Member Functions | |
CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL) | |
virtual | ~CCopasiObject () |
virtual void | print (std::ostream *ostream) const |
bool | setObjectName (const std::string &name) |
const std::string & | getObjectName () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) const |
const std::string & | getObjectType () const |
virtual bool | setObjectParent (const CCopasiContainer *pParent) |
CCopasiContainer * | getObjectParent () const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
virtual CCopasiObjectName | getCN () const |
virtual const CCopasiObject * | getObject (const CCopasiObjectName &cn) const |
void | setDirectDependencies (const std::set< const CCopasiObject * > &directDependencies) |
virtual const std::set< const CCopasiObject * > & | getDirectDependencies (const std::set< const CCopasiObject * > &context=std::set< const CCopasiObject * >()) const |
void | clearDirectDependencies () |
void | addDirectDependency (const CCopasiObject *pObject) |
void | removeDirectDependency (const CCopasiObject *pObject) |
void | getAllDependencies (std::set< const CCopasiObject * > &dependencies, const std::set< const CCopasiObject * > &context) const |
bool | dependsOn (std::set< const CCopasiObject * > candidates, const std::set< const CCopasiObject * > &context=std::set< const CCopasiObject * >()) const |
bool | hasCircularDependencies (std::set< const CCopasiObject * > &candidates, std::set< const CCopasiObject * > &verified, const std::set< const CCopasiObject * > &context) const |
virtual std::string | getUnits () const |
bool | isContainer () const |
bool | isVector () const |
bool | isMatrix () const |
bool | isNameVector () const |
bool | isReference () const |
bool | isValueBool () const |
bool | isValueInt () const |
bool | isValueDbl () const |
bool | isNonUniqueName () const |
bool | isStaticString () const |
bool | isValueString () const |
bool | isSeparator () const |
bool | isArray () const |
bool | isDataModel () const |
bool | isRoot () const |
virtual void * | getValuePointer () const |
virtual const CCopasiObject * | getValueObject () const |
virtual const std::string & | getKey () const |
void | setObjectValue (const C_FLOAT64 &value) |
void | setObjectValue (const C_INT32 &value) |
void | setObjectValue (const bool &value) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const bool &)) |
UpdateMethod * | getUpdateMethod () const |
bool | hasUpdateMethod () const |
template<class CType > | |
void | setRefresh (CType *pType, void(CType::*method)(void)) |
void | clearRefresh () |
Refresh * | getRefresh () const |
Static Public Member Functions | |
static std::vector< Refresh * > | buildUpdateSequence (const std::set< const CCopasiObject * > &objects, const std::set< const CCopasiObject * > &uptoDateObjects, const std::set< const CCopasiObject * > &context=std::set< const CCopasiObject * >()) |
static void | setRenameHandler (CRenameHandler *rh) |
Protected Types | |
enum | Flag { Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8, Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueDbl = 0x80, NonUniqueName = 0x100, StaticString = 0x200, ValueString = 0x400, Separator = 0x800, ModelEntity = 0x1000, Array = 0x2000, DataModel = 0x4000, Root = 0x8000, Gui = 0x10000 } |
Protected Member Functions | |
CCopasiObject () | |
CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0) | |
Static Protected Attributes | |
static const CRenameHandler * | smpRenameHandler = NULL |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CCopasiObject &o) |
enum CCopasiObject::Flag [protected] |
CCopasiObject::CCopasiObject | ( | ) | [protected] |
CCopasiObject::CCopasiObject | ( | const std::string & | name, |
const CCopasiContainer * | pParent = NULL , |
||
const std::string & | type = "CN" , |
||
const unsigned C_INT32 & | flag = 0 |
||
) | [protected] |
CCopasiObject::CCopasiObject | ( | const CCopasiObject & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
CCopasiObject::~CCopasiObject | ( | ) | [virtual] |
void CCopasiObject::addDirectDependency | ( | const CCopasiObject * | pObject | ) |
Add a the object to the direct dependencies
const | CCopasiObject * pObject |
std::vector< Refresh * > CCopasiObject::buildUpdateSequence | ( | const std::set< const CCopasiObject * > & | objects, |
const std::set< const CCopasiObject * > & | uptoDateObjects, | ||
const std::set< const CCopasiObject * > & | context = std::set< const CCopasiObject * >() |
||
) | [static] |
Build the update sequence for the given list of objects. The resulting sequence takes the dependencies of the objects in consideration. If circular dependencies are detected an exception is thrown
std::set< | const CCopasiObject * > & objects |
const | std::set< const CCopasiObject * > & uptoDateObjects |
const | std::set< const CCopasiObject * > & context (default: empty set) |
void CCopasiObject::clearDirectDependencies | ( | ) |
Clear the list of direct dependencies.
void CCopasiObject::clearRefresh | ( | ) |
bool CCopasiObject::dependsOn | ( | std::set< const CCopasiObject * > | candidates, |
const std::set< const CCopasiObject * > & | context = std::set< const CCopasiObject * >() |
||
) | const |
Check whether the current object depends on any objects in the candidates.
std::set< | const CCopasiObject * > candidates |
const | std::set< const CCopasiObject * > & context (default: empty set) |
void CCopasiObject::getAllDependencies | ( | std::set< const CCopasiObject * > & | dependencies, |
const std::set< const CCopasiObject * > & | context | ||
) | const |
If called with an empty set of dependencies it retrieves the complete list of all dependencies (including all indirect) of the current object. If called with a non empty set it will only add any dependency and all its dependencies to the list if the dependency is not already among the dependencies
std::set< | const CCopasiObject * > & dependencies |
const | std::set< const CCopasiObject * > & context |
CCopasiObjectName CCopasiObject::getCN | ( | ) | const [virtual] |
Reimplemented in CArrayElementReference.
const std::set< const CCopasiObject * > & CCopasiObject::getDirectDependencies | ( | const std::set< const CCopasiObject * > & | context = std::set< const CCopasiObject * >() | ) | const [virtual] |
Retrieve the list of direct dependencies
const | std::set< const CCopasiObject * > & context (default empty set) |
Reimplemented in CParticleReference, and CConcentrationReference.
const std::string & CCopasiObject::getKey | ( | ) | const [virtual] |
Reimplemented in CModel, CCopasiTask, CEvent, CReportDefinition, CMoiety, CCopasiParameter, CFunctionParameter, CEvaluationTree, CReaction, CModelEntity, CReference, CBiologicalDescription, CCreator, CEventAssignment, CModification, CMIRIAMInfo, CLGraphicalObject, CSlider, and CLayout.
const CCopasiObject * CCopasiObject::getObject | ( | const CCopasiObjectName & | cn | ) | const [virtual] |
Reimplemented in CCopasiVectorN< CType >, CCopasiVectorN< CEvaluationTree >, CCopasiVectorN< CReaction >, CCopasiVectorN< CEventAssignment >, CCopasiVectorN< CFunctionParameter >, CCopasiVectorN< CCopasiTask >, CCopasiVectorN< CPlotSpecification >, CCopasiVectorN< CCompartment >, CCopasiVectorN< CEvent >, CCopasiVectorN< CMetab >, CCopasiVectorN< CModelValue >, CCopasiVectorN< CReportDefinition >, CCopasiVector< CType >, CCopasiVector< CModification >, CCopasiVector< CLMetabGlyph >, CCopasiVector< CLCompartmentGlyph >, CCopasiVector< CEvaluationTree >, CCopasiVector< CReaction >, CCopasiVector< CSlider >, CCopasiVector< CRootFinder >, CCopasiVector< CBiologicalDescription >, CCopasiVector< CEventAssignment >, CCopasiVector< CReference >, CCopasiVector< CFunctionParameter >, CCopasiVector< CCopasiTask >, CCopasiVector< CLayout >, CCopasiVector< CPlotSpecification >, CCopasiVector< CLMetabReferenceGlyph >, CCopasiVector< CMoiety >, CCopasiVector< CCompartment >, CCopasiVector< CAssignment >, CCopasiVector< CChemEqElement >, CCopasiVector< CEvent >, CCopasiVector< CLReactionGlyph >, CCopasiVector< CMathEvent >, CCopasiVector< CMetab >, CCopasiVector< CModelValue >, CCopasiVector< CPlotItem >, CCopasiVector< CCopasiDataModel >, CCopasiVector< CFittingPoint >, CCopasiVector< CLTextGlyph >, CCopasiVector< CReportDefinition >, CCopasiVector< CCreator >, CCopasiVector< CMetabOld >, CCopasiVector< CLGraphicalObject >, CArrayAnnotation, and CCopasiContainer.
CCopasiContainer * CCopasiObject::getObjectAncestor | ( | const std::string & | type | ) | const |
CCopasiDataModel * CCopasiObject::getObjectDataModel | ( | ) |
Returns a pointer to the CCopasiDataModel the element belongs to. If there is no instance of CCopasiDataModel in the ancestor tree, NULL is returned.
const CCopasiDataModel * CCopasiObject::getObjectDataModel | ( | ) | const |
Returns a const pointer to the CCopasiDataModel the element belongs to. If there is no instance of CCopasiDataModel in the ancestor tree, NULL is returned.
std::string CCopasiObject::getObjectDisplayName | ( | bool | regular = true , |
bool | richtext = false |
||
) | const [virtual] |
const std::string & CCopasiObject::getObjectName | ( | ) | const |
CCopasiContainer * CCopasiObject::getObjectParent | ( | ) | const |
const std::string & CCopasiObject::getObjectType | ( | ) | const |
Refresh * CCopasiObject::getRefresh | ( | ) | const |
std::string CCopasiObject::getUnits | ( | ) | const [virtual] |
UpdateMethod * CCopasiObject::getUpdateMethod | ( | ) | const |
const CCopasiObject * CCopasiObject::getValueObject | ( | ) | const [virtual] |
void * CCopasiObject::getValuePointer | ( | ) | const [virtual] |
bool CCopasiObject::hasCircularDependencies | ( | std::set< const CCopasiObject * > & | candidates, |
std::set< const CCopasiObject * > & | verified, | ||
const std::set< const CCopasiObject * > & | context | ||
) | const |
If called with an empty set it will check whether the current object and all its dependencies (including all indirect) form a circular dependency. If called with a non empty set it check whether the candidates plus the current object and all its dependencies form a circular dependency.
std::set< | const CCopasiObject * > & dependencies |
std::set< | const CCopasiObject * > & verified |
const | std::set< const CCopasiObject * > & context |
bool CCopasiObject::hasUpdateMethod | ( | ) | const |
bool CCopasiObject::isArray | ( | ) | const |
bool CCopasiObject::isContainer | ( | ) | const |
Comparison operator which can be used to sort objects based on their dependencies If the object *lhs is a dependency of *rhs and must be evaluated first the operator return true.
const | CCopasiObject * lhs |
const | CCopasiObject * rhs |
bool CCopasiObject::isDataModel | ( | ) | const |
bool CCopasiObject::isMatrix | ( | ) | const |
bool CCopasiObject::isNameVector | ( | ) | const |
bool CCopasiObject::isNonUniqueName | ( | ) | const |
bool CCopasiObject::isReference | ( | ) | const |
bool CCopasiObject::isRoot | ( | ) | const |
bool CCopasiObject::isSeparator | ( | ) | const |
bool CCopasiObject::isStaticString | ( | ) | const |
bool CCopasiObject::isValueBool | ( | ) | const |
bool CCopasiObject::isValueDbl | ( | ) | const |
bool CCopasiObject::isValueInt | ( | ) | const |
bool CCopasiObject::isValueString | ( | ) | const |
bool CCopasiObject::isVector | ( | ) | const |
void CCopasiObject::print | ( | std::ostream * | ostream | ) | const [virtual] |
This is the output method for any object. The default implementation provided with CCopasiObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.
std::ostream | * ostream |
Reimplemented in CCopasiParameterGroup, COptProblem, CArrayAnnotation, CCopasiParameter, CEigen, CCopasiVectorReference< CType >, CCopasiMethod, CLReactionGlyph, CCopasiProblem, CLTextGlyph, CCopasiTask::CResult, CSensProblem, CSteadyStateTask, CCopasiTask::CDescription, CLGraphicalObject, CLMetabReferenceGlyph, CLayout, CMCAProblem, CFitProblem, CCrossSectionProblem, CLCompartmentGlyph, CSensTask, CCrossSectionTask, CArrayElementReference, CCopasiTimer, CCopasiObjectReference< CType >, CCopasiObjectReference< C_FLOAT64 >, CLMetabGlyph, and CCopasiStaticString.
void CCopasiObject::removeDirectDependency | ( | const CCopasiObject * | pObject | ) |
Remove an object from the direct dependencies
const | CCopasiObject * pObject |
void CCopasiObject::setDirectDependencies | ( | const std::set< const CCopasiObject * > & | directDependencies | ) |
Set the direct dependencies
const | std::set< const CCopasiObject * > & directDependencies |
bool CCopasiObject::setObjectName | ( | const std::string & | name | ) |
Set the name of the object. Note: An attempt set the name to "" results in the name being set to "No Name".
const | std::string & name |
bool CCopasiObject::setObjectParent | ( | const CCopasiContainer * | pParent | ) | [virtual] |
Reimplemented in CEvent, CModelEntity, CMetab, CReaction, and CEventAssignment.
void CCopasiObject::setObjectValue | ( | const C_FLOAT64 & | value | ) |
void CCopasiObject::setObjectValue | ( | const C_INT32 & | value | ) |
void CCopasiObject::setObjectValue | ( | const bool & | value | ) |
void CCopasiObject::setRefresh | ( | CType * | pType, |
void(CType::*)(void) | method | ||
) | [inline] |
static void CCopasiObject::setRenameHandler | ( | CRenameHandler * | rh | ) | [inline, static] |
void CCopasiObject::setUpdateMethod | ( | CType * | pType, |
void(CType::*)(const C_FLOAT64 &) | method | ||
) | [inline] |
void CCopasiObject::setUpdateMethod | ( | CType * | pType, |
void(CType::*)(const C_INT32 &) | method | ||
) | [inline] |
void CCopasiObject::setUpdateMethod | ( | CType * | pType, |
void(CType::*)(const bool &) | method | ||
) | [inline] |
std::ostream& operator<< | ( | std::ostream & | os, |
const CCopasiObject & | o | ||
) | [friend] |
const CRenameHandler * CCopasiObject::smpRenameHandler = NULL [static, protected] |