COPASI API  4.40.278
CMoiety Class Reference

#include <CMoiety.h>

Inheritance diagram for CMoiety:
[legend]

Public Member Functions

void add (C_FLOAT64 value, CMetab *metabolite)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
void cleanup ()
 
 CMoiety (const CMoiety &src, const CDataContainer *pParent)
 
 CMoiety (const std::string &name="NoName", const CDataContainer *pParent=NO_PARENT)
 
const C_FLOAT64dependentNumber ()
 
const C_FLOAT64getAmount () const
 
const C_FLOAT64getDependentNumber () const
 
CDataObjectgetDependentNumberReference () const
 
std::string getDescription (const CModel *model) const
 
const std::vector< std::pair< C_FLOAT64, CMetab * > > & getEquation () const
 
std::string getExpression () const
 
CDataObjectgetInitialTotalNumberReference () const
 
CDataObjectgetInitialValueReference () const
 
virtual const std::string & getKey () const
 
C_FLOAT64 getNumber () const
 
CDataObjectgetTotalNumberReference () const
 
CDataObjectgetValueReference () const
 
void refreshAmount ()
 
void refreshDependentNumber ()
 
void refreshInitialValue ()
 
void refreshValue ()
 
virtual bool setObjectParent (const CDataContainer *pParent)
 
virtual CData toData () const
 
 ~CMoiety ()
 
- 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)
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const
 
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 const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const override
 
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
 
virtual void * getValuePointer () 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 ()
 

Static Public Member Functions

static CMoietyfromData (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 *)
 

Private Member Functions

void initConversionFactor ()
 
void initObjects ()
 

Private Attributes

std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
 
C_FLOAT64 mIAmount
 
C_FLOAT64 mINumber
 
std::string mKey
 
C_FLOAT64 mNumber
 
const C_FLOAT64mpConversionFactor
 
CDependentNumberReferencempDNumberReference
 
CTotalNumberReferencempINumberReference
 
CTotalNumberReferencempNumberReference
 

Static Private Attributes

static const C_FLOAT64 DefaultFactor
 

Additional Inherited Members

- 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
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 
- 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)
 
- 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
 

Constructor & Destructor Documentation

◆ CMoiety() [1/2]

CMoiety::CMoiety ( 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, and initObjects().

Referenced by fromData().

◆ CMoiety() [2/2]

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

Copy constructor

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

References CONSTRUCTOR_TRACE, and initObjects().

◆ ~CMoiety()

CMoiety::~CMoiety ( )

Member Function Documentation

◆ add()

void CMoiety::add ( C_FLOAT64  value,
CMetab metabolite 
)

Add a metabolite to a moiety

Parameters
C_FLOAT64value
CMetab* metabolite

References mEquation, and CMetab::setDependsOnMoiety().

Referenced by CModel::buildMoieties().

◆ applyData()

bool CMoiety::applyData ( const CData data,
CUndoData::CChangeSet changes 
)
virtual

Apply the provided data to the object

Parameters
constCData & data
Returns
bool success

Reimplemented from CDataContainer.

References fatalError.

◆ cleanup()

void CMoiety::cleanup ( )

References mEquation.

◆ dependentNumber()

const C_FLOAT64 & CMoiety::dependentNumber ( )

Retrieve and refresh the dependent number;

Returns
const C_FLOAT64 & dependentNumber

References mNumber, and refreshDependentNumber().

◆ fromData()

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

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CMoiety * pDataObject

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

◆ getAmount()

const C_FLOAT64 & CMoiety::getAmount ( ) const

Retrieve the total amount

Returns
const C_FLOAT64 & amount

References mIAmount.

◆ getDependentNumber()

const C_FLOAT64 & CMoiety::getDependentNumber ( ) const

Retrieve the dependent number;

Returns
const C_FLOAT64 & dependentNumber

References mNumber.

Referenced by CMetab::calculate().

◆ getDependentNumberReference()

CDataObject * CMoiety::getDependentNumberReference ( ) const

Retrieve the object for the dependent particle number

Returns
CDataObject * dependentNumberReference

References mpDNumberReference.

Referenced by CMathObject::compileValue().

◆ getDescription()

std::string CMoiety::getDescription ( const CModel model) const

get the string representation of the moiety using the CMetabNameInterface

References CMetabNameInterface::getDisplayName(), and mEquation.

◆ getEquation()

const std::vector< std::pair< C_FLOAT64, CMetab * > > & CMoiety::getEquation ( ) const

Retrieve the components of the total mass equation

Returns
const std::vector<std::pair< C_FLOAT64, CMetab * > > & equation

References mEquation.

Referenced by CMathObject::compileDependentMass(), and CMathObject::compileTotalMass().

◆ getExpression()

std::string CMoiety::getExpression ( ) const

Retrieve the infix expression, which can be used to calculate the total amount.

Returns
std::string expression

References mEquation.

◆ getInitialTotalNumberReference()

CDataObject * CMoiety::getInitialTotalNumberReference ( ) const

Retrieve the object for the initial total particle number

Returns
CDataObject * initialTotalNumberReference

References mpINumberReference.

◆ getInitialValueReference()

CDataObject * CMoiety::getInitialValueReference ( ) const

Retrieve the object for the total particle number

Returns
CDataObject * initialValueReference

References mpINumberReference.

◆ getKey()

const std::string & CMoiety::getKey ( ) const
virtual

Returns a string with the name of this compartment.

Returns
std::string key

Reimplemented from CDataObject.

References mKey.

◆ getNumber()

C_FLOAT64 CMoiety::getNumber ( ) const

References mINumber.

◆ getTotalNumberReference()

CDataObject * CMoiety::getTotalNumberReference ( ) const

Retrieve the object for the total particle number

Returns
CDataObject * totalNumberReference

References mpNumberReference.

Referenced by CMathObject::compileDependentMass().

◆ getValueReference()

CDataObject * CMoiety::getValueReference ( ) const

Retrieve the object for the total particle number

Returns
CDataObject * valueReference

References mpNumberReference.

◆ initConversionFactor()

void CMoiety::initConversionFactor ( )
private

Initialize the number to amount conversion factor

References DefaultFactor, CModel::getNumber2QuantityFactor(), CDataObject::getObjectAncestor(), and mpConversionFactor.

Referenced by setObjectParent().

◆ initObjects()

void CMoiety::initObjects ( )
private

◆ refreshAmount()

void CMoiety::refreshAmount ( )

Refresh the total amount

References mIAmount, mINumber, and mpConversionFactor.

◆ refreshDependentNumber()

void CMoiety::refreshDependentNumber ( )

Refreshes the value of the dependent number

References mEquation, mINumber, and mNumber.

Referenced by dependentNumber().

◆ refreshInitialValue()

void CMoiety::refreshInitialValue ( )

Refresh the initial total particle number

References mEquation, and mINumber.

◆ refreshValue()

void CMoiety::refreshValue ( )

Refresh the total particle number

References mEquation, and mINumber.

◆ setObjectParent()

bool CMoiety::setObjectParent ( const CDataContainer pParent)
virtual

Sets the parent of the moiety;

Parameters
constCDataContainer * pParent
Returns
bool success

Reimplemented from CDataObject.

References initConversionFactor(), and CDataObject::setObjectParent().

◆ toData()

CData CMoiety::toData ( ) const
virtual

Retrieve the data describing the object

Returns
CData data

Reimplemented from CDataContainer.

References fatalError.

Member Data Documentation

◆ DefaultFactor

const C_FLOAT64 CMoiety::DefaultFactor
staticprivate

The default conversion factor used if the moiety is not part of a model

Referenced by initConversionFactor().

◆ mEquation

std::vector<std::pair< C_FLOAT64, CMetab * > > CMoiety::mEquation
private

Vector of linear dependent CChemEqElement @supplierCardinality 0..*

Referenced by add(), cleanup(), getDescription(), getEquation(), getExpression(), refreshDependentNumber(), refreshInitialValue(), and refreshValue().

◆ mIAmount

C_FLOAT64 CMoiety::mIAmount
private

The total Amount of the Moiety.

Referenced by getAmount(), initObjects(), and refreshAmount().

◆ mINumber

C_FLOAT64 CMoiety::mINumber
private

Initial Number of Particles of Moiety.

Referenced by getNumber(), initObjects(), refreshAmount(), refreshDependentNumber(), refreshInitialValue(), and refreshValue().

◆ mKey

std::string CMoiety::mKey
private

The key of the moiety

Referenced by getKey(), and ~CMoiety().

◆ mNumber

C_FLOAT64 CMoiety::mNumber
private

Number of Particles of Moiety.

Referenced by dependentNumber(), getDependentNumber(), initObjects(), and refreshDependentNumber().

◆ mpConversionFactor

const C_FLOAT64* CMoiety::mpConversionFactor
private

A pointer to the conversion factor between the particle number and the amount.

Referenced by initConversionFactor(), and refreshAmount().

◆ mpDNumberReference

CDependentNumberReference* CMoiety::mpDNumberReference
private

A pointer to the object for the dependent particle number

Referenced by getDependentNumberReference(), and initObjects().

◆ mpINumberReference

CTotalNumberReference* CMoiety::mpINumberReference
private

A pointer to the object for the initial total particle number

Referenced by getInitialTotalNumberReference(), getInitialValueReference(), and initObjects().

◆ mpNumberReference

CTotalNumberReference* CMoiety::mpNumberReference
private

A pointer to the object for the total particle number This is used during events

Referenced by getTotalNumberReference(), getValueReference(), and initObjects().


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