COPASI API  4.16.103
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Attributes | Private Types | Private Attributes | Static Private Attributes | Friends | List of all members
CCopasiObject Class Reference

#include <CCopasiObject.h>

Inheritance diagram for CCopasiObject:
Inheritance graph
[legend]
Collaboration diagram for CCopasiObject:
Collaboration graph
[legend]

Public Types

typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 

Public Member Functions

void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
virtual const std::string & getKey () const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
virtual std::string getUnits () const
 
UpdateMethodgetUpdateMethod () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Static Public Member Functions

static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 

Protected Types

enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 

Protected Member Functions

 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 

Static Protected Attributes

static CRenameHandlersmpRenameHandler = NULL
 

Private Types

typedef CCopasiObject referenceType
 

Private Attributes

DataObjectSet mDependencies
 
unsigned C_INT32 mObjectFlag
 
std::string mObjectName
 
std::string mObjectType
 
CCopasiStaticStringmpObjectDisplayName
 
CCopasiContainermpObjectParent
 
RefreshmpRefresh
 
UpdateMethodmpUpdateMethod
 

Static Private Attributes

static const C_FLOAT64 DummyValue = 0.0
 
static UpdateMethod mDefaultUpdateMethod
 

Friends

std::ostream & operator<< (std::ostream &os, const CCopasiObject &o)
 

Detailed Description

Definition at line 216 of file CCopasiObject.h.

Member Typedef Documentation

typedef std::set< const CCopasiObject * > CCopasiObject::DataObjectSet

Definition at line 225 of file CCopasiObject.h.

typedef std::vector< Refresh * > CCopasiObject::DataUpdateSequence

Definition at line 226 of file CCopasiObject.h.

Definition at line 222 of file CCopasiObject.h.

Member Enumeration Documentation

enum CCopasiObject::Flag
protected
Enumerator
Container 
Vector 
Matrix 
NameVector 
Reference 
ValueBool 
ValueInt 
ValueInt64 
ValueDbl 
NonUniqueName 
StaticString 
ValueString 
Separator 
ModelEntity 
Array 
DataModel 
Root 
Gui 

Definition at line 230 of file CCopasiObject.h.

Constructor & Destructor Documentation

CCopasiObject::CCopasiObject ( )
protected

Definition at line 48 of file CCopasiObject.cpp.

48  :
50  mObjectName("No Name"),
51  mObjectType("Unknown Type"),
52  mpObjectParent(NULL),
53  mpObjectDisplayName(NULL),
54  mObjectFlag(0),
56  mpRefresh(NULL)
57 {}
unsigned C_INT32 mObjectFlag
CCopasiStaticString * mpObjectDisplayName
UpdateMethod * mpUpdateMethod
std::string mObjectName
static UpdateMethod mDefaultUpdateMethod
CCopasiContainer * mpObjectParent
std::string mObjectType
Refresh * mpRefresh
CCopasiObject::CCopasiObject ( const std::string &  name,
const CCopasiContainer pParent = NULL,
const std::string &  type = "CN",
const unsigned C_INT32 flag = 0 
)
protected

Definition at line 59 of file CCopasiObject.cpp.

References CCopasiContainer::add(), isContainer(), and mpObjectParent.

62  :
64  mObjectName((name == "") ? "No Name" : name),
65  mObjectType(type),
66  mpObjectParent(const_cast<CCopasiContainer *>(pParent)),
67  mpObjectDisplayName(NULL),
70  mpRefresh(NULL)
71 {
72  if (mpObjectParent != NULL)
74 }
bool isContainer() const
unsigned C_INT32 mObjectFlag
CCopasiStaticString * mpObjectDisplayName
UpdateMethod * mpUpdateMethod
std::string mObjectName
static UpdateMethod mDefaultUpdateMethod
long int flag
Definition: f2c.h:52
CCopasiContainer * mpObjectParent
std::string mObjectType
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
Refresh * mpRefresh
CCopasiObject::CCopasiObject ( const CCopasiObject src,
const CCopasiContainer pParent = NULL 
)

Definition at line 76 of file CCopasiObject.cpp.

References CCopasiContainer::add(), and mpObjectParent.

77  :
81  mpObjectParent(const_cast<CCopasiContainer *>(pParent)),
82  mpObjectDisplayName(NULL),
85  mpRefresh(NULL)
86 {if (mpObjectParent != NULL) mpObjectParent->add(this);}
unsigned C_INT32 mObjectFlag
CCopasiStaticString * mpObjectDisplayName
UpdateMethod * mpUpdateMethod
std::string mObjectName
static UpdateMethod mDefaultUpdateMethod
CCopasiContainer * mpObjectParent
std::string mObjectType
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
Refresh * mpRefresh
CCopasiObject::~CCopasiObject ( )
virtual

Definition at line 88 of file CCopasiObject.cpp.

References mDefaultUpdateMethod, mpObjectDisplayName, mpObjectParent, mpRefresh, mpUpdateMethod, pdelete, and CCopasiContainer::remove().

89 {
90  if (mpObjectParent)
91  mpObjectParent->remove(this);
92 
94 
97 
99 }
CCopasiStaticString * mpObjectDisplayName
#define pdelete(p)
Definition: copasi.h:215
UpdateMethod * mpUpdateMethod
static UpdateMethod mDefaultUpdateMethod
virtual bool remove(CCopasiObject *pObject)
CCopasiContainer * mpObjectParent
Refresh * mpRefresh

Member Function Documentation

void CCopasiObject::addDirectDependency ( const CCopasiObject pObject)
std::vector< Refresh * > CCopasiObject::buildUpdateSequence ( const DataObjectSet objects,
const DataObjectSet uptoDateObjects,
const DataObjectSet context = DataObjectSet() 
)
static

Build the update sequence for the given list of objects. The resulting sequence takes the dependencies of the objects in consideration. If circular dependencies are detected an exception is thrown

Parameters
DataObjectSet& objects
constDataObjectSet & uptoDateObjects
constDataObjectSet & context (default: empty set)
Returns
std::vector< Refresh * > updateSequence

Definition at line 438 of file CCopasiObject.cpp.

References CCopasiMessage::EXCEPTION, getAllDependencies(), MCObject, and sortObjectsByDependency().

Referenced by CModel::buildApplyInitialValuesSequence(), CMathModel::buildDependendRefreshList(), CModel::buildNonSimulatedSequence(), CMathModel::buildRequiredRefreshList(), CModel::buildSimulatedSequence(), CExperiment::compile(), COutputHandler::compileRefresh(), CScanMethod::init(), CFitProblem::initialize(), COptProblem::initialize(), CStochDirectMethod::start(), CTrajAdaptiveSA::start(), and CTrajectoryMethodDsaLsodar::start().

441 {
442  CCopasiObject::DataObjectSet DependencySet;
443  CCopasiObject::DataObjectSet VerifiedSet;
444 
445  CCopasiObject::DataObjectSet::const_iterator itSet;
446  CCopasiObject::DataObjectSet::const_iterator endSet = objects.end();
447  std::pair<CCopasiObject::DataObjectSet::iterator, bool> InsertedObject;
448 
449  assert(objects.count(NULL) == 0);
450 
451  // Check whether we have any circular dependencies
452  for (itSet = objects.begin(); itSet != endSet; ++itSet)
453  if ((*itSet)->hasCircularDependencies(DependencySet, VerifiedSet, context))
454  CCopasiMessage(CCopasiMessage::EXCEPTION, MCObject + 1, (*itSet)->getCN().c_str());
455 
456  // Build the complete set of dependencies
457  for (itSet = objects.begin(); itSet != endSet; ++itSet)
458  {
459  // At least the object itself needs to be up to date.
460  InsertedObject = DependencySet.insert(*itSet);
461 
462  // Add all its dependencies
463  if (InsertedObject.second)
464  (*itSet)->getAllDependencies(DependencySet, context);
465  }
466 
467  // Remove all objects which do not have any refresh method as they will
468  // be ignored anyway, i.e., no need to sort them.
469  for (itSet = DependencySet.begin(), endSet = DependencySet.end(); itSet != endSet;)
470  if ((*itSet)->getRefresh() == NULL ||
471  ((dynamic_cast< const CParticleReference * >(*itSet) != NULL ||
472  dynamic_cast< const CConcentrationReference * >(*itSet) != NULL) &&
473  (*itSet)->getDirectDependencies(context).size() == 0))
474  {
475  const CCopasiObject * pObject = *itSet;
476  ++itSet;
477  DependencySet.erase(pObject);
478  }
479  else
480  ++itSet;
481 
482  // Build the list of all up to date objects
483  CCopasiObject::DataObjectSet UpToDateSet;
484 
485  for (itSet = uptoDateObjects.begin(), endSet = uptoDateObjects.end(); itSet != endSet; ++itSet)
486  {
487  // At least the object itself is up to date.
488  InsertedObject = UpToDateSet.insert(*itSet);
489 
490  // Add all its dependencies too
491  if (InsertedObject.second)
492  (*itSet)->getAllDependencies(UpToDateSet, context);
493  }
494 
495  // Now remove all objects in the dependency set which are up to date
496  for (itSet = UpToDateSet.begin(), endSet = UpToDateSet.end(); itSet != endSet; ++itSet)
497  DependencySet.erase(*itSet);
498 
499  // Create a properly sorted list.
500  std::list< const CCopasiObject * > SortedList =
501  sortObjectsByDependency(DependencySet.begin(), DependencySet.end(), context);
502 
503  std::list< const CCopasiObject * >::iterator itList;
504  std::list< const CCopasiObject * >::iterator endList;
505 
506  // Build the vector of pointers to refresh methods
507  Refresh * pRefresh;
508 
509  std::vector< Refresh * > UpdateVector;
510  std::vector< Refresh * >::const_iterator itUpdate;
511  std::vector< Refresh * >::const_iterator endUpdate;
512 
513  itList = SortedList.begin();
514  endList = SortedList.end();
515 
516  for (; itList != endList; ++itList)
517  {
518  pRefresh = (*itList)->getRefresh();
519  itUpdate = UpdateVector.begin();
520  endUpdate = UpdateVector.end();
521 
522  while (itUpdate != endUpdate && !(*itUpdate)->isEqual(pRefresh)) ++itUpdate;
523 
524  if (itUpdate == endUpdate)
525  UpdateVector.push_back(pRefresh);
526  }
527 
528  return UpdateVector;
529 }
#define MCObject
std::list< const CCopasiObject * > sortObjectsByDependency(ForwardAccessIterator begin, ForwardAccessIterator end, const CCopasiObject::DataObjectSet &context)
void getAllDependencies(DataObjectSet &dependencies, const DataObjectSet &context) const
std::set< const CCopasiObject * > DataObjectSet
void CCopasiObject::clearDirectDependencies ( )

Clear the list of direct dependencies.

Definition at line 293 of file CCopasiObject.cpp.

References mDependencies.

Referenced by CMoiety::cleanup(), CEventAssignment::compile(), COptItem::compile(), CEvent::compile(), CMetab::compile(), CReaction::compile(), and CEvaluationTree::compileNodes().

294 {
295  mDependencies.clear();
296 }
DataObjectSet mDependencies
void CCopasiObject::clearRefresh ( )

Definition at line 630 of file CCopasiObject.cpp.

References mpRefresh, and pdelete.

Referenced by CMetab::compile(), CReaction::compile(), CModelEntity::setStatus(), and CMetab::setStatus().

631 {pdelete(mpRefresh);}
#define pdelete(p)
Definition: copasi.h:215
Refresh * mpRefresh
bool CCopasiObject::dependsOn ( CCopasiObject::DataObjectSet  candidates,
const DataObjectSet context = DataObjectSet() 
) const

Check whether the current object depends on any objects in the candidates.

Parameters
DataObjectSetcandidates
constDataObjectSet & context (default: empty set)
Returns
bool dependsOn

Definition at line 388 of file CCopasiObject.cpp.

References hasCircularDependencies().

Referenced by CMathModel::buildDependendRefreshList(), CModel::buildSimulatedSequence(), and CHybridMethodODE45::setupMetab2React().

390 {
392  return hasCircularDependencies(candidates, verified, context);
393 }
bool hasCircularDependencies(DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
std::set< const CCopasiObject * > DataObjectSet
void CCopasiObject::getAllDependencies ( CCopasiObject::DataObjectSet dependencies,
const DataObjectSet context 
) const

If called with an empty set of dependencies it retrieves the complete list of all dependencies (including all indirect) of the current object. If called with a non empty set it will only add any dependency and all its dependencies to the list if the dependency is not already among the dependencies

Parameters
DataObjectSet& dependencies
constDataObjectSet & context

Definition at line 345 of file CCopasiObject.cpp.

References getDirectDependencies().

Referenced by buildUpdateSequence().

347 {
348  const CCopasiObject::DataObjectSet & DirectDependencies = getDirectDependencies(context);
349  CCopasiObject::DataObjectSet::const_iterator it = DirectDependencies.begin();
350  CCopasiObject::DataObjectSet::const_iterator end = DirectDependencies.end();
351 
352  std::pair<CCopasiObject::DataObjectSet::iterator, bool> Inserted;
353 
354  for (; it != end; ++it)
355  {
356  // Dual purpose insert
357  Inserted = dependencies.insert(*it);
358 
359  // The direct dependency *it was among the dependencies
360  // we assume also its dependencies have been added already.
361  if (!Inserted.second) continue;
362 
363  // Add all the dependencies of the direct dependency *it.
364  (*it)->getAllDependencies(dependencies, context);
365  }
366 }
virtual const DataObjectSet & getDirectDependencies(const DataObjectSet &context=DataObjectSet()) const
std::set< const CCopasiObject * > DataObjectSet
CCopasiObjectName CCopasiObject::getCN ( ) const
virtual

Retrieve the CN of the object

Returns
CCopasiObjectName

Implements CObjectInterface.

Reimplemented in CCopasiParameter, CMathContainer, and CArrayElementReference.

Definition at line 103 of file CCopasiObject.cpp.

References CCopasiObjectName::escape(), getCN(), CCopasiVector< T >::getIndex(), isDataModel(), isNameVector(), isVector(), mObjectName, mObjectType, and mpObjectParent.

Referenced by CQPlotSubwidget::addCurve2D(), CQLayoutScene::addGlyph(), CCompartment::addMetabolite(), CReportDefinition::addTableElement(), addToInitialValueMap(), applyValueToModelParameter(), CQReportDefinition::btnSeparatorClicked(), CQReportDefinition::btnTextClicked(), CFixLocalReactionParameters::changeModel(), CTimeSeries::compile(), CEvaluationNodeCall::compile(), CMathObject::compileDependentMass(), CMathObject::compileFlux(), CMathObject::compileParticleFlux(), CMathObject::compilePropensity(), COutputHandler::compileRefresh(), CModel::convert2NonReversible(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CQReportListItem::CQReportListItem(), SBMLImporter::createCReactionFromReaction(), CSEDMLExporter::createDataGenerators(), COutputAssistant::createDefaultOutput(), CPlotSpecification::createDefaultPlot(), CMathObject::createExtensiveODERateExpression(), CModelParameterSet::createFromModel(), CExpression::createInitialExpression(), CMathObject::createIntensiveRateExpression(), CSBMLExporter::createKineticExpression(), CSBMLExporter::createMassActionExpression(), COutputAssistant::createPlot(), CScanProblem::createScanItem(), SBMLImporter::divideByObject(), CCopasiXMLParser::ListOfReportsElement::end(), CCopasiXMLParser::HeaderElement::end(), CCopasiXMLParser::BodyElement::end(), CCopasiXMLParser::FooterElement::end(), ObjectBrowserWidget::eXport(), CMathObject::getCN(), CArrayElementReference::getCN(), CMathContainer::getCN(), CCopasiParameter::getCN(), getCN(), getInitialCNForSBase(), CMathContainer::getObject(), CFitProblem::initialize(), CSteadyStateTask::initialize(), CModelMerging::mergeInExpression(), CSBMLExporter::multiplyByObject(), CCopasiDataModel::ObjectFromCN(), operator<<(), SEDMLImporter::readListOfPlotsFromSedMLOutput(), SBMLImporter::renameMassActionParameters(), SBMLImporter::replace_time_with_initial_time(), CModelExpansion::replaceInExpression(), SBMLImporter::replaceObjectNames(), CSBMLExporter::replaceSpeciesReferences(), CScanWidgetRandom::save(), CScanWidgetScan::save(), CQReportDefinition::save(), SensitivitiesWidget::saveTask(), Curve2DWidget::SaveToCurveSpec(), HistoWidget::SaveToCurveSpec(), BandedGraphWidget::SaveToCurveSpec(), CQExperimentData::selectModelObject(), setObjectName(), CCrossSectionProblem::setSingleObjectCN(), CSlider::setSliderObject(), COptProblem::setSubtaskType(), CQFittingItemWidget::slotCheckLowerInf(), CQFittingItemWidget::slotCheckUpperInf(), CQFittingItemWidget::slotLowerEdit(), CQFittingItemWidget::slotUpperEdit(), test000099::test_bug1675(), test000087::test_simulate_reaction_flux_reference_1(), CModelExpansion::updateExpression(), CSteadyStateTask::updateMatrices(), and CReaction::variable2object().

104 {
106 
107  // if the object has a parent and if the object is not a datamodel,
108  // we add the name of the parent to the common name
109  if (isDataModel())
110  CN = (std::string) "CN=Root";
111  else if (mpObjectParent)
112  {
113  std::stringstream tmp;
114  tmp << mpObjectParent->getCN();
115 
117  tmp << "[" << CCopasiObjectName::escape(mObjectName) << "]";
118  else if (mpObjectParent->isVector())
119  tmp << "[" << static_cast<const CCopasiVector< CCopasiObject > *>(mpObjectParent)->getIndex(this) << "]";
120  else
123 
124  CN = tmp.str();
125  }
126  else
127  {
130  }
131 
132  return CN;
133 }
bool isNameVector() const
virtual CCopasiObjectName getCN() const
static std::string escape(const std::string &name)
std::string mObjectName
bool isDataModel() const
CCopasiContainer * mpObjectParent
virtual size_t getIndex(const CCopasiObject *pObject) const
std::string mObjectType
bool isVector() const
const CCopasiObject::DataObjectSet & CCopasiObject::getDirectDependencies ( const DataObjectSet context = DataObjectSet()) const
virtual
const std::string & CCopasiObject::getKey ( ) const
virtual

Reimplemented in CModel, CCopasiTask, CLGroup, CMoiety, CLText, CLRenderInformationBase, CEvent, CLRectangle, CReportDefinition, CLEllipse, CLImage, CCopasiParameter, CFunctionParameter, CLRenderCurve, CLStyle, CLColorDefinition, CLGradientBase, CReaction, CLPolygon, CLLineEnding, CReference, CModelEntity, CLGradientStop, CCreator, CBiologicalDescription, CSlider, CModification, CMIRIAMInfo, CLGraphicalObject, CEventAssignment, CLayout, CFunction, CReportDefinitionVector, CModelParameterSet, and COutputDefinitionVector.

Definition at line 608 of file CCopasiObject.cpp.

Referenced by addToInitialValueMap(), SliderSettingsDialog::browseButtonPressed(), CQReportDefinition::btnDeleteReportClicked(), CModelAnalyzer::checkReaction(), CLayout::CLayout(), CQGLNetworkPainter::createGraph(), SliderDialog::createNewSlider(), SBMLImporter::doMapping(), CCopasiXMLParser::PlotItemElement::end(), CCopasiXMLParser::PlotSpecificationElement::end(), CCopasiXMLParser::COPASIElement::end(), CODEExporter::exportExpression(), CODEExporter::exportKineticFunction(), CODEExporter::exportMetabolites(), CODEExporter::exportMetabolitesConcentrations(), CODEExporter::exportReacParamsAndFuncs(), CLayout::exportToDotFile(), SliderDialog::getCSlidersForObject(), CModelExpansion::ElementsMap::getDuplicateKey(), SBMLImporter::importEvent(), CQSpecieDM::insertRows(), CODEExporterC::KineticFunction2ODEmember(), CMIRIAMInfo::load(), CReaction::loadOneRole(), CModelMerging::mergeInExpression(), CODEExporterC::preprocess(), CODEExporter::preprocess(), CQParameterSetsDM::removeRows(), SBMLImporter::restoreFunctionDB(), CQFunctionDM::setData(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), ReactionsWidget1::slotBtnNew(), CQReactionsWidget::slotDoubleClicked(), CQEventsWidget::slotDoubleClicked(), CQCompartmentsWidget::slotDoubleClicked(), CQFunctionsWidget::slotDoubleClicked(), CQGlobalQuantitiesWidget::slotDoubleClicked(), CQSpeciesWidget::slotDoubleClicked(), CCopasiXMLParser::ParameterElement::start(), CCopasiXMLParser::SliderElement::start(), CQFittingWidget::taskFinishedEvent(), test000058::test_bug1025_6(), test000059::test_unique_id_13(), test000059::test_unique_id_15(), test000059::test_unique_id_16(), CLLayoutRenderer::update_associations(), CSBMLExporter::updateMIRIAMAnnotation(), CModelParameter::updateModel(), CReactionInterface::writeBackToReaction(), and CMMLOutput::writeDifferentialEquations().

609 {
610  static std::string DefaultKey("");
611 
612  return DefaultKey;
613 }
const CObjectInterface * CCopasiObject::getObject ( const CCopasiObjectName cn) const
virtual

Retrieve a descendant object by its CN.

Parameters
constCCopasiObjectName & cn
Returns
const CObjectInterface * pObject

Implements CObjectInterface.

Reimplemented in CCopasiVectorN< CType >, CCopasiVectorN< CReaction >, CCopasiVectorN< CEventAssignment >, CCopasiVectorN< CFunctionParameter >, CCopasiVectorN< CCopasiTask >, CCopasiVectorN< CPlotSpecification >, CCopasiVectorN< CCompartment >, CCopasiVectorN< CModelParameterSet >, CCopasiVectorN< CEvent >, CCopasiVectorN< CMetab >, CCopasiVectorN< CFunction >, CCopasiVectorN< CModelValue >, CCopasiVectorN< CReportDefinition >, CCopasiVector< T >, CCopasiVector< CLGlobalRenderInformation >, CCopasiVector< CModification >, CCopasiVector< CLMetabGlyph >, CCopasiVector< CLCompartmentGlyph >, CCopasiVector< CLReferenceGlyph >, CCopasiVector< CSlider >, CCopasiVector< CBiologicalDescription >, CCopasiVector< CLGlobalStyle >, CCopasiVector< CEventAssignment >, CCopasiVector< CReference >, CCopasiVector< CMathEvent::CAssignment >, CCopasiVector< CLayout >, CCopasiVector< CLGradientStop >, CCopasiVector< CLMetabReferenceGlyph >, CCopasiVector< CMoiety >, CCopasiVector< CType >, CCopasiVector< CChemEqElement >, CCopasiVector< CLColorDefinition >, CCopasiVector< CLReactionGlyph >, CCopasiVector< CEvent >, CCopasiVector< CMathEvent >, CCopasiVector< CLGradientBase >, CCopasiVector< CLLocalRenderInformation >, CCopasiVector< CMetab >, CCopasiVector< CPlotItem >, CCopasiVector< CCopasiDataModel >, CCopasiVector< CLLineEnding >, CCopasiVector< CFittingPoint >, CCopasiVector< CLTextGlyph >, CCopasiVector< CCopasiObject >, CCopasiVector< CMathTrigger::CRootFinder >, CCopasiVector< CLLocalStyle >, CCopasiVector< CCreator >, CCopasiVector< CLGraphicalObject >, CCopasiVector< CMetabOld >, CCopasiVector< CLGeneralGlyph >, CReaction, CArrayAnnotation, CMathContainer, CCopasiParameterGroup, and CCopasiContainer.

Definition at line 136 of file CCopasiObject.cpp.

References getObjectDisplayName(), and mpObjectDisplayName.

Referenced by CMathObject::getObject(), CCopasiContainer::getObject(), CArrayAnnotation::getObject(), CModelExpansion::replaceInExpression(), SEDMLUtils::resolveXPath(), and CModelExpansion::updateExpression().

137 {
138  if (cn == "")
139  {
140  return this;
141  }
142 
143  if (cn == "Property=DisplayName")
144  {
145  if (mpObjectDisplayName == NULL)
146  {
148  }
149 
151 
152  return mpObjectDisplayName;
153  }
154 
155  return NULL;
156 }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
CCopasiStaticString * mpObjectDisplayName
CCopasiContainer * CCopasiObject::getObjectAncestor ( const std::string &  type) const

Definition at line 279 of file CCopasiObject.cpp.

References getObjectParent(), and getObjectType().

Referenced by SliderSettingsDialog::browseButtonPressed(), CExperimentSet::calculateStatistics(), CFixLocalReactionParameters::changeModel(), CMetab::compile(), CMathEvent::compile(), CMetab::compileInitialValueDependencies(), CScanItem::CScanItem(), CFitProblem::elevateChildren(), CQSimpleSelectionTree::filter(), CReaction::getChildObjectUnits(), CArrayElementReference::getObjectDisplayName(), CReaction::getObjectDisplayName(), CEvent::getObjectDisplayName(), CMetab::getObjectDisplayName(), CCopasiParameter::getObjectDisplayName(), COptProblem::getSubtaskType(), CMetab::initCompartment(), CMoiety::initConversionFactor(), CFitProblem::initialize(), COptProblem::initializeSubtaskBeforeOutput(), CModelEntity::initObjects(), CQCompartment::load(), CReaction::load(), CQEventWidget1::loadFromEvent(), CReaction::loadOneRole(), CReaction::object2variable(), CQEventWidget1::saveToEvent(), ReactionsWidget1::setFramework(), CModelParameterSet::setObjectParent(), CEventAssignment::setObjectParent(), CModelEntity::setObjectParent(), CEvent::setObjectParent(), CReaction::setScalingFactor(), COptProblem::setSubtaskType(), CSensMethod::setValue(), CQCompartment::slotTypeChanged(), CModelParameter::updateModel(), and ParameterTable::updateTable().

280 {
282 
283  while (p)
284  {
285  if (p->getObjectType() == type) return p;
286 
287  p = p->getObjectParent();
288  }
289 
290  return NULL;
291 }
const std::string & getObjectType() const
CCopasiContainer * getObjectParent() const
CCopasiDataModel * CCopasiObject::getObjectDataModel ( )

Returns a pointer to the CCopasiDataModel the element belongs to. If there is no instance of CCopasiDataModel in the ancestor tree, NULL is returned.

Definition at line 666 of file CCopasiObject.cpp.

References getObjectParent(), and isDataModel().

Referenced by COptProblem::addOptItem(), CQPlotSubwidget::addPlot(), CQReportDefinition::btnCopyReportClicked(), CExperiment::calculateStatistics(), CSlider::compile(), CModelEntity::compile(), COptItem::compile(), CExperiment::compile(), CModelParameter::compile(), CExperimentObjectMap::compile(), CMetab::compile(), CModelParameterReactionParameter::compile(), COptItem::compileLowerBound(), COptItem::compileUpperBound(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CQPlotSubwidget::copyPlot(), CModelAdd::copyTriggerExpression(), createParameterSetsForExperiment(), CScanItem::CScanItem(), CFitProblem::elevateChildren(), CopasiWidget::enter(), CODEExporter::exportModelValuesExpressions(), CArrayAnnotation::getAnnotationsString(), CExperimentObjectMap::CDataColumn::getDefaultScale(), CQExpressionWidget::getExpression(), CExperiment::getFileName(), CExpression::getNodeObject(), CMathContainer::getObject(), CFittingPoint::getObjectDisplayName(), COptItem::getStartValue(), CMCAProblem::getSubTask(), COptProblem::getSubtaskType(), SEDMLUtils::getXPathForObject(), CFitProblem::initialize(), CSensMethod::initialize(), CScanTask::initialize(), CNewtonMethod::initialize(), CCopasiTask::initialize(), CTSSAMethod::initializeIntegrationsParameter(), CLsodaMethod::initializeParameter(), COptProblem::initializeSubtaskBeforeOutput(), CScanTask::initSubtask(), SBMLImporter::isConstantFlux(), CSlider::isValid(), CSteadyStateProblem::load(), CTrajectoryProblem::load(), CModel::load(), CReaction::loadOneRole(), CQCrossSectionTaskWidget::loadTask(), CModelMerging::mergeInExpression(), CReaction::object2variable(), operator<<(), CQSimpleSelectionTree::populateTree(), CReportDefinition::preCompileTable(), CTSSAProblem::printResult(), CILDMModifiedMethod::printResult(), CMoietiesTask::process(), SEDMLImporter::readListOfPlotsFromSedMLOutput(), CQFittingWidget::runTask(), COptItem::setObjectCN(), CSlider::setSliderObject(), CModelEntity::setStatus(), CMCAProblem::setSteadyStateRequested(), CLNAProblem::setSteadyStateRequested(), COptProblem::setSubtaskType(), CQFittingWidget::taskFinishedEvent(), CModelParameter::updateModel(), ParameterTable::updateTable(), and CDotOutput::writeDependencies().

667 {
668  CCopasiObject * pObject = this;
669 
670  while (pObject != NULL)
671  {
672  if (pObject->isDataModel())
673  return static_cast<CCopasiDataModel *>(pObject);
674 
675  pObject = pObject->getObjectParent();
676  }
677 
678  return NULL;
679 }
bool isDataModel() const
CCopasiContainer * getObjectParent() const
const CCopasiDataModel * CCopasiObject::getObjectDataModel ( ) const

Returns a const pointer to the CCopasiDataModel the element belongs to. If there is no instance of CCopasiDataModel in the ancestor tree, NULL is returned.

Definition at line 686 of file CCopasiObject.cpp.

References getObjectParent(), and isDataModel().

687 {
688  const CCopasiObject * pObject = this;
689 
690  while (pObject != NULL)
691  {
692  if (pObject->isDataModel())
693  return static_cast<const CCopasiDataModel *>(pObject);
694 
695  pObject = pObject->getObjectParent();
696  }
697 
698  return NULL;
699 }
bool isDataModel() const
CCopasiContainer * getObjectParent() const
std::string CCopasiObject::getObjectDisplayName ( bool  regular = true,
bool  richtext = false 
) const
virtual

Reimplemented in CCopasiParameter, CMetab, CArrayAnnotation, CEvent, CReaction, CArrayElementReference, CCopasiObjectReference< CType >, CCopasiObjectReference< C_FLOAT64 >, CCopasiReportSeparator, CCopasiStaticString, and CFittingPoint.

Definition at line 216 of file CCopasiObject.cpp.

References getObjectDisplayName(), getObjectName(), getObjectType(), isNameVector(), isReference(), isVector(), and mpObjectParent.

Referenced by CQPlotSubwidget::addCurve2D(), SliderSettingsDialog::browseButtonPressed(), Curve2DWidget::buttonPressedX(), HistoWidget::buttonPressedX(), BandedGraphWidget::buttonPressedX(), Curve2DWidget::buttonPressedY(), BandedGraphWidget::buttonPressedYone(), BandedGraphWidget::buttonPressedYtwo(), COptItem::compile(), CQReportListItem::CQReportListItem(), CSEDMLExporter::createDataGenerators(), COutputAssistant::createDefaultOutput(), CPlotSpecification::createDefaultPlot(), CMMLOutput::createParameterMapping(), COutputAssistant::createPlot(), CQEventDM::data(), CQOptimizationResult::enterProtected(), CQFittingResult::enterProtected(), CQSelectionWizardPage::fillTree(), findObjectByDisplayName(), CArrayAnnotation::getAnnotationsString(), CEvaluationNodeObject::getDisplayString(), CMathMl::getMMLName(), getObject(), CFittingPoint::getObjectDisplayName(), CCopasiObjectReference< C_FLOAT64 >::getObjectDisplayName(), CArrayElementReference::getObjectDisplayName(), CReaction::getObjectDisplayName(), COptItem::getObjectDisplayName(), CEvent::getObjectDisplayName(), CArrayAnnotation::getObjectDisplayName(), CMetab::getObjectDisplayName(), CCopasiParameter::getObjectDisplayName(), getObjectDisplayName(), CSensItem::getSingleObjectDisplayName(), SEDMLUtils::getXPathForObject(), CScanWidgetRandom::initFromObject(), CScanWidgetScan::initFromObject(), CScanItem::isValidScanItem(), CScanWidgetRandom::load(), CScanWidgetScan::load(), Curve2DWidget::LoadFromCurveSpec(), BandedGraphWidget::LoadFromCurveSpec(), HistoWidget::LoadFromCurveSpec(), CQEventWidget1::loadFromEvent(), CQUpdatesWidget::loadObjectsTable(), CQUpdatesWidget::loadOneTable(), CQFittingItemWidget::loadSelection(), CQExperimentData::loadTable(), SensitivitiesWidget::loadTask(), operator<<(), SEDMLImporter::readListOfPlotsFromSedMLOutput(), CQReportListItem::refreshText(), CQExperimentData::selectModelObject(), CQSimpleSelectionTree::selectObjects(), CQExpressionWidget::setExpression(), CQCrossSectionTaskWidget::setSingleObject(), SliderSettingsDialog::setSlider(), CQFittingItemWidget::setTableText(), CQSideCompoundWizardPage::slotAddButtonClicked(), CQEventWidget1::slotAddTarget(), SensitivitiesWidget::slotChooseSingleFunction(), SensitivitiesWidget::slotChooseSingleVariable(), SensitivitiesWidget::slotChooseSingleVariable2(), CQFittingItemWidget::slotLowerEdit(), CQSideCompoundWizardPage::slotRemoveButtonClicked(), CQEventWidget1::slotSelectObject(), CQExpressionWidget::slotSelectObject(), CQFittingItemWidget::slotUpperEdit(), CopasiSlider::updateLabel(), CMMLOutput::writeDifferentialEquations(), CDotOutput::writeEdge(), and CDotOutput::writeObjectNode().

217 {
218  std::string ret = "";
219 
220  if (mpObjectParent)
221  {
222  ret = mpObjectParent->getObjectDisplayName(regular, richtext);
223 
224  if (ret == "(CN)Root" ||
225  ret == "ModelList[]" ||
226  ret.substr(0, 7) == "(Model)")
227  {
228  ret = "";
229  }
230  }
231 
232  if (ret.length() >= 2)
233  if ((ret.substr(ret.length() - 2) == "[]") && (!isReference()))
234  {
235  ret.insert(ret.length() - 1, getObjectName());
236 
237  if (isNameVector() || isVector() || getObjectType() == "ParameterGroup")
238  ret += "[]";
239 
240  return ret;
241  }
242 
243  if ((ret.length() != 0) && (ret[ret.length() - 1] != '.'))
244  ret += ".";
245 
246  if (isNameVector() || isVector() || getObjectType() == "ParameterGroup")
247  ret += getObjectName() + "[]";
248  else if (isReference()
249  || getObjectType() == "Parameter"
250  || getObjectType() == getObjectName())
251  ret += getObjectName();
252  else
253  ret += "(" + getObjectType() + ")" + getObjectName();
254 
255  return ret;
256 }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
bool isNameVector() const
const std::string & getObjectName() const
const std::string & getObjectType() const
bool isReference() const
CCopasiContainer * mpObjectParent
bool isVector() const
const std::string & CCopasiObject::getObjectName ( ) const

Definition at line 258 of file CCopasiObject.cpp.

References mObjectName.

Referenced by CCopasiContainer::add(), CFunctionDB::addAndAdaptName(), CModelAdd::addCompartments(), CModelAdd::addEvents(), CExperimentSet::addExperiment(), CModelAdd::addMetabolites(), CModelAdd::addModelValues(), CModelAdd::addReactions(), CReportDefinition::addTableElement(), addToInitialValueMap(), SBMLImporter::areEqualFunctions(), CQReportDefinition::btnCopyReportClicked(), CQReportDefinition::btnDeleteReportClicked(), CEvaluationTree::calls(), CCopasiContainer::CCopasiContainer(), CFixLocalReactionParameters::changeModel(), CSBMLExporter::checkForODESpeciesInNonfixedCompartment(), CSBMLExporter::checkForPiecewiseFunctions(), CSBMLExporter::checkForUnsupportedFunctionCalls(), CSBMLExporter::checkForUnsupportedObjectReferences(), CFunctionAnalyzer::checkKineticFunction(), CModelAnalyzer::checkReaction(), CCopasiSelectionDialog::chooseCellMatrix(), CEventAssignment::compile(), CExperiment::compile(), CReaction::compile(), CMathObject::compileFlux(), CEvaluationTree::compileNodes(), CChemEqInterface::completeCompartments(), CReactionInterface::connectNonMetabolites(), CModel::convert2NonReversible(), CLRenderFlattener::convertGlobalToLocalStyle(), CMathExpression::convertToInitialExpression(), CQSpeciesDetail::copy(), ReactionsWidget1::copy(), CMathExpression::copy(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), FunctionWidget1::copyFunctionContentsToFunction(), CModelAdd::copyInitialExpression(), CQPlotSubwidget::copyPlot(), CModelAdd::copyTriggerExpression(), SBMLImporter::createCMetabFromSpecies(), CSBMLExporter::createCompartment(), SBMLImporter::createCReactionFromReaction(), CSEDMLExporter::createDataGenerators(), COutputAssistant::createDefaultOutput(), CSBMLExporter::createEvent(), SBMLImporter::createExpressionFromFunction(), CSBMLExporter::createFunctionDefinitions(), CSBMLExporter::createInitialAssignment(), CSBMLExporter::createKineticExpression(), CSBMLExporter::createKineticLaw(), CQLayoutsWidget::createLayoutWindow(), CModelExpansion::createLinearArray(), CFunction::createListOfParametersForMathML(), CSBMLExporter::createMetabolite(), CSBMLExporter::createParameter(), CMMLOutput::createParameterMapping(), CKinFunction::createParameters(), createParameterSetsForExperiment(), CSBMLExporter::createReaction(), CModelExpansion::createRectangularArray(), CSBMLExporter::createRule(), CSBMLExporter::createSBMLDocument(), CSEDMLExporter::createTimeCourseTask(), CCSPMethod::CSPOutput(), CQReportDM::data(), CQPlotDM::data(), CQFunctionDM::data(), CQReactionDM::data(), CQEventDM::data(), CQGlobalQuantityDM::data(), CQCompartmentDM::data(), CQSpecieDM::data(), CModelExpansion::duplicateCompartment(), CModelExpansion::duplicateEvent(), CModelExpansion::duplicateGlobalQuantity(), CModelExpansion::duplicateMetab(), CModelExpansion::duplicateReaction(), CExperimentObjectMap::elevateChildren(), CCopasiXMLParser::PlotItemElement::end(), CCopasiXMLParser::PlotSpecificationElement::end(), CCopasiXMLParser::ParameterGroupElement::end(), CCopasiXMLParser::ListOfFunctionsElement::end(), CCopasiXMLParser::ListOfParameterDescriptionsElement::end(), CQFittingResult::enterProtected(), expand_function_call(), CODEExporter::exportCompartments(), CSBMLExporter::exportEventAssignments(), CODEExporter::exportExpression(), CODEExporter::exportKineticFunction(), CODEExporter::exportMetabolites(), CODEExporter::exportModelEntityExpression(), CODEExporter::exportModelValues(), CODEExporter::exportReacParamsAndFuncs(), CODEExporter::exportSimulatedObject(), CODEExporterC::exportSingleFunction(), CODEExporter::exportSingleFunction(), CODEExporterC::exportTitleData(), CQMergingData::fillTree(), CQSimpleSelectionTree::filter(), SBMLImporter::findCorrespondingFunction(), SBMLImporter::findFunctionCalls(), CFunctionDB::findLoadFunction(), CModel::findMoiety(), CFunctionParameters::findParameterByName(), CArrayAnnotation::getAnnotationsString(), CReaction::getChildObjectUnits(), CModel::getChildObjectUnits(), CFitItem::getCrossValidations(), CEvaluationNodeCall::getData(), CReactionInterface::getDeletedParameters(), CParticleReference::getDirectDependencies(), CMetabNameInterface::getDisplayName(), CMathDependencyGraph::getDOTNodeId(), CFitItem::getExperiments(), CReactionInterface::getFunctionName(), ParameterTable::getListOfAllCompartmentNames(), ParameterTable::getListOfAllGlobalParameterNames(), CMathMl::getMMLName(), CLGraphicalObject::getModelObjectDisplayName(), CLGraphicalObject::getModelObjectName(), CModelParameterSet::getName(), CExperimentObjectMap::getName(), CModelParameter::getName(), CCopasiParameterGroup::getName(), CCopasiContainer::getObject(), CCopasiVectorReference< CType >::getObject(), CCopasiMatrixReference< CType >::getObject(), CReaction::getObject(), CCopasiObjectReference< C_FLOAT64 >::getObjectDisplayName(), CArrayElementReference::getObjectDisplayName(), CReaction::getObjectDisplayName(), CEvent::getObjectDisplayName(), CArrayAnnotation::getObjectDisplayName(), CCopasiParameter::getObjectDisplayName(), getObjectDisplayName(), CEventAssignment::getTargetKey(), Arguments::getTaskForName(), CLabel::getText(), CPlotItem::getTitle(), CCopasiParameterGroup::getUniqueParameterName(), Arguments::handleCommandLine(), hasLayout(), SBMLImporter::importFunctionDefinitions(), CQProgressItemText::initFromProcessReportItem(), CQProgressItemBar::initFromProcessReportItem(), CScanTask::initialize(), CCopasiTask::initialize(), CReaction::initializeParameters(), CFunction::initVariables(), CSBMLExporter::isEventAssignmentSBMLCompatible(), CSBMLExporter::isEventSBMLCompatible(), CQSimpleSelectionTree::isMetaboliteNameUnique(), CODEExporter::isModelEntityExpressionODEExporterCompatible(), CParticleReference::isPrerequisiteForContext(), CMetabNameInterface::isUnique(), CEFMMethod::isValidProblem(), FunctionWidget1::leave(), CQExperimentSelection::load(), CQTabWidget::load(), CQReportDefinition::load(), CQSpeciesDetail::load(), CQExpandModelData::load(), CMetab::load(), CMetabOld::load(), ObjectBrowserWidget::loadChild(), CQExperimentData::loadExperiment(), ObjectBrowserWidget::loadField(), CReactionInterface::loadMappingAndValues(), CQUpdatesWidget::loadObjectsTable(), CReaction::loadOld(), CReaction::loadOneRole(), CQSpeciesDetail::loadReactionTable(), CQReportDefinitionSelect::loadReportDefinitionVector(), CQFittingItemWidget::loadSelection(), FunctionWidget1::loadUsageTable(), main(), CModelMerging::mergeInExpression(), CODEExporter::modifyTreeForMassAction(), stress_test::normalizeAndSimplifyExpressions(), stress_test::normalizeFunctionDB(), operator<<(), CLGraphicalObject::operator=(), CCopasiParameterGroup::operator=(), CCopasiParameter::operator=(), CMetab::operator=(), CFunctionParameters::operator==(), operator==(), CHybridMethod::outputDebug(), CHybridMethodODE45::outputDebug(), CHybridMethodLSODA::outputDebug(), CQSimpleSelectionTree::populateTree(), CODEExporterC::preprocess(), CODEExporter::preprocess(), printNameForKey(), CModel::printParameterOverview(), CFitProblem::printResult(), CILDMModifiedMethod::printResult(), CCSPMethod::printResult(), CExperiment::printResult(), CExperiment::read(), CQParameterSetsDM::removeRows(), CQReportDM::removeRows(), CQLayoutsDM::removeRows(), CQFunctionDM::removeRows(), CQReactionDM::removeRows(), CQEventDM::removeRows(), CQGlobalQuantityDM::removeRows(), CQCompartmentDM::removeRows(), CQSpecieDM::removeRows(), SBMLImporter::removeUnusedFunctions(), CSBMLExporter::replace_local_parameters(), CModelExpansion::replaceInExpression(), CModelExpansion::replaceInMetab(), CSBMLExporter::replaceSpeciesReferences(), CSBMLExporter::restore_local_parameters(), CQTabWidget::save(), CQReportDefinition::save(), CQSpeciesDetail::save(), CQExperimentData::saveExperiment(), CCopasiXML::saveFunctionList(), CCopasiXML::saveLayoutList(), CCopasiXML::saveModel(), CCopasiXMLInterface::saveParameter(), CCopasiXML::savePlotList(), CCopasiXML::saveReportList(), CQFittingWidget::saveTask(), CCopasiXML::saveTaskList(), CQMatrixDialog::setArray(), CQPlotDM::setData(), CQFunctionDM::setData(), CQSpecieDM::setData(), CQLayoutView::setDataModel(), CODEExporterC::setExportNameOfFunction(), CReaction::setFunctionFromExpressionTree(), CSBMLExporter::setFunctionSBMLIds(), CChemEqElement::setMetabolite(), CReaction::setScalingFactor(), CSensMethod::setValue(), CModelMerging::simpleCall(), CQParameterOverviewWidget::slotBtnDelete(), FunctionWidget1::slotBtnDelete(), ReactionsWidget1::slotBtnDelete(), CQSpeciesDetail::slotBtnDelete(), CQCompartment::slotBtnDelete(), CQModelValue::slotBtnDelete(), CQExperimentData::slotCheckFrom(), CQExpandModelData::slotCompartmentActivated(), CQMoietiesTaskResult::slotCreateGlobalQuantity(), CQExperimentData::slotExperimentAdd(), ReactionsWidget1::slotNewFunction(), CQBrowserPaneDM::slotNotify(), CQExperimentData::slotOK(), CQSpeciesDetail::slotSwitchToReaction(), CCopasiXMLParser::SourceParameterElement::start(), CCopasiXMLParser::KineticLawElement::start(), test000058::test_bug1025_10(), test000058::test_bug1025_5(), test000093::test_bug1503_1(), test000093::test_bug1503_2(), test000052::test_bug988(), test_compare_utilities::test_copasi_function_expansion(), test000047::test_delay(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000035::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000032::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000040::test_hasOnlySubstanceUnits(), test000031::test_hasOnlySubstanceUnits(), test000029::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000034::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000082::test_import_delayAssignment_1(), test000082::test_import_delayAssignment_2(), test000082::test_import_delayAssignment_3(), test000082::test_import_delayAssignment_4(), test000082::test_import_delayAssignment_5(), test000082::test_import_delayAssignment_6(), test000082::test_import_delayAssignment_7(), test000082::test_import_delayAssignment_8(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_8(), test000095::test_import_l3_event_1(), test000095::test_import_l3_event_2(), test000095::test_import_l3_event_3(), test000095::test_import_l3_event_4(), test000095::test_import_l3_event_5(), test000087::test_import_reaction_flux_reference_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_8(), test000075::test_import_time_dependent_function_definition(), test000087::test_simulate_reaction_flux_reference_1(), test000059::test_unique_id_17(), test000059::test_unique_id_18(), test000059::test_unique_id_19(), test000059::test_unique_id_20(), test000059::test_unique_id_21(), test000059::test_unique_id_21_2(), CEvaluationNodeObject::toAST(), CModelExpansion::updateExpression(), updateLayoutList(), CQNewMainWindow::updateLayoutList(), CModelParameter::updateModel(), validate(), CReactionInterface::writeBackToReaction(), CMMLOutput::writeDifferentialEquations(), CFunction::writeMathML(), and CMMLOutput::writeRHS().

258 {return mObjectName;}
std::string mObjectName
CCopasiContainer * CCopasiObject::getObjectParent ( ) const

Definition at line 276 of file CCopasiObject.cpp.

References mpObjectParent.

Referenced by addInitialAssignmentsToModel(), CCompartment::addMetabolite(), CReportDefinition::addTableElement(), applyAttributeChange(), SBMLImporter::applyStoichiometricExpressions(), CMathDependencyNode::buildUpdateSequence(), CLyapWolfMethod::calculate(), CEFMAlgorithm::calculateFluxModes(), CSBMLExporter::checkForUnsupportedObjectReferences(), CMetab::CMetab(), CExpression::compile(), CMathObject::compileDependentMass(), CMathObject::compileFlux(), CMathObject::compileInitialValue(), CMathObject::compileParticleFlux(), CMathObject::compilePropensity(), CMathObject::compileRate(), CMathObject::compileTotalMass(), CMathObject::compileValue(), contains_necessary_mass_action_elements(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), CExpression::createInitialExpression(), SBMLImporter::doMapping(), CLLayoutRenderer::draw_layout(), elevate(), CCopasiXMLParser::GroupElement::end(), CSBMLExporter::exportEventAssignments(), CODEExporter::exportExpression(), CODEExporter::exportModelEntityExpression(), CODEExporter::exportSimulatedObject(), CModelExpansion::expressionContainsObject(), SliderDialog::fillSliderBox(), CQSimpleSelectionTree::filter(), CSBMLExporter::findModelEntityDependencies(), CArrayElementReference::getCN(), CCopasiParameter::getCN(), CModel::getCorrespondingTransientObject(), CExperimentObjectMap::CDataColumn::getDefaultScale(), CParticleReference::getDirectDependencies(), CMathDependencyGraph::getDOTNodeId(), CObjectLists::getListOfConstObjects(), CMathMl::getMMLName(), CCopasiVectorReference< CType >::getObject(), CCopasiMatrixReference< CType >::getObject(), CReaction::getObject(), getObjectAncestor(), getObjectDataModel(), CCopasiObjectReference< C_FLOAT64 >::getObjectDisplayName(), CArrayElementReference::getObjectDisplayName(), CArrayAnnotation::getObjectDisplayName(), CCopasiParameter::getObjectDisplayName(), CParticleReference::getPrerequisites(), CArrayElementReference::getValuePointer(), CMathContainer::hasDependencies(), CLGraphicalObject::hasValidModelReference(), CSBMLExporter::hasVolumeAssignment(), CScanMethod::init(), CSSAMethod::initialize(), CFitMethod::initialize(), CEFMMethod::initialize(), CFitProblem::initialize(), CEFMAlgorithm::initialize(), COptProblem::initialize(), COptMethodSS::initialize(), CBitPatternMethod::initialize(), CBitPatternTreeMethod::initialize(), COptMethod::initialize(), SBMLImporter::isConstantFlux(), SBMLImporter::isMassActionExpression(), CODEExporter::isModelEntityExpressionODEExporterCompatible(), CParticleReference::isPrerequisiteForContext(), CModel::isStateVariable(), CScanMethod::loop(), CModelMerging::mergeInExpression(), CReaction::object2variable(), operator<<(), CLNAProblem::printResult(), CEFMProblem::printResult(), CMCAProblem::printResult(), CLyapProblem::printResult(), CSteadyStateMethod::process(), CSBMLExporter::replace_local_parameters(), CModelExpansion::replaceInExpression(), CSBMLExporter::replaceSpeciesReferences(), SEDMLUtils::resolveXPath(), SBMLImporter::setCorrectUsage(), CEventAssignment::setObjectParent(), CEvent::setObjectParent(), CQEventWidget1::slotAddTarget(), CQFittingItemWidget::slotReset(), CQEventWidget1::slotSelectObject(), test000093::test_bug1503_1(), test000093::test_bug1503_2(), test000052::test_bug988(), test000047::test_delay(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000040::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000031::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000032::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000035::test_hasOnlySubstanceUnits(), test000034::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000029::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000082::test_import_delayAssignment_1(), test000082::test_import_delayAssignment_2(), test000082::test_import_delayAssignment_3(), test000082::test_import_delayAssignment_4(), test000082::test_import_delayAssignment_5(), test000082::test_import_delayAssignment_6(), test000082::test_import_delayAssignment_7(), test000082::test_import_delayAssignment_8(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_8(), test000095::test_import_l3_event_1(), test000095::test_import_l3_event_2(), test000095::test_import_l3_event_3(), test000095::test_import_l3_event_4(), test000095::test_import_l3_event_5(), test000087::test_import_reaction_flux_reference_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_8(), test000075::test_import_time_dependent_function_definition(), test000087::test_simulate_reaction_flux_reference_1(), CEvaluationNodeObject::toAST(), CModelExpansion::updateExpression(), and CModelParameter::updateModel().

276 {return mpObjectParent;}
CCopasiContainer * mpObjectParent
const std::string & CCopasiObject::getObjectType ( ) const
const CObjectInterface::ObjectSet & CCopasiObject::getPrerequisites ( ) const
virtual

Retrieve the prerequisites, i.e., the objects which need to be evaluated before this.

Returns
const CObjectInterface::ObjectSet & prerequisites

Implements CObjectInterface.

Reimplemented in CParticleReference, and CMathExpression.

Definition at line 321 of file CCopasiObject.cpp.

References mDependencies.

Referenced by isPrerequisiteForContext().

322 {
323  return * reinterpret_cast< const CObjectInterface::ObjectSet * >(&mDependencies);
324 }
DataObjectSet mDependencies
std::set< const CObjectInterface * > ObjectSet
Refresh * CCopasiObject::getRefresh ( ) const
virtual
std::string CCopasiObject::getUnits ( ) const
virtual

Retrieve the units of the object.

Returns
std::string units

Reimplemented in CCopasiContainer.

Definition at line 637 of file CCopasiObject.cpp.

References CCopasiContainer::getChildObjectUnits(), and mpObjectParent.

Referenced by CopasiPlot::setAxisUnits().

638 {
639  if (mpObjectParent != NULL)
640  return mpObjectParent->getChildObjectUnits(this);
641 
642  return "";
643 }
virtual std::string getChildObjectUnits(const CCopasiObject *pObject) const
CCopasiContainer * mpObjectParent
UpdateMethod * CCopasiObject::getUpdateMethod ( ) const

Definition at line 624 of file CCopasiObject.cpp.

References mpUpdateMethod.

Referenced by COptItem::compile().

625 {return mpUpdateMethod;}
UpdateMethod * mpUpdateMethod
const CCopasiObject * CCopasiObject::getValueObject ( ) const
virtual
void * CCopasiObject::getValuePointer ( ) const
virtual
bool CCopasiObject::hasCircularDependencies ( CCopasiObject::DataObjectSet candidates,
CCopasiObject::DataObjectSet verified,
const DataObjectSet context 
) const

If called with an empty set it will check whether the current object and all its dependencies (including all indirect) form a circular dependency. If called with a non empty set it check whether the candidates plus the current object and all its dependencies form a circular dependency.

Parameters
DataObjectSet& dependencies
DataObjectSet& verified
constDataObjectSet & context
Returns
bool hasCircularDependencies

Definition at line 395 of file CCopasiObject.cpp.

References getDirectDependencies().

Referenced by CMetab::compileIsInitialConcentrationChangeAllowed(), and dependsOn().

398 {
399  bool hasCircularDependencies = false;
400 
401  if (verified.count(this) != 0)
402  return hasCircularDependencies;
403 
404  const CCopasiObject::DataObjectSet & DirectDependencies = getDirectDependencies(context);
405  CCopasiObject::DataObjectSet::const_iterator it = DirectDependencies.begin();
406  CCopasiObject::DataObjectSet::const_iterator end = DirectDependencies.end();
407 
408  std::pair<CCopasiObject::DataObjectSet::iterator, bool> Inserted;
409 
410  // Dual purpose insert
411  Inserted = candidates.insert(this);
412 
413  // Check whether the insert was successful, if not
414  // the object "this" was among the candidates. Thus we have a detected
415  // a circular dependency
416  if (Inserted.second)
417  {
418  for (; it != end && !hasCircularDependencies; ++it)
419  {
420  hasCircularDependencies = (*it)->hasCircularDependencies(candidates, verified, context);
421  }
422 
423  // Remove the inserted object this from the candidates to avoid any
424  // side effects.
425  candidates.erase(this);
426  }
427  else
428  hasCircularDependencies = true;
429 
430  // The element has been checked and does not need to be checked again.
431  verified.insert(this);
432 
434 }
bool hasCircularDependencies(DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
virtual const DataObjectSet & getDirectDependencies(const DataObjectSet &context=DataObjectSet()) const
std::set< const CCopasiObject * > DataObjectSet
bool CCopasiObject::hasUpdateMethod ( ) const

Definition at line 627 of file CCopasiObject.cpp.

References mDefaultUpdateMethod, and mpUpdateMethod.

Referenced by CDotOutput::writeDotRecursively(), and CDotOutput::writeObjectNode().

UpdateMethod * mpUpdateMethod
static UpdateMethod mDefaultUpdateMethod
bool CCopasiObject::isArray ( ) const

Definition at line 599 of file CCopasiObject.cpp.

References Array, and mObjectFlag.

Referenced by CQSimpleSelectionTree::filter().

600 {return (0 < (mObjectFlag & Array));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isContainer ( ) const

Comparison operator which can be used to sort objects based on their dependencies If the object *lhs is a dependency of *rhs and must be evaluated first the operator return true.

Parameters
constCCopasiObject * lhs
constCCopasiObject * rhs
Returns
bool isLess

Definition at line 560 of file CCopasiObject.cpp.

References Container, and mObjectFlag.

Referenced by CCopasiObject(), CQUpdatesWidget::fillRefreshsMapRecursively(), CODEExporter::findObjectFromRefresh(), ObjectBrowserWidget::loadChild(), ObjectBrowserWidget::loadField(), operator<<(), and CDotOutput::writeDotRecursively().

561 {return (0 < (mObjectFlag & Container));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isDataModel ( ) const

Definition at line 602 of file CCopasiObject.cpp.

References DataModel, and mObjectFlag.

Referenced by getCN(), and getObjectDataModel().

603 {return (0 < (mObjectFlag & DataModel));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isMatrix ( ) const

Definition at line 566 of file CCopasiObject.cpp.

References Matrix, and mObjectFlag.

Referenced by operator<<().

567 {return (0 < (mObjectFlag & Matrix));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isNameVector ( ) const
bool CCopasiObject::isNonUniqueName ( ) const

Definition at line 587 of file CCopasiObject.cpp.

References mObjectFlag, and NonUniqueName.

588 {return (0 < (mObjectFlag & NonUniqueName));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isPrerequisiteForContext ( const CObjectInterface pObject,
const CMath::SimulationContextFlag context,
const CObjectInterface::ObjectSet changedObjects 
) const
virtual

Check whether a given object is a prerequisite for a context.

Parameters
constCObjectInterface * pObject
constCMath::SimulationContextFlag & context
constCObjectInterface::ObjectSet & changedObjects
Returns
bool isPrerequisiteForContext

Implements CObjectInterface.

Reimplemented in CParticleReference, CDependentNumberReference, CConcentrationReference, and CTotalNumberReference.

Definition at line 326 of file CCopasiObject.cpp.

References getPrerequisites().

329 {
330  // If the object is among the changed objects it does not depend on anything else.
331  if (changedObjects.find(this) != changedObjects.end())
332  return false;
333 
334 #ifdef COPASI_DEBUG
335  const CObjectInterface::ObjectSet & Prerequisites = getPrerequisites();
336 
337  // This method should only be called for objects which are prerequisites.
338  // We check for this only in debug mode.
339  assert(Prerequisites.find(pObject) != Prerequisites.end());
340 #endif // COPASI_DEBUG
341 
342  return true;
343 }
virtual const CObjectInterface::ObjectSet & getPrerequisites() const
std::set< const CObjectInterface * > ObjectSet
bool CCopasiObject::isReference ( ) const

Definition at line 572 of file CCopasiObject.cpp.

References mObjectFlag, and Reference.

Referenced by CSBMLExporter::checkForUnsupportedObjectReferences(), contains_necessary_mass_action_elements(), CModelAdd::copyDelayExpression(), CModelAdd::copyEventAssignmentExpression(), CModelAdd::copyExpression(), CModelAdd::copyInitialExpression(), CModelAdd::copyTriggerExpression(), SBMLImporter::doMapping(), CODEExporter::exportExpression(), CODEExporter::exportModelEntityExpression(), CODEExporter::exportSimulatedObject(), CSBMLExporter::findModelEntityDependencies(), getObjectDisplayName(), SBMLImporter::isConstantFlux(), SBMLImporter::isMassActionExpression(), CODEExporter::isModelEntityExpressionODEExporterCompatible(), CModelMerging::mergeInExpression(), operator<<(), CSBMLExporter::replaceSpeciesReferences(), test000093::test_bug1503_1(), test000093::test_bug1503_2(), test000052::test_bug988(), test000047::test_delay(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000032::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000034::test_hasOnlySubstanceUnits(), test000035::test_hasOnlySubstanceUnits(), test000038::test_hasOnlySubstanceUnits(), test000039::test_hasOnlySubstanceUnits(), test000036::test_hasOnlySubstanceUnits(), test000040::test_hasOnlySubstanceUnits(), test000041::test_hasOnlySubstanceUnits(), test000021::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000022::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000037::test_hasOnlySubstanceUnits(), test000024::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000026::test_hasOnlySubstanceUnits(), test000027::test_hasOnlySubstanceUnits(), test000028::test_hasOnlySubstanceUnits(), test000029::test_hasOnlySubstanceUnits(), test000030::test_hasOnlySubstanceUnits(), test000031::test_hasOnlySubstanceUnits(), test000082::test_import_delayAssignment_1(), test000082::test_import_delayAssignment_2(), test000082::test_import_delayAssignment_3(), test000082::test_import_delayAssignment_4(), test000082::test_import_delayAssignment_5(), test000082::test_import_delayAssignment_6(), test000082::test_import_delayAssignment_7(), test000082::test_import_delayAssignment_8(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_event_assignment_expression_and_hasOnlySubstanceUnits_8(), test000095::test_import_l3_event_1(), test000095::test_import_l3_event_2(), test000095::test_import_l3_event_3(), test000095::test_import_l3_event_4(), test000095::test_import_l3_event_5(), test000087::test_import_reaction_flux_reference_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_3(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_5(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_7(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_8(), test000075::test_import_time_dependent_function_definition(), test000087::test_simulate_reaction_flux_reference_1(), and CEvaluationNodeObject::toAST().

573 {return (0 < (mObjectFlag & Reference));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isRoot ( ) const

Definition at line 605 of file CCopasiObject.cpp.

References mObjectFlag, and Root.

Referenced by CCopasiContainer::getObject().

606 {return (0 < (mObjectFlag & Root));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isSeparator ( ) const

Definition at line 596 of file CCopasiObject.cpp.

References mObjectFlag, and Separator.

597 {return (0 < (mObjectFlag & Separator));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isStaticString ( ) const

Definition at line 590 of file CCopasiObject.cpp.

References mObjectFlag, and StaticString.

Referenced by CReaction::getObject(), and setObjectName().

591 {return (0 < (mObjectFlag & StaticString));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isValueBool ( ) const
bool CCopasiObject::isValueDbl ( ) const
bool CCopasiObject::isValueInt ( ) const
bool CCopasiObject::isValueInt64 ( ) const

Definition at line 581 of file CCopasiObject.cpp.

References mObjectFlag, and ValueInt64.

Referenced by CQSimpleSelectionTree::filter().

582 {return (0 < (mObjectFlag & ValueInt64));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isValueString ( ) const

Definition at line 593 of file CCopasiObject.cpp.

References mObjectFlag, and ValueString.

594 {return (0 < (mObjectFlag & ValueString));}
unsigned C_INT32 mObjectFlag
bool CCopasiObject::isVector ( ) const
bool CCopasiObject::mustBeDeleted ( const DataObjectSet deletedObjects) const
virtual

Check whether an object must be deleted because its prerequisites can no longer be fulfilled due to the given deleted objects

Parameters
constDataObjectSet & deletedObjects
Returns
bool mustBeDeleted

Reimplemented in CMetab, CEvent, CModelEntity, and CReaction.

Definition at line 369 of file CCopasiObject.cpp.

References mDependencies.

370 {
371  bool MustBeDeleted = false;
372 
373  DataObjectSet::const_iterator it = mDependencies.begin();
374  DataObjectSet::const_iterator end = mDependencies.end();
375 
376  for (; it != end; ++it)
377  {
378  if (deletedObjects.find(*it) != deletedObjects.end())
379  {
380  MustBeDeleted = true;
381  break;
382  }
383  }
384 
385  return MustBeDeleted;
386 }
DataObjectSet mDependencies
void CCopasiObject::print ( std::ostream *  ostream) const
virtual

This is the output method for any object. The default implementation provided with CCopasiObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.

Parameters
std::ostream* ostream

Implements CObjectInterface.

Reimplemented in CCopasiParameterGroup, CLReactionGlyph, COptProblem, CLGeneralGlyph, CEigen, CCopasiParameter, CArrayAnnotation, CLMetabReferenceGlyph, CCopasiVectorReference< CType >, CCopasiMethod, CLayout, CLTextGlyph, CCopasiProblem, CCopasiTask::CResult, CSteadyStateTask, CSensProblem, CCrossSectionProblem, CLGraphicalObject, CCopasiTask::CDescription, CLReferenceGlyph, CLNAProblem, CMCAProblem, CFitProblem, CSensTask, CLCompartmentGlyph, CCopasiTimer, CArrayElementReference, COscillationProblem, CCopasiObjectReference< CType >, CCopasiObjectReference< C_FLOAT64 >, CLMetabGlyph, CLGlyphWithCurve, and CCopasiStaticString.

Definition at line 101 of file CCopasiObject.cpp.

101 {(*ostream) << (*this);}
void CCopasiObject::removeDirectDependency ( const CCopasiObject pObject)

Remove an object from the direct dependencies

Parameters
constCCopasiObject * pObject

Definition at line 315 of file CCopasiObject.cpp.

References mDependencies.

Referenced by CReaction::setFunction(), and CReaction::setFunctionFromExpressionTree().

316 {
317  mDependencies.erase(pObject);
318  return;
319 }
DataObjectSet mDependencies
void CCopasiObject::setDirectDependencies ( const DataObjectSet directDependencies)
bool CCopasiObject::setObjectName ( const std::string &  name)

Set the name of the object. Note: An attempt set the name to "" results in the name being set to "No Name".

Parameters
conststd::string & name
Returns
success

Definition at line 158 of file CCopasiObject.cpp.

References CCopasiObjectName::escape(), getCN(), CCopasiContainer::getObject(), CRenameHandler::handle(), isNameVector(), isStaticString(), mObjectName, mpObjectParent, and smpRenameHandler.

Referenced by CFunctionDB::addAndAdaptName(), CExperimentSet::addExperiment(), CQReportDefinition::btnCopyReportClicked(), CCopasiMethod::CCopasiMethod(), CModelEntity::compile(), CMetab::compile(), CLRenderFlattener::convertGlobalToLocalStyle(), CMathExpression::convertToInitialExpression(), CQPlotSubwidget::copyPlot(), CPlotItem::CPlotItem(), SBMLImporter::createCFunctionFromFunctionDefinition(), SBMLImporter::createCModelFromSBMLDocument(), SBMLImporter::createCReactionFromReaction(), COutputDefinitionVector::createPlotSpec(), CReportDefinitionVector::createReportDefinition(), CFitProblem::elevateChildren(), CCompartment::initObjects(), CMetab::initObjects(), CModel::initObjects(), CCompartment::load(), CReaction::load(), CFunctionParameter::load(), CModel::load(), CFunction::load(), CConfigurationFile::CXML::load(), CMetab::load(), CMetabOld::load(), CCopasiStaticString::operator=(), CLGraphicalObject::operator=(), CCopasiParameterGroup::operator=(), CCopasiParameter::operator=(), CMetab::operator=(), SBMLImporter::renameMassActionParameters(), CModelExpansion::replaceInMetab(), CQTabWidget::save(), CQReportDefinition::save(), CQExperimentData::saveExperiment(), CQReportDM::setData(), CQPlotDM::setData(), CQFunctionDM::setData(), CQReactionDM::setData(), CQEventDM::setData(), CQGlobalQuantityDM::setData(), CQCompartmentDM::setData(), CQSpecieDM::setData(), CEvent::setDelayExpressionPtr(), CEventAssignment::setExpressionPtr(), CModelEntity::setExpressionPtr(), CReaction::setFunctionFromExpressionTree(), CModelEntity::setInitialExpressionPtr(), CChemEqElement::setMetabolite(), CEvent::setPriorityExpressionPtr(), CModelEntity::setStatus(), CEventAssignment::setTargetKey(), CPlotItem::setTitle(), CEvent::setTriggerExpressionPtr(), CQParameterOverviewWidget::slotBtnCopy(), CQParameterOverviewWidget::slotBtnNew(), CQLayoutsWidget::slotBtnNewClicked(), CQParameterOverviewWidget::slotBtnSaveAs(), CFunction::splitFunction(), CCopasiXMLParser::ModelParameterSetElement::start(), CCopasiXMLParser::SourceParameterElement::start(), CCopasiXMLParser::ReactionElement::start(), CCopasiXMLParser::EventElement::start(), CCopasiXMLParser::ModelElement::start(), CCopasiXMLParser::PlotSpecificationElement::start(), CCopasiXMLParser::MethodElement::start(), CCopasiXMLParser::ReportElement::start(), CCopasiXMLParser::ParameterDescriptionElement::start(), CCopasiXMLParser::FunctionElement::start(), and CCopasiXMLParser::LayoutElement::start().

159 {
160  std::string Name = (name == "") ? "No Name" : name;
161 
162  if (!isStaticString())
163  {
164  // We need to ensure that the name does not include any whitespace character except ' ' (space),
165  // i.e., we convert '\t' (tab), '\n' (newline) and '\r' (return) to ' ' (space).
166  std::string::iterator it = Name.begin();
167  std::string::iterator end = Name.end();
168 
169  for (; it != end; ++it)
170  {
171  switch (*it)
172  {
173  case '\t':
174  case '\n':
175  case '\r':
176  *it = ' ';
177  break;
178 
179  default:
180  break;
181  }
182  }
183  }
184 
185  if (Name == mObjectName) return true;
186 
187  if (mpObjectParent &&
190  return false;
191 
193  {
194  std::string oldCN = this->getCN();
195  mObjectName = Name;
196  std::string newCN = this->getCN();
197  smpRenameHandler->handle(oldCN, newCN);
198 
199  //TODO performance considerations.
200  //Right now after every rename the CNs are checked. In some cases
201  //we may know that this is not necessary
202  }
203  else
204  {mObjectName = Name;}
205 
206  if (mpObjectParent)
207  {
208  mpObjectParent->CCopasiContainer::remove(this);
209  mpObjectParent->CCopasiContainer::add(this, false);
210  }
211 
212  return true;
213 }
bool isNameVector() const
virtual CCopasiObjectName getCN() const
virtual void handle(const std::string &oldCN, const std::string &newCN) const =0
static CRenameHandler * smpRenameHandler
static std::string escape(const std::string &name)
std::string mObjectName
CCopasiContainer * mpObjectParent
bool isStaticString() const
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
bool CCopasiObject::setObjectParent ( const CCopasiContainer pParent)
virtual
void CCopasiObject::setObjectValue ( const C_FLOAT64 value)
void CCopasiObject::setObjectValue ( const C_INT32 value)

Definition at line 618 of file CCopasiObject.cpp.

619 {(*mpUpdateMethod)(value);}
void CCopasiObject::setObjectValue ( const bool &  value)

Definition at line 621 of file CCopasiObject.cpp.

622 {(*mpUpdateMethod)(value);}
template<class CType >
void CCopasiObject::setRefresh ( CType *  pType,
void(CType::*)(void method 
)
inline

Definition at line 544 of file CCopasiObject.h.

References Refresh::isEqual(), mpRefresh, and pdelete.

Referenced by CCopasiTimer::CCopasiTimer(), CMetab::compile(), CReaction::compile(), CMathTrigger::CRootFinder::initObjects(), CExpression::initObjects(), CMoiety::initObjects(), CModelEntity::initObjects(), CMetab::initObjects(), CReaction::initObjects(), CModelEntity::setStatus(), and CMetab::setStatus().

546  {
547  Refresh * pRefresh =
548  new RefreshTemplate< CType >(pType, method);
549 
550  if (mpRefresh != NULL &&
551  mpRefresh->isEqual(pRefresh))
552  {
553  delete pRefresh;
554  }
555  else
556  {
558  mpRefresh = pRefresh;
559  }
560 
561  return;
562  }
#define pdelete(p)
Definition: copasi.h:215
virtual bool isEqual(Refresh *const rhs) const
Refresh * mpRefresh
static void CCopasiObject::setRenameHandler ( CRenameHandler rh)
inlinestatic

Definition at line 568 of file CCopasiObject.h.

References smpRenameHandler.

Referenced by CCopasiDataModel::CCopasiDataModel(), and CCopasiDataModel::~CCopasiDataModel().

569  {smpRenameHandler = rh;}
static CRenameHandler * smpRenameHandler
template<class CType >
void CCopasiObject::setUpdateMethod ( CType *  pType,
void(CType::*)(const C_FLOAT64 &)  method 
)
inline

Definition at line 501 of file CCopasiObject.h.

References mDefaultUpdateMethod, mpUpdateMethod, and pdelete.

Referenced by CCopasiObjectReference< CType >::CCopasiObjectReference(), CTrajectoryProblem::initObjects(), CTSSAProblem::initObjects(), and CModelEntity::initObjects().

503  {
506 
508  new SpecificUpdateMethod< CType, C_FLOAT64 >(pType, method);
509 
510  return;
511  }
#define pdelete(p)
Definition: copasi.h:215
UpdateMethod * mpUpdateMethod
static UpdateMethod mDefaultUpdateMethod
template<class CType >
void CCopasiObject::setUpdateMethod ( CType *  pType,
void(CType::*)(const C_INT32 &)  method 
)
inline

Definition at line 514 of file CCopasiObject.h.

References mDefaultUpdateMethod, mpUpdateMethod, and pdelete.

516  {
519 
521  new SpecificUpdateMethod< CType, C_INT32 >(pType, method);
522 
523  return;
524  }
#define pdelete(p)
Definition: copasi.h:215
UpdateMethod * mpUpdateMethod
static UpdateMethod mDefaultUpdateMethod
template<class CType >
void CCopasiObject::setUpdateMethod ( CType *  pType,
void(CType::*)(const bool &)  method 
)
inline

Definition at line 527 of file CCopasiObject.h.

References mDefaultUpdateMethod, mpUpdateMethod, and pdelete.

529  {
532 
534  new SpecificUpdateMethod< CType, bool >(pType, method);
535 
536  return;
537  }
#define pdelete(p)
Definition: copasi.h:215
UpdateMethod * mpUpdateMethod
static UpdateMethod mDefaultUpdateMethod

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CCopasiObject o 
)
friend

Definition at line 645 of file CCopasiObject.cpp.

646 {
647  os << "Name: " << o.getObjectDisplayName() << std::endl;
648  os << "Type: " << o.getObjectType() << std::endl;
649  os << "Container: " << o.isContainer() << std::endl;
650  os << "Vector: " << o.isVector() << std::endl;
651  os << "VectorN: " << o.isNameVector() << std::endl;
652  os << "Matrix: " << o.isMatrix() << std::endl;
653  os << "Reference: " << o.isReference() << std::endl;
654  os << "Bool: " << o.isValueBool() << std::endl;
655  os << "Int: " << o.isValueInt() << std::endl;
656  os << "Dbl: " << o.isValueDbl() << std::endl;
657 
658  return os;
659 }
bool isContainer() const
bool isValueInt() const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
bool isNameVector() const
const std::string & getObjectType() const
bool isMatrix() const
bool isReference() const
bool isValueBool() const
bool isVector() const
bool isValueDbl() const

Member Data Documentation

const C_FLOAT64 CCopasiObject::DummyValue = 0.0
staticprivate

Class CCopasiObject

This class is the base class for all global accessible objects in COPASI.

Copyright Stefan Hoops 2002

Definition at line 276 of file CCopasiObject.h.

UpdateMethod CCopasiObject::mDefaultUpdateMethod
staticprivate

Definition at line 278 of file CCopasiObject.h.

Referenced by hasUpdateMethod(), setUpdateMethod(), and ~CCopasiObject().

DataObjectSet CCopasiObject::mDependencies
private

A list of all objects the object depends on directly, i.e, the objects which are used to calculate the object.

Definition at line 268 of file CCopasiObject.h.

Referenced by addDirectDependency(), clearDirectDependencies(), getDirectDependencies(), getPrerequisites(), mustBeDeleted(), removeDirectDependency(), and setDirectDependencies().

unsigned C_INT32 CCopasiObject::mObjectFlag
private
std::string CCopasiObject::mObjectName
private

Definition at line 253 of file CCopasiObject.h.

Referenced by getCN(), getObjectName(), and setObjectName().

std::string CCopasiObject::mObjectType
private

Definition at line 255 of file CCopasiObject.h.

Referenced by getCN(), and getObjectType().

CCopasiStaticString* CCopasiObject::mpObjectDisplayName
mutableprivate

Definition at line 259 of file CCopasiObject.h.

Referenced by getObject(), and ~CCopasiObject().

CCopasiContainer* CCopasiObject::mpObjectParent
private
Refresh* CCopasiObject::mpRefresh
private

Definition at line 274 of file CCopasiObject.h.

Referenced by clearRefresh(), getRefresh(), setRefresh(), and ~CCopasiObject().

UpdateMethod* CCopasiObject::mpUpdateMethod
private

Definition at line 272 of file CCopasiObject.h.

Referenced by getUpdateMethod(), hasUpdateMethod(), setUpdateMethod(), and ~CCopasiObject().

CRenameHandler * CCopasiObject::smpRenameHandler = NULL
staticprotected

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