COPASI API
4.40.278
|
#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 () | |
CDataObject * | get (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, HashTable > | mKeyTable |
Static Protected Attributes | |
static CDecisionVector | isDigit |
static CDecisionVector | isPrefix |
CKeyFactory::CKeyFactory | ( | ) |
Default constructor
CKeyFactory::~CKeyFactory | ( | ) |
Destructor
std::string CKeyFactory::add | ( | const std::string & | prefix, |
CDataObject * | pObject | ||
) |
Add an object with a key generated from the given prefix to the key map. The return value is the actually generated key.
const | std::string & prefix |
CDataObject | * pObject |
References mKeyTable.
Referenced by CEvent::CEvent(), CFunction::CFunction(), CLColorDefinition::CLColorDefinition(), 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(), CReaction::CReaction(), CUnitDefinition::CUnitDefinition(), CExperiment::initializeParameter(), and CUnitDefinition::setup().
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.
const | std::string & key |
CDataObject | * pObject |
References isDigit, and mKeyTable.
Referenced by CXMLHandler::addFix(), UnitDefinitionHandler::processEnd(), and ModelParameterSetHandler::processStart().
CDataObject * CKeyFactory::get | ( | const std::string & | key | ) |
Retrieve the object referred by key from the key map.
const | std::string & key |
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().
|
static |
check whether the key is valid
const | std::string & key |
const | std::string & prefix (default: check for [a-zA-Z]+\d+) |
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().
bool CKeyFactory::remove | ( | const std::string & | key | ) |
Remove the key and the related object from the key map.
const | std::string & key |
References isDigit, and mKeyTable.
Referenced by COutputDefinitionVector::cleanup(), CReportDefinition::cleanup(), CReportDefinitionVector::cleanup(), CExperiment::initializeParameter(), 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().
|
staticprotected |
Fast way to decide whether a character is a digit.
Referenced by addFix(), get(), isValidKey(), and remove().
|
staticprotected |
Fast way to decide whether a character is a valid part of the prefix.
Referenced by isValidKey().
|
protected |