COPASI API  4.40.278
CKeyFactory Class Reference

#include <CKeyFactory.h>

Classes

class  CDecisionVector
 
class  HashTable
 

Public Member Functions

std::string add (const std::string &prefix, CDataObject *pObject)
 
bool addFix (const std::string &key, CDataObject *pObject)
 
 CKeyFactory ()
 
CDataObjectget (const std::string &key)
 
bool remove (const std::string &key)
 
 ~CKeyFactory ()
 

Static Public Member Functions

static bool isValidKey (const std::string &key, const std::string &prefix="")
 

Protected Attributes

std::map< std::string, HashTablemKeyTable
 

Static Protected Attributes

static CDecisionVector isDigit
 
static CDecisionVector isPrefix
 

Constructor & Destructor Documentation

◆ CKeyFactory()

CKeyFactory::CKeyFactory ( )

Default constructor

◆ ~CKeyFactory()

CKeyFactory::~CKeyFactory ( )

Destructor

Member Function Documentation

◆ add()

◆ addFix()

bool CKeyFactory::addFix ( const std::string &  key,
CDataObject pObject 
)

Add an object with a fix given key. The return value indicate whether the key was actually inserted.

Parameters
conststd::string & key
CDataObject* pObject
Returns
bool success

References isDigit, and mKeyTable.

Referenced by CXMLHandler::addFix(), UnitDefinitionHandler::processEnd(), and ModelParameterSetHandler::processStart().

◆ get()

CDataObject * CKeyFactory::get ( const std::string &  key)

Retrieve the object referred by key from the key map.

Parameters
conststd::string & key
Returns
CDataObject * pObject

References isDigit, and mKeyTable.

Referenced by CModelAdd::addCompartmentsExpressions(), CModelAdd::addMetabolitesExpressions(), CModelAdd::addModelValuesExpressions(), CModel::applyActiveParameterSet(), CEventAssignment::CEventAssignment(), CModelExpansion::SetOfModelElements::contains(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), 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(), CExperimentSet::keyToIndex(), CModelMerging::mergeInExpression(), SBMLDocumentLoader::postprocessTextGlyph(), printNameForKey(), CFitProblem::printResult(), COPASIHandler::processEnd(), ModelHandler::processEnd(), AssignmentHandler::processStart(), CallParameterHandler::processStart(), CompartmentGlyphHandler::processStart(), KineticLawHandler::processStart(), MetaboliteGlyphHandler::processStart(), MetaboliteHandler::processStart(), MetaboliteReferenceGlyphHandler::processStart(), ModifierHandler::processStart(), ParameterHandler::processStart(), ProductHandler::processStart(), ReactionGlyphHandler::processStart(), ReactionHandler::processStart(), SBMLMapHandler::processStart(), SliderHandler::processStart(), SourceParameterHandler::processStart(), StateTemplateVariableHandler::processStart(), StyleHandler::processStart(), SubstrateHandler::processStart(), TextGlyphHandler::processStart(), CModel::removeCompartment(), CModel::removeEvent(), CFunctionDB::removeFunction(), CDataModel::removeLayout(), CModel::removeLocalReactionParameter(), CModel::removeMetabolite(), CModel::removeModelValue(), COutputDefinitionVector::removePlotSpec(), CModel::removeReaction(), CReportDefinitionVector::removeReportDefinition(), CChemEqElement::setMetabolite(), and CMMLOutput::writeDifferentialEquations().

◆ isValidKey()

bool CKeyFactory::isValidKey ( const std::string &  key,
const std::string &  prefix = "" 
)
static

check whether the key is valid

Parameters
conststd::string & key
conststd::string & prefix (default: check for [a-zA-Z]+\d+)
Returns
bool isValid

CKeyFactory class. This class is used to create a unique key whithin COPASI. It also allows retreival of the CDataObject the key is assigned to.

Created for Copasi by Stefan Hoops 2003 Copyright Stefan Hoops

References isDigit, and isPrefix.

Referenced by CCopasiParameter::isValidValue(), and ParameterHandler::processStart().

◆ remove()

Member Data Documentation

◆ isDigit

CKeyFactory::CDecisionVector CKeyFactory::isDigit
staticprotected

Fast way to decide whether a character is a digit.

Referenced by addFix(), get(), isValidKey(), and remove().

◆ isPrefix

CKeyFactory::CDecisionVector CKeyFactory::isPrefix
staticprotected

Fast way to decide whether a character is a valid part of the prefix.

Referenced by isValidKey().

◆ mKeyTable

std::map< std::string, HashTable > CKeyFactory::mKeyTable
protected

A map of hash tables for the prefixes.

Referenced by add(), addFix(), get(), and remove().


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