COPASI API  4.16.103
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CCopasiObjectReference< CType > Class Template Reference

#include <CCopasiObject.h>

Inheritance diagram for CCopasiObjectReference< CType >:
Inheritance graph
[legend]
Collaboration diagram for CCopasiObjectReference< CType >:
Collaboration graph
[legend]

Public Types

typedef CType referenceType
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 

Public Member Functions

 CCopasiObjectReference (const std::string &name, const CCopasiContainer *pParent, referenceType &reference, const unsigned C_INT32 &flag=0)
 
 CCopasiObjectReference (const CCopasiObjectReference< referenceType > &src, const CCopasiContainer *pParent)
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual voidgetValuePointer () const
 
virtual void print (std::ostream *ostream) const
 
virtual void setReference (referenceType &reference)
 
virtual ~CCopasiObjectReference ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
virtual const std::string & getKey () const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
virtual std::string getUnits () const
 
UpdateMethodgetUpdateMethod () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
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 &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Member Functions

 CCopasiObjectReference ()
 
template<>
 CCopasiObjectReference (const std::string &name, const CCopasiContainer *pParent, referenceType &reference, const unsigned C_INT32 &flag)
 
template<>
 CCopasiObjectReference (const std::string &name, const CCopasiContainer *pParent, referenceType &reference, const unsigned C_INT32 &flag)
 
void updateMethod (const CType &value)
 

Private Attributes

CType * mpReference
 

Additional Inherited Members

- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

template<class CType>
class CCopasiObjectReference< CType >

Class CCopasiObjectReference

This class is the is used to make an existing object globally accessible.

Copyright Stefan Hoops 2002

Definition at line 43 of file CCopasiObject.h.

Member Typedef Documentation

template<class CType>
typedef CType CCopasiObjectReference< CType >::referenceType

Definition at line 32 of file CCopasiObjectReference.h.

Constructor & Destructor Documentation

template<class CType>
CCopasiObjectReference< CType >::CCopasiObjectReference ( )
inlineprivate

Definition at line 40 of file CCopasiObjectReference.h.

40  :
41  mpReference(NULL)
42  {};
template<class CType>
CCopasiObjectReference< CType >::CCopasiObjectReference ( const std::string &  name,
const CCopasiContainer pParent,
referenceType reference,
const unsigned C_INT32 flag = 0 
)
inline

Definition at line 48 of file CCopasiObjectReference.h.

51  :
52  CCopasiObject(name, pParent, "Reference",
55  flag),
56  mpReference(&reference)
57  {assert(pParent != NULL);}
long int flag
Definition: f2c.h:52
template<class CType>
CCopasiObjectReference< CType >::CCopasiObjectReference ( const CCopasiObjectReference< referenceType > &  src,
const CCopasiContainer pParent 
)
inline

Definition at line 59 of file CCopasiObjectReference.h.

60  :
61  CCopasiObject(src, pParent),
63  {}
template<class CType>
virtual CCopasiObjectReference< CType >::~CCopasiObjectReference ( )
inlinevirtual

Definition at line 65 of file CCopasiObjectReference.h.

65 {}
template<>
CCopasiObjectReference< C_INT32 >::CCopasiObjectReference ( const std::string &  name,
const CCopasiContainer pParent,
referenceType reference,
const unsigned C_INT32 flag 
)
inlineprivate

Definition at line 132 of file CCopasiObjectReference.h.

References CCopasiObject::setUpdateMethod().

135  :
136  CCopasiObject(name, pParent, "Reference",
140  flag),
141  mpReference(&reference)
142 {
143  assert(pParent != NULL);
145 }
void setUpdateMethod(CType *pType, void(CType::*method)(const C_FLOAT64 &))
long int flag
Definition: f2c.h:52
template<>
CCopasiObjectReference< bool >::CCopasiObjectReference ( const std::string &  name,
const CCopasiContainer pParent,
referenceType reference,
const unsigned C_INT32 flag 
)
inlineprivate

Definition at line 148 of file CCopasiObjectReference.h.

References CCopasiObject::setUpdateMethod().

151  :
152  CCopasiObject(name, pParent, "Reference",
156  flag),
157  mpReference(&reference)
158 {
159  assert(pParent != NULL);
161 }
void setUpdateMethod(CType *pType, void(CType::*method)(const C_FLOAT64 &))
long int flag
Definition: f2c.h:52

Member Function Documentation

template<class CType>
virtual std::string CCopasiObjectReference< CType >::getObjectDisplayName ( bool  regular = true,
bool  richtext = false 
) const
inlinevirtual

Reimplemented from CCopasiObject.

Definition at line 77 of file CCopasiObjectReference.h.

Referenced by findObjectByDisplayName().

78  {
79  //Suppress "Value"
80  if (getObjectParent() && getObjectName() == "Value")
81  return getObjectParent()->getObjectDisplayName(regular, richtext);
82 
83  //special treatment of metab children
84  if (getObjectParent()->getObjectType() == "Metabolite")
85  {
86  if (getObjectName() == "Concentration")
87  {
88  if (richtext)
89  {
90  return "<font color=\"#2222cc\">[</font>"
91  + getObjectParent()->getObjectDisplayName(regular, richtext)
92  + "<font color=\"#2222cc\">]</font>";
93  }
94  else
95  {return "[" + getObjectParent()->getObjectDisplayName(regular, richtext) + "]";}
96  }
97 
98  if (getObjectName() == "InitialConcentration")
99  {
100  if (richtext)
101  {
102  return "<font color=\"#2222cc\">[</font>"
103  + getObjectParent()->getObjectDisplayName(regular, richtext)
104  + "<font color=\"#2222cc\">]<sub>0</sub></font>";
105  }
106  else
107  {return "[" + getObjectParent()->getObjectDisplayName(regular, richtext) + "]_0";}
108  }
109  }
110 
111  return CCopasiObject::getObjectDisplayName(regular, richtext);
112  }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
const std::string & getObjectName() const
const std::string & getObjectType() const
CCopasiContainer * getObjectParent() const
template<class CType>
virtual const CCopasiObject* CCopasiObjectReference< CType >::getValueObject ( ) const
inlinevirtual

Reimplemented from CCopasiObject.

Definition at line 69 of file CCopasiObjectReference.h.

69 {return this;}
template<class CType>
virtual void* CCopasiObjectReference< CType >::getValuePointer ( ) const
inlinevirtual

Retrieve a pointer to the value of the object

Reimplemented from CCopasiObject.

Definition at line 67 of file CCopasiObjectReference.h.

Referenced by CMetab::initObjects().

template<class CType>
virtual void CCopasiObjectReference< CType >::print ( std::ostream *  ostream) const
inlinevirtual

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 from CCopasiObject.

Definition at line 74 of file CCopasiObjectReference.h.

75  {(*ostream) << *mpReference;};
template<class CType>
virtual void CCopasiObjectReference< CType >::setReference ( referenceType reference)
inlinevirtual

Definition at line 71 of file CCopasiObjectReference.h.

Referenced by CModelEntity::setInitialValuePtr(), and CModelEntity::setValuePtr().

72  {mpReference = &reference;}
template<class CType>
void CCopasiObjectReference< CType >::updateMethod ( const CType &  value)
inlineprivate

Definition at line 44 of file CCopasiObjectReference.h.

45  {*mpReference = value;}

Member Data Documentation

template<class CType>
CType* CCopasiObjectReference< CType >::mpReference
private

The documentation for this class was generated from the following files: