COPASI API  4.40.278
CRootContainer Class Reference

#include <CRootContainer.h>

Inheritance diagram for CRootContainer:
[legend]

Public Member Functions

virtual ~CRootContainer ()
 
- Public Member Functions inherited from CDataContainer
virtual bool add (CDataObject *pObject, const bool &adopt=true)
 
virtual bool appendDeletedDependentData (CUndoData &undoData) const
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes) override
 
 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 CData toData () const override
 
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
 
virtual const std::string & getKey () const
 
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)
 
virtual bool setObjectParent (const CDataContainer *pParent)
 
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 CDataModeladdDatamodel ()
 
static void destroy ()
 
static void functionDefinitionChanged (const CFunction *pFunction)
 
static CConfigurationFilegetConfiguration ()
 
static CDataVector< CDataModel > * getDatamodelList ()
 
static CFunctionDBgetFunctionList ()
 
static CKeyFactorygetKeyFactory ()
 
static const char * getLicenseHTML ()
 
static const char * getLicenseTxt ()
 
static const CDataContainergetRoot ()
 
static CFunctiongetUndefinedFunction ()
 
static const CUnitDefinitiongetUnitDefFromSymbol (const std::string symbol)
 
static CUnitDefinitionDBgetUnitList ()
 
static const CMIRIAMResourcegetUnknownMiriamResource ()
 
static void init (int argc, char *argv[], const bool &withGui=false)
 
static std::string quoteUnitDefSymbol (const std::string &symbol)
 
static bool removeDatamodel (const CDataModel *pDatamodel)
 
static bool removeDatamodel (const unsigned C_INT32 index)
 
static void replaceSymbol (const std::string &oldSymbol, const std::string &newSymbol)
 
- 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 *)
 

Protected Attributes

CKeyFactory mKeyFactory
 
CConfigurationFilempConfiguration
 
CDataVector< CDataModel > * mpDataModelList
 
CFunctionDBmpFunctionList
 
CFunctionmpUndefined
 
CUnitDefinitionDBmpUnitDefinitionList
 
CMIRIAMResourcempUnknownResource
 
bool mWithGUI
 
- 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
 

Private Member Functions

 CRootContainer (const bool &withGUI=false)
 
 CRootContainer (const CRootContainer &src)
 
void initializeChildren ()
 
CRootContaineroperator= (const CRootContainer &src)
 

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)
 

Detailed Description

This is the new root container class. It will hold some attributes that are used by all datamodels, e.g.the global function database and the configuration, and it will hold a list of datamodels. Currently all methods to create new instances of CRootContainer are declared private. This ensures that there can be only one root container which is initialized by the init method. If this is necessary or not needs to be discussed.

Constructor & Destructor Documentation

◆ CRootContainer() [1/2]

CRootContainer::CRootContainer ( const bool &  withGUI = false)
private

The default constructor should be private so that nobody can create new instances of the root container. The only way to create a root container is through the static init method. Maybe this restriction is not necessary. We have to discuss this later.

The default constructor should be private so that nobody can create new instances of the root container. The only way to create a root container is through the static init method.

Referenced by init().

◆ CRootContainer() [2/2]

CRootContainer::CRootContainer ( const CRootContainer src)
private

The copy constructor is private as well to make sure that there is only one root container that can be initialized through the init call.

Parameters
constCRootContainer & src

◆ ~CRootContainer()

Member Function Documentation

◆ addDatamodel()

CDataModel * CRootContainer::addDatamodel ( )
static

◆ destroy()

◆ functionDefinitionChanged()

void CRootContainer::functionDefinitionChanged ( const CFunction pFunction)
static

◆ getConfiguration()

◆ getDatamodelList()

CDataVector< CDataModel > * CRootContainer::getDatamodelList ( )
static

◆ getFunctionList()

CFunctionDB * CRootContainer::getFunctionList ( )
static

Returns a pointer to the global function database.

References mpFunctionList, and pRootContainer.

Referenced by CCopasiXML::buildFunctionList(), CEvaluationNodeCall::calls(), CSBMLExporter::checkForPiecewiseFunctions(), CSBMLExporter::collectIds(), CEvaluationNodeCall::compile(), CFunction::completeFunctionList(), CModel::convert2NonReversible(), SBMLImporter::createCFunctionFromFunctionDefinition(), SBMLImporter::createCModelFromSBMLDocument(), SBMLImporter::createCReactionFromReaction(), CSBMLExporter::createEvent(), CSBMLExporter::createFunctionDefinitions(), CReaction::createFunctionFromExpression(), CSBMLExporter::createInitialAssignment(), CSBMLExporter::createRule(), COptProblem::elevateChildren(), CSBMLExporter::exportEventAssignments(), CODEExporter::exportSingleFunction(), CODEExporterC::exportSingleFunction(), SBMLImporter::findCorrespondingFunction(), SBMLImporter::findFunctionCalls(), CODEExporter::findFunctionsCalls(), CEvaluationNodeCall::getCalledTree(), CReactionInterface::getListOfPossibleFunctions(), CEvaluationTree::getNodeObject(), SBMLImporter::isConstantFlux(), CModel::load(), CDataModel::loadModel(), CODEExporter::modifyTreeForMassAction(), CDataModel::removeSBMLIdFromFunctions(), SBMLImporter::removeUnusedFunctions(), SBMLImporter::restoreFunctionDB(), CODEExporterC::setExportNameOfFunction(), CReaction::setFunction(), CReactionInterface::setFunctionAndDoMapping(), CReaction::setFunctionFromExpressionTree(), CSBMLExporter::setFunctionSBMLIds(), CReactionInterface::setFunctionWithEmptyMapping(), and CEvaluationNodeCall::toAST().

◆ getKeyFactory()

CKeyFactory * CRootContainer::getKeyFactory ( )
static

Returns a pointer to the KeyFactory.

References mKeyFactory, and pRootContainer.

Referenced by CModelAdd::addCompartmentsExpressions(), CModelAdd::addMetabolitesExpressions(), CModelAdd::addModelValuesExpressions(), CModel::applyActiveParameterSet(), CEvent::CEvent(), CEventAssignment::CEventAssignment(), CFunction::CFunction(), CLColorDefinition::CLColorDefinition(), COutputDefinitionVector::cleanup(), CReportDefinition::cleanup(), CReportDefinitionVector::cleanup(), CLEllipse::CLEllipse(), CLGlobalRenderInformation::CLGlobalRenderInformation(), CLGlobalStyle::CLGlobalStyle(), CLGradientStop::CLGradientStop(), CLGroup::CLGroup(), CLImage::CLImage(), CLLinearGradient::CLLinearGradient(), CLLineEnding::CLLineEnding(), CLLocalRenderInformation::CLLocalRenderInformation(), CLLocalStyle::CLLocalStyle(), CLPolygon::CLPolygon(), CLRadialGradient::CLRadialGradient(), CLRectangle::CLRectangle(), CLRenderCurve::CLRenderCurve(), CLText::CLText(), CModelEntity::CModelEntity(), CModelExpansion::SetOfModelElements::contains(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CReaction::CReaction(), CUnitDefinition::CUnitDefinition(), CEvent::deleteAssignment(), CModelExpansion::ElementsMap::exists(), CODEExporterC::exportTitleData(), CFitItem::getCrossValidations(), CMetabNameInterface::getDisplayName(), CFitItem::getExperiments(), CLTextGlyph::getGraphicalObject(), CLMetabReferenceGlyph::getMetabGlyph(), CChemEqElement::getMetabolite(), CLGraphicalObject::getModelObject(), CTimeSeries::getSBMLId(), CLNAProblem::getSubTask(), CMCAProblem::getSubTask(), CLReferenceGlyph::getTargetGlyph(), CLGraphicalObject::hasValidModelReference(), CExperiment::initializeParameter(), CExperimentSet::keyToIndex(), CModelMerging::mergeInExpression(), SBMLDocumentLoader::postprocessTextGlyph(), CFitProblem::printResult(), COPASIHandler::processEnd(), CModel::removeCompartment(), CModel::removeEvent(), CFunctionDB::removeFunction(), CDataModel::removeLayout(), CModel::removeLocalReactionParameter(), CModel::removeMetabolite(), CModel::removeModelValue(), COutputDefinitionVector::removePlotSpec(), CModel::removeReaction(), CReportDefinitionVector::removeReportDefinition(), CSlider::setAssociatedEntityKey(), CChemEqElement::setMetabolite(), CUnitDefinition::setup(), CMMLOutput::writeDifferentialEquations(), CAnnotation::~CAnnotation(), CBiologicalDescription::~CBiologicalDescription(), CCompartment::~CCompartment(), CCopasiParameter::~CCopasiParameter(), CCopasiTask::~CCopasiTask(), CCreator::~CCreator(), CEvent::~CEvent(), CFunction::~CFunction(), CFunctionParameter::~CFunctionParameter(), CLayout::~CLayout(), CLColorDefinition::~CLColorDefinition(), CLEllipse::~CLEllipse(), CLGradientBase::~CLGradientBase(), CLGraphicalObject::~CLGraphicalObject(), CLGroup::~CLGroup(), CLImage::~CLImage(), CListOfLayouts::~CListOfLayouts(), CLPolygon::~CLPolygon(), CLRectangle::~CLRectangle(), CLRenderCurve::~CLRenderCurve(), CLRenderInformationBase::~CLRenderInformationBase(), CLStyle::~CLStyle(), CLText::~CLText(), CMetab::~CMetab(), CModel::~CModel(), CModelParameterSet::~CModelParameterSet(), CModification::~CModification(), CMoiety::~CMoiety(), CReaction::~CReaction(), CReference::~CReference(), CSlider::~CSlider(), and CUnitDefinition::~CUnitDefinition().

◆ getLicenseHTML()

const char * CRootContainer::getLicenseHTML ( )
static

References CopasiLicenseHtml.

◆ getLicenseTxt()

const char * CRootContainer::getLicenseTxt ( )
static

References CopasiLicenseTxt.

◆ getRoot()

◆ getUndefinedFunction()

CFunction * CRootContainer::getUndefinedFunction ( )
static

◆ getUnitDefFromSymbol()

const CUnitDefinition * CRootContainer::getUnitDefFromSymbol ( const std::string  symbol)
static

◆ getUnitList()

◆ getUnknownMiriamResource()

const CMIRIAMResource & CRootContainer::getUnknownMiriamResource ( )
static

◆ init()

void CRootContainer::init ( int  argc,
char *  argv[],
const bool &  withGUI = false 
)
static

◆ initializeChildren()

void CRootContainer::initializeChildren ( )
private

This method needs to be called after a new root container is constructed. Since many of the children of the root container need to access the key factory through the global Root instance, the global root instance need to be created before the children can be initialized. Calling this Method initializes the children. This method must be protected since it can only be called once by the global init method.

References CEvaluationTree::compile(), CConfigurationFile::load(), CFunctionDB::load(), mpConfiguration, mpDataModelList, mpFunctionList, mpUndefined, mpUnitDefinitionList, mpUnknownResource, CFunction::setInfix(), CMIRIAMResource::setMIRIAMDisplayName(), CMIRIAMResource::setMIRIAMURI(), and CUnitDefinition::updateSIUnitDefinitions().

Referenced by init().

◆ operator=()

CRootContainer& CRootContainer::operator= ( const CRootContainer src)
private

The assignment operator is private as well to make sure that there is only one root container that can be initialized through the init call.

Parameters
constCRootContainer & src
Returns
CRootContainer &

◆ quoteUnitDefSymbol()

std::string CRootContainer::quoteUnitDefSymbol ( const std::string &  symbol)
static

Quote the given symbol if needed

Parameters
conststd::string & symbol
Returns
std::string quotedSymbol

References mpUnitDefinitionList, pRootContainer, and CUnitDefinitionDB::quoteSymbol().

Referenced by CUnit::buildExpression().

◆ removeDatamodel() [1/2]

bool CRootContainer::removeDatamodel ( const CDataModel pDatamodel)
static

◆ removeDatamodel() [2/2]

bool CRootContainer::removeDatamodel ( const unsigned C_INT32  index)
static

◆ replaceSymbol()

void CRootContainer::replaceSymbol ( const std::string &  oldSymbol,
const std::string &  newSymbol 
)
static

Replace all old symbols with new symbols in the unit definition DB and in all models

Parameters
conststd::string & oldSymbol
conststd::string & newSymbol

References CDataVector< CType >::begin(), CDataVector< CType >::end(), mpDataModelList, and pRootContainer.

Referenced by CUnitDefinitionDB::replaceSymbol().

Member Data Documentation

◆ mKeyFactory

CKeyFactory CRootContainer::mKeyFactory
protected

Referenced by getKeyFactory().

◆ mpConfiguration

CConfigurationFile* CRootContainer::mpConfiguration
protected

◆ mpDataModelList

◆ mpFunctionList

CFunctionDB* CRootContainer::mpFunctionList
protected

◆ mpUndefined

CFunction* CRootContainer::mpUndefined
protected

◆ mpUnitDefinitionList

CUnitDefinitionDB* CRootContainer::mpUnitDefinitionList
protected

◆ mpUnknownResource

CMIRIAMResource* CRootContainer::mpUnknownResource
protected

◆ mWithGUI

bool CRootContainer::mWithGUI
protected

Referenced by addDatamodel(), and ~CRootContainer().


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