copasi API  0.1
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Attributes | Friends
CCopasiObject Class Reference

#include <CCopasiObject.h>

Inheritance diagram for CCopasiObject:
CArrayElementReference CCopasiContainer CCopasiMatrixReference< CType > CCopasiObjectReference< CType > CCopasiObjectReference< C_FLOAT64 > CCopasiStaticString CCopasiTask::CDescription CCopasiTask::CResult CCopasiTimer CCopasiVectorReference< CType > CReportDefinition

List of all members.

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)
CCopasiContainergetObjectParent () const
CCopasiDataModelgetObjectDataModel ()
const CCopasiDataModelgetObjectDataModel () const
CCopasiContainergetObjectAncestor (const std::string &type) const
virtual CCopasiObjectName getCN () const
virtual const CCopasiObjectgetObject (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 CCopasiObjectgetValueObject () 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 &))
UpdateMethodgetUpdateMethod () const
bool hasUpdateMethod () const
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
void clearRefresh ()
RefreshgetRefresh () 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 CRenameHandlersmpRenameHandler = NULL

Friends

std::ostream & operator<< (std::ostream &os, const CCopasiObject &o)

Member Enumeration Documentation

enum CCopasiObject::Flag [protected]
Enumerator:
Container 
Vector 
Matrix 
NameVector 
Reference 
ValueBool 
ValueInt 
ValueDbl 
NonUniqueName 
StaticString 
ValueString 
Separator 
ModelEntity 
Array 
DataModel 
Root 
Gui 

Constructor & Destructor Documentation

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]

Member Function Documentation

void CCopasiObject::addDirectDependency ( const CCopasiObject pObject)

Add a the object to the direct dependencies

Parameters:
constCCopasiObject * 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

Parameters:
std::set<const CCopasiObject * > & objects
conststd::set< const CCopasiObject * > & uptoDateObjects
conststd::set< const CCopasiObject * > & context (default: empty set)
Returns:
std::vector< Refresh * > updateSequence
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.

Parameters:
std::set<const CCopasiObject * > candidates
conststd::set< const CCopasiObject * > & context (default: empty set)
Returns:
bool dependsOn
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

Parameters:
std::set<const CCopasiObject * > & dependencies
conststd::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

Parameters:
conststd::set< const CCopasiObject * > & context (default empty set)
Returns:
const std::set< const CCopasiObject * > & directDependencies

Reimplemented in CParticleReference, and CConcentrationReference.

const std::string & CCopasiObject::getKey ( ) const [virtual]
const CCopasiObject * CCopasiObject::getObject ( const CCopasiObjectName cn) const [virtual]
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]

Retrieve the units of the object.

Returns:
std::string units

Reimplemented in CCopasiContainer.

UpdateMethod * CCopasiObject::getUpdateMethod ( ) const

Reimplemented in COptItem, and CFitItem.

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.

Parameters:
std::set<const CCopasiObject * > & dependencies
std::set<const CCopasiObject * > & verified
conststd::set< const CCopasiObject * > & context
Returns:
bool hasCircularDependencies
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.

Parameters:
constCCopasiObject * lhs
constCCopasiObject * rhs
Returns:
bool isLess
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.

Parameters:
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

Parameters:
constCCopasiObject * pObject
void CCopasiObject::setDirectDependencies ( const std::set< const CCopasiObject * > &  directDependencies)

Set the direct dependencies

Parameters:
conststd::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".

Parameters:
conststd::string & name
Returns:
success
bool CCopasiObject::setObjectParent ( const CCopasiContainer pParent) [virtual]
void CCopasiObject::setObjectValue ( const C_FLOAT64 &  value)
void CCopasiObject::setObjectValue ( const C_INT32 &  value)
void CCopasiObject::setObjectValue ( const bool &  value)
template<class CType >
void CCopasiObject::setRefresh ( CType *  pType,
void(CType::*)(void)  method 
) [inline]
static void CCopasiObject::setRenameHandler ( CRenameHandler rh) [inline, static]
template<class CType >
void CCopasiObject::setUpdateMethod ( CType *  pType,
void(CType::*)(const C_FLOAT64 &)  method 
) [inline]
template<class CType >
void CCopasiObject::setUpdateMethod ( CType *  pType,
void(CType::*)(const C_INT32 &)  method 
) [inline]
template<class CType >
void CCopasiObject::setUpdateMethod ( CType *  pType,
void(CType::*)(const bool &)  method 
) [inline]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CCopasiObject o 
) [friend]

Member Data Documentation

const CRenameHandler * CCopasiObject::smpRenameHandler = NULL [static, protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines