COPASI API  4.40.278
CCompartment Class Reference

#include <CCompartment.h>

Inheritance diagram for CCompartment:
[legend]

Public Member Functions

bool addMetabolite (CMetab *metabolite)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
 CCompartment (const CCompartment &src, const CDataContainer *pParent)
 
 CCompartment (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT)
 
void cleanup ()
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
unsigned C_INT32 getDimensionality () const
 
CDataVectorNS< CMetab > & getMetabolites ()
 
const CDataVectorNS< CMetab > & getMetabolites () const
 
virtual const std::string getUnits () const
 
C_INT32 load (CReadConfig &configbuffer)
 
bool setDimensionality (unsigned C_INT32 dim)
 
virtual CData toData () const
 
virtual ~CCompartment ()
 
- Public Member Functions inherited from CModelEntity
virtual void calculate ()
 
 CModelEntity (const CModelEntity &src, const CDataContainer *pParent)
 
 CModelEntity (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT, const std::string &type="ModelEntity", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
virtual CIssue compile ()
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const override
 
std::string getDefaultNoiseExpression () const
 
std::string getExpression () const
 
CExpressiongetExpressionPtr ()
 
const CExpressiongetExpressionPtr () const
 
std::string getInitialExpression () const
 
CExpressiongetInitialExpressionPtr ()
 
const CExpressiongetInitialExpressionPtr () const
 
const C_FLOAT64getInitialValue () const
 
CDataObjectgetInitialValueReference () const
 
virtual const std::string & getKey () const override
 
CModelgetModel () const
 
std::string getNoiseExpression () const
 
CExpressiongetNoiseExpressionPtr ()
 
const CExpressiongetNoiseExpressionPtr () const
 
CDataObjectgetNoiseReference () const
 
const C_FLOAT64getRate () const
 
CDataObjectgetRateReference () const
 
const std::string & getSBMLId () const
 
const CModelEntity::StatusgetStatus () const
 
virtual const std::string & getUnitExpression () const
 
const C_FLOAT64getValue () const
 
virtual const CDataObjectgetValueObject () const override
 
virtual void * getValuePointer () const override
 
CDataObjectgetValueReference () const
 
const bool & hasNoise () const
 
bool isFixed () const
 
const bool & isUsed () const
 
CIssue setExpression (const std::string &expression)
 
bool setExpressionPtr (CExpression *pExpression)
 
void setHasNoise (const bool &hasNoise)
 
CIssue setInitialExpression (const std::string &expression)
 
bool setInitialExpressionPtr (CExpression *pExpression)
 
virtual void setInitialValue (const C_FLOAT64 &initialValue)
 
bool setNoiseExpression (const std::string &expression)
 
bool setNoiseExpressionPtr (CExpression *pExpression)
 
virtual bool setObjectParent (const CDataContainer *pParent) override
 
void setRate (const C_FLOAT64 &rate)
 
void setSBMLId (const std::string &id) const
 
bool setStatus (const CModelEntity::Status &status)
 
virtual CIssue setUnitExpression (std::string unitExpression)
 
void setUsed (const bool &used)
 
virtual void setValue (const C_FLOAT64 &value)
 
 ~CModelEntity ()
 
- Public Member Functions inherited from CDataContainer
virtual bool add (CDataObject *pObject, const bool &adopt=true)
 
virtual bool appendDeletedDependentData (CUndoData &undoData) const
 
 CDataContainer (const CDataContainer &src, const CDataContainer *pParent)
 
 CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
void getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const
 
virtual size_t getIndex (const CDataObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const override
 
virtual objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual CUndoObjectInterfaceinsert (const CData &data) override
 
void objectRenamed (CDataObject *pObject, const std::string &oldName)
 
virtual bool remove (CDataObject *pObject)
 
virtual ~CDataContainer ()
 
- Public Member Functions inherited from CDataObject
void addIssue (const CIssue &issue)
 
void addReference (const CDataContainer *pReference)
 
virtual void calculateValue () override
 
 CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL)
 
virtual void destruct () override
 
virtual CCommonName getCN () const override
 
virtual const CDataObjectgetDataObject () const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName () const override
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const CValiditygetValidity () const override
 
bool hasFlag (const Flag &flag) const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override
 
bool prerequisitsContains (const DataObjectSet &objects) const
 
virtual void print (std::ostream *ostream) const override
 
void removeIssue (const CIssue &issue)
 
void removeReference (const CDataContainer *pReference)
 
bool setObjectName (const std::string &name)
 
void validityChanged (const CValidity &changedValidity) override
 
void validityRemoved (const CValidity &changedValidity)
 
virtual ~CDataObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
 CObjectInterface (const CObjectInterface &src)
 
virtual ~CObjectInterface ()
 
- Public Member Functions inherited from CUndoObjectInterface
 CUndoObjectInterface ()
 
 CUndoObjectInterface (const CUndoObjectInterface &src)
 
bool generateUuid ()
 
const xg::Guid & getUuid () const
 
bool setUuid (const std::string &uuid)
 
bool setUuid (const xg::Guid &uuid)
 
virtual void updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject)
 
virtual ~CUndoObjectInterface ()
 
- Public Member Functions inherited from CAnnotation
bool addUnsupportedAnnotation (const std::string &name, const std::string &xml)
 
bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
 CAnnotation ()
 
 CAnnotation (const CAnnotation &src)
 
void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
const std::string & getMiriamAnnotation () const
 
const std::string & getNotes () const
 
UnsupportedAnnotationgetUnsupportedAnnotations ()
 
const UnsupportedAnnotationgetUnsupportedAnnotations () const
 
void initMiriamAnnotation (const std::string &newId)
 
bool operator== (const CAnnotation &rhs) const
 
bool removeUnsupportedAnnotation (const std::string &name)
 
bool replaceUnsupportedAnnotation (const std::string &name, const std::string &xml)
 
void setMiriamAnnotation (const std::string &miriamAnnotation, const std::string &newId, const std::string &oldId)
 
void setNotes (const std::string &notes)
 
CData toData () const
 
virtual ~CAnnotation ()
 

Static Public Member Functions

static CCompartmentfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CModelEntity
static CModelEntityfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataContainer
static CDataContainerfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName)
 
- Static Public Member Functions inherited from CUndoObjectInterface
template<class CType >
static CType * fromData (const CData &, CUndoObjectInterface *)
 
- Static Public Member Functions inherited from CAnnotation
static CMIRIAMInfoallocateMiriamInfo (CDataContainer *pParent)
 
static CAnnotationcastObject (CDataObject *pObject)
 
static const CAnnotationcastObject (const CDataObject *pObject)
 
static void freeMiriamInfo (CDataContainer *pParent)
 

Protected Attributes

unsigned C_INT32 mDimensionality
 
- Protected Attributes inherited from CModelEntity
bool mHasNoise
 
C_FLOAT64 mIValue
 
C_FLOAT64 mNoise
 
CExpressionmpExpression
 
CExpressionmpInitialExpression
 
CDataObjectReference< C_FLOAT64 > * mpIValueReference
 
CModelmpModel
 
CExpressionmpNoiseExpression
 
CDataObjectReference< C_FLOAT64 > * mpNoiseReference
 
CDataObjectReference< C_FLOAT64 > * mpRateReference
 
CDataObjectReference< C_FLOAT64 > * mpValueReference
 
C_FLOAT64 mRate
 
std::string mSBMLId
 
std::string mUnitExpression
 
C_FLOAT64 mValue
 
- Protected Attributes inherited from CDataContainer
objectMap mObjects
 
- Protected Attributes inherited from CDataObject
ObjectSet mPrerequisits
 
std::set< CDataContainer * > mReferences
 
- Protected Attributes inherited from CObjectInterface
CValidity mValidity
 
- Protected Attributes inherited from CAnnotation
std::string mKey
 

Private Member Functions

void initObjects ()
 

Private Attributes

CDataVectorNS< CMetabmMetabolites
 

Friends

std::ostream & operator<< (std::ostream &os, const CCompartment &d)
 

Additional Inherited Members

- Public Types inherited from CModelEntity
enum class  Status {
  FIXED = 0 , ASSIGNMENT , REACTIONS , ODE ,
  TIME , __SIZE
}
 
- Public Types inherited from CDataContainer
typedef CDataObjectMap objectMap
 
- Public Types inherited from CDataObject
typedef std::set< const CDataObject * > DataObjectSet
 
enum  Flag {
  Container , Vector , Matrix , NameVector ,
  Reference , ValueBool , ValueInt , ValueInt64 ,
  ValueDbl , NonUniqueName , StaticString , ValueString ,
  Separator , DisplayName , ModelEntity , Array ,
  DataModel , Root , Gui , __SIZE
}
 
- Public Types inherited from CObjectInterface
typedef std::vector< const CDataContainer * > ContainerList
 
typedef std::set< const CObjectInterface * > ObjectSet
 
- Public Types inherited from CAnnotation
typedef std::map< std::string, std::string > UnsupportedAnnotation
 
- Static Public Attributes inherited from CModelEntity
static const CEnumAnnotation< std::string, StatusStatusName
 
static const CEnumAnnotation< std::string, StatusXMLStatus
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 
- Protected Member Functions inherited from CModelEntity
 CModelEntity (const CModelEntity &src)
 
- Protected Member Functions inherited from CDataContainer
template<class CType >
CDataMatrixReference< CType > * addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataObjectReference< CType > * addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataVectorReference< CType > * addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
 CDataContainer (const CDataContainer &src)
 
void initObjects ()
 
- Protected Member Functions inherited from CDataObject
 CDataObject ()
 
 CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 

Constructor & Destructor Documentation

◆ CCompartment() [1/2]

CCompartment::CCompartment ( const std::string &  name = "NoName",
const CDataContainer pParent = NO_PARENT 
)

Default constructor.

Parameters
conststd::string & name (default: "NoName")
constCDataContainer * pParent (default: NULL)

References CONSTRUCTOR_TRACE, CModelEntity::FIXED, initObjects(), CModelEntity::mIValue, and CModelEntity::setStatus().

Referenced by fromData().

◆ CCompartment() [2/2]

CCompartment::CCompartment ( const CCompartment src,
const CDataContainer pParent 
)

Copy constructor.

Parameters
const CCompartment &src
constCDataContainer * pParent (default: NULL)

References CONSTRUCTOR_TRACE, and initObjects().

◆ ~CCompartment()

CCompartment::~CCompartment ( )
virtual

Destructor. The destructor does nothing.

References DESTRUCTOR_TRACE, CRootContainer::getKeyFactory(), CAnnotation::mKey, and CKeyFactory::remove().

Member Function Documentation

◆ addMetabolite()

bool CCompartment::addMetabolite ( CMetab metabolite)

Adds a metabolite to the compartment. Only the concentration is taken from the metabolite, the number of particles is calculated according to the volume of the compartment

Parameters
CMetab* metabolite;
Returns
bool success

References CDataVectorN< CType >::add(), CDataObject::getCN(), CDataObject::getObjectParent(), CRegisteredCommonName::handle(), and mMetabolites.

Referenced by MetaboliteHandler::processStart(), CModelExpansion::replaceInMetab(), and CMetab::setCompartment().

◆ applyData()

◆ cleanup()

void CCompartment::cleanup ( )

◆ createUndoData()

void CCompartment::createUndoData ( CUndoData undoData,
const CUndoData::Type type,
const CData oldData = CData(),
const CCore::Framework framework = CCore::Framework::ParticleNumbers 
) const
virtual

Create the undo data which represents the changes recording the differences between the provided oldData and the current data.

Parameters
CUndoData& undoData
constCUndoData::Type & type
constCData & oldData (default: empty data)
constCCore::Framework & framework (default: CCore::Framework::ParticleNumbers)
Returns
CUndoData undoData

Reimplemented from CModelEntity.

References CUndoData::addProperty(), CData::addProperty(), CUndoData::CHANGE, CModelEntity::createUndoData(), CData::FRAMEWORK, CCore::FrameworkNames, CData::getProperty(), CData::INITIAL_VALUE, mDimensionality, CModelEntity::mIValue, CData::SPATIAL_DIMENSION, CDataValue::toData(), and CData::VALUE.

◆ fromData()

CCompartment * CCompartment::fromData ( const CData data,
CUndoObjectInterface pParent 
)
static

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CCompartment * pDataObject

References CCompartment(), CData::getProperty(), NO_PARENT, CData::OBJECT_NAME, and CDataValue::toString().

◆ getDimensionality()

◆ getMetabolites() [1/2]

CDataVectorNS< CMetab > & CCompartment::getMetabolites ( )

Retrieve the vector of contained metabolites

Returns
CDataVectorNS < CMetab > & metabolites

References mMetabolites.

Referenced by SBMLImporter::createCMetabFromSpecies(), CMetabNameInterface::getMetabolite(), CModelExpansion::replaceInMetab(), and CMetab::setCompartment().

◆ getMetabolites() [2/2]

const CDataVectorNS< CMetab > & CCompartment::getMetabolites ( ) const

Retrieve the vector of contained metabolites

Returns
const CDataVectorNS < CMetab > & metabolites

References mMetabolites.

◆ getUnits()

const std::string CCompartment::getUnits ( ) const
virtual

◆ initObjects()

void CCompartment::initObjects ( )
private

Initialize the contained CDataObjects

References CModelEntity::mpIValueReference, CModelEntity::mpValueReference, and CDataObject::setObjectName().

Referenced by CCompartment().

◆ load()

C_INT32 CCompartment::load ( CReadConfig configbuffer)

Loads an object with data coming from a CReadConfig object. (CReadConfig object reads an input stream)

Parameters
pconfigbufferreference to a CReadConfig object.
Returns
mFail
See also
mFail

References C_FLOAT64, C_INT32, CReadConfig::getVariable(), CReadConfig::SEARCH, CModelEntity::setInitialValue(), and CDataObject::setObjectName().

◆ setDimensionality()

bool CCompartment::setDimensionality ( unsigned C_INT32  dim)

Set the dimensionality of the compartment. May be 0, 1, 2, or 3. If the value is not valid it will be ignored and the return value will be false

References mDimensionality.

Referenced by CModelAdd::addCompartments(), applyData(), SBMLImporter::createCCompartmentFromCompartment(), CModelExpansion::duplicateCompartment(), and CompartmentHandler::processStart().

◆ toData()

CData CCompartment::toData ( ) const
virtual

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CCompartment d 
)
friend

Friend declaration for ostream operator <<

Parameters
std::ostream& os
constCCompartment & d
Returns
std::ostream & os

Member Data Documentation

◆ mDimensionality

unsigned C_INT32 CCompartment::mDimensionality
protected

The dimensionality of the compartment. Can be 0, 1, 2, or 3

Referenced by createUndoData(), getDimensionality(), getUnits(), setDimensionality(), and toData().

◆ mMetabolites

CDataVectorNS< CMetab > CCompartment::mMetabolites
private

Metabolites located in the compartment. @supplierCardinality 0..* @associates <{CMetab}>

Referenced by addMetabolite(), cleanup(), and getMetabolites().


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