COPASI API  4.16.103
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CCopasiNode< _Data > Class Template Reference

#include <CCopasiNode.h>

Inheritance diagram for CCopasiNode< _Data >:
Inheritance graph
[legend]
Collaboration diagram for CCopasiNode< _Data >:
Collaboration graph
[legend]

Public Types

typedef _Data Data
 

Public Member Functions

virtual bool addChild (CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
 
bool addSibling (CCopasiNode< Data > *pSibling, CCopasiNode< Data > *pAfter=NULL)
 
 CCopasiNode (CCopasiNode< Data > *pParent=NULL)
 
 CCopasiNode (const CCopasiNode< Data > &src)
 
 CCopasiNode (const Data &data, CCopasiNode< Data > *pParent=NULL)
 
bool deleteChildren ()
 
CCopasiNode< Data > * getChild ()
 
const CCopasiNode< Data > * getChild () const
 
CCopasiNode< Data > * getChild (const size_t &index)
 
const CCopasiNode< Data > * getChild (const size_t &index) const
 
virtual const DatagetData () const
 
CCopasiNode< Data > * getNext ()
 
const CCopasiNode< Data > * getNext () const
 
CCopasiNode< Data > * getNextNonChild ()
 
const CCopasiNode< Data > * getNextNonChild () const
 
size_t getNumChildren () const
 
CCopasiNode< Data > * getParent ()
 
const CCopasiNode< Data > * getParent () const
 
CCopasiNode< Data > * getSibling ()
 
const CCopasiNode< Data > * getSibling () const
 
virtual bool removeChild (CCopasiNode< Data > *pChild)
 
virtual bool setData (const Data &data)
 
virtual ~CCopasiNode ()
 

Protected Member Functions

bool setChild (CCopasiNode< Data > *pChild)
 
bool setParent (CCopasiNode< Data > *pParent)
 
bool setSibling (CCopasiNode< Data > *pSibling)
 

Protected Attributes

Data mData
 

Private Member Functions

bool removeSibling (CCopasiNode< Data > *pSibling)
 

Private Attributes

CCopasiNode< Data > * mpChild
 
CCopasiNode< Data > * mpParent
 
CCopasiNode< Data > * mpSibling
 

Detailed Description

template<class _Data>
class CCopasiNode< _Data >

CCopasiNode class. The class CCopasiNode is describes a node of the CCopasiTree.

Created for COPASI by Stefan Hoops 2003 The class CCopasiNode is the interface used by the template class CCopasiTree< class Node> to manage the nodes of a tree. Actual implementation of nodes must be derived from CCopasiNode for the tree to operate properly.

Definition at line 39 of file CCopasiNode.h.

Member Typedef Documentation

template<class _Data>
typedef _Data CCopasiNode< _Data >::Data

Definition at line 42 of file CCopasiNode.h.

Constructor & Destructor Documentation

template<class _Data>
CCopasiNode< _Data >::CCopasiNode ( CCopasiNode< Data > *  pParent = NULL)
inline

Default constructor.

Parameters
CCopasiNode<Data > * pParent (default: NULL)

Definition at line 73 of file CCopasiNode.h.

73  :
74  mpParent(pParent),
75  mpChild(NULL),
76  mpSibling(NULL),
77  mData()
78  {}
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
CCopasiNode< _Data >::CCopasiNode ( const CCopasiNode< Data > &  src)
inline

Copy constructor.

Parameters
constCCopasiNode< Data > & src

Definition at line 84 of file CCopasiNode.h.

84  :
85  mpParent(src.mpParent),
86  mpChild(src.mpChild),
87  mpSibling(src.mpSibling),
88  mData(src.mData)
89  {}
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
CCopasiNode< _Data >::CCopasiNode ( const Data data,
CCopasiNode< Data > *  pParent = NULL 
)
inline

Specific constructor.

Parameters
constData & data
CCopasiNode<Data > * pParent (default: NULL)

Definition at line 96 of file CCopasiNode.h.

96  :
97  mpParent(pParent),
98  mpChild(NULL),
99  mpSibling(NULL),
100  mData(data)
101  {}
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
virtual CCopasiNode< _Data >::~CCopasiNode ( )
inlinevirtual

Destructor. Note: Within a tree the parent of this node has to be corrected.

Definition at line 107 of file CCopasiNode.h.

108  {
109  deleteChildren();
110 
111  if (mpParent) mpParent->removeChild(this);
112  }
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
bool deleteChildren()
Definition: CCopasiNode.h:199

Member Function Documentation

template<class _Data>
virtual bool CCopasiNode< _Data >::addChild ( CCopasiNode< Data > *  pChild,
CCopasiNode< Data > *  pAfter = NULL 
)
inlinevirtual

Add a child to a node. If pAfter == this the child will be inserted at the front of the list of children.

Parameters
CCopasiNode<Data > * pChild
CCopasiNode<Data > * pAfter (default: NULL appended to the list of children)
Returns
bool Success

Reimplemented in CEvaluationNodeCall, and CEvaluationNodeVector.

Definition at line 156 of file CCopasiNode.h.

Referenced by CEvaluationNodeVector::addChild(), CEvaluationNodeCall::addChild(), CCellDesignerImporter::addDependency(), CODEExporter::assembleSubTreeForMassAction(), CEvaluationNodeNormalizer::buildOperatorBranchFromChain(), CMathExpression::CMathExpression(), CQBrowserPaneDM::CNode::CNode(), CEvaluationNodeNormalizer::collectIdenticalBranches(), CMathEventN::CTrigger::CRoot::compile(), CMathEventN::CTrigger::compileAND(), CMathTrigger::compileAND(), CMathEventN::CTrigger::compileEQ(), CMathTrigger::compileEQ(), CMathTrigger::compileGE(), CMathTrigger::compileGT(), CMathEventN::CTrigger::compileLE(), CMathTrigger::compileLE(), CMathTrigger::compileLT(), CMathEventN::CTrigger::compileNE(), CMathTrigger::compileNE(), CMathEventN::CTrigger::compileNOT(), CMathTrigger::compileNOT(), CMathTrigger::compileOR(), CMathTrigger::compileXOR(), convertToCEvaluationNode(), CEvaluationNode::copyNode(), CNormalTranslation::createChain(), createItemPower(), createLogical(), CSBMLExporter::createMassActionExpression(), CMathExpression::createMassActionPart(), CNormalTranslation::createOperatorChain(), createProduct(), CDerive::deriveBranch(), SBMLImporter::divideByObject(), CNormalTranslation::elementaryElimination(), CNormalTranslation::elementaryEliminationMinus(), CNormalTranslation::eliminateDirectlyNestedFractions(), CNormalTranslation::eliminateNestedPowers(), CNormalTranslation::eliminatePowersOfFractions(), expand_function_calls(), CNormalTranslation::expandPowerBases(), CNormalTranslation::expandPowerExponents(), CNormalTranslation::expandPowerNodes(), CNormalTranslation::expandProducts(), CODEExporter::exportSingleFunction(), CNormalTranslation::factorize(), CEvaluationNodeNumber::fromAST(), CEvaluationNodeDelay::fromAST(), CEvaluationNodeChoice::fromAST(), CEvaluationNodeOperator::fromAST(), CEvaluationNodeLogical::fromAST(), CEvaluationNodeFunction::fromAST(), CMathTrigger::CRootFinder::getTrueExpression(), CNormalTranslation::matchPowerBases(), CNormalTranslation::matchSummands(), CODEExporter::modifyTreeForMassAction(), CNormalTranslation::multiply(), CSBMLExporter::multiplyByObject(), CNormalTranslation::newCancel(), CNormalTranslation::newEvaluateNumbers(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeChoice(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeDelay(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeFunction(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeLogical(), CEvaluationNodeNormalizer::normalizeDivideNode(), CEvaluationNodeNormalizer::normalizeMinusNode(), CEvaluationNodeNormalizer::normalizeModulusNode(), CEvaluationNodeNormalizer::normalizeMultiplyNode(), CEvaluationNodeNormalizer::normalizePlusNode(), CEvaluationNodeNormalizer::normalizePowerNode(), CNormalTranslation::product2fraction(), replace_variable_names(), CSBMLExporter::replaceSpeciesReferences(), CEvaluationNodeOperator::simplifyNode(), CEvaluationNodeFunction::simplifyNode(), CNormalTranslation::splitSum(), CNormalTranslation::swapNegativeNumbers(), CEvaluationNodeDelay::toAST(), CEvaluationNodeCall::toAST(), CEvaluationNodeOperator::toAST(), CEvaluationNodeLogical::toAST(), CEvaluationNodeFunction::toAST(), SBMLImporter::variables2objects(), and CReaction::variables2objects().

158  {
159  if (!pChild) return false; // Nothing to insert.
160 
161  if (pAfter == this)
162  {
163  pChild->setSibling(mpChild);
164  mpChild = NULL;
165  }
166 
167  if (mpChild)
168  return mpChild->addSibling(pChild, pAfter);
169 
170  mpChild = pChild;
171  mpChild->setParent(this);
172 
173  return true;
174  }
bool setSibling(CCopasiNode< Data > *pSibling)
Definition: CCopasiNode.h:448
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
template<class _Data>
bool CCopasiNode< _Data >::addSibling ( CCopasiNode< Data > *  pSibling,
CCopasiNode< Data > *  pAfter = NULL 
)
inline

Add a sibling to a node. If pAfter == this the sibling will be inserted at the front of the list of siblings.

Parameters
CCopasiNode<Data > * pSibling
CCopasiNode<Data > * pAfter (default: NULL appended to the list of siblings)
Returns
bool Success

Definition at line 286 of file CCopasiNode.h.

Referenced by CCopasiNode< size_t >::addSibling().

288  {
289  if (!pSibling) return false; // Nothing to insert.
290 
291  if (this == pAfter)
292  {
293  pSibling->setParent(mpParent);
294  pSibling->setSibling(mpSibling);
295  mpSibling = pSibling;
296  return true;
297  }
298 
299  CCopasiNode< Data > * pTmp = this;
300 
301  while (pTmp != pAfter && pTmp->getSibling())
302  pTmp = pTmp->getSibling();
303 
304  if (pTmp == pAfter || pAfter == NULL)
305  return pTmp->addSibling(pSibling, pTmp);
306  else
307  return false; // Insertion point no found.
308  }
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
bool setParent(CCopasiNode< Data > *pParent)
Definition: CCopasiNode.h:427
bool addSibling(CCopasiNode< Data > *pSibling, CCopasiNode< Data > *pAfter=NULL)
Definition: CCopasiNode.h:286
bool setSibling(CCopasiNode< Data > *pSibling)
Definition: CCopasiNode.h:448
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
bool CCopasiNode< _Data >::deleteChildren ( )
inline

Delete all children of the node

Definition at line 199 of file CCopasiNode.h.

Referenced by CQBrowserPaneDM::clear(), and CCopasiNode< size_t >::~CCopasiNode().

200  {
201  while (mpChild) delete mpChild;
202 
203  return true;
204  }
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::getChild ( )
inline

Retrieve the child of a node.

Returns
CCopasiNode< Data > * pChild

Definition at line 210 of file CCopasiNode.h.

Referenced by CCellDesignerImporter::addDependency(), SBMLImporter::areEqualSubtrees(), CEvaluationNodeDepthFirstIterator::CEvaluationNodeDepthFirstIterator(), CSBMLExporter::checkForPiecewiseFunctions(), CSBMLExporter::checkForUnsupportedFunctionCalls(), CMathTrigger::compileAND(), CMathEventN::CTrigger::compileEQ(), CMathTrigger::compileEQ(), CMathTrigger::compileFUNCTION(), CMathTrigger::compileGE(), CMathTrigger::compileGT(), CMathTrigger::compileLE(), CMathTrigger::compileLT(), CMathTrigger::compileNE(), CMathTrigger::compileNOT(), CMathTrigger::compileOR(), CDerive::compileTree(), CMathTrigger::compileXOR(), convertToCEvaluationNode(), CMathEventN::CTrigger::countRootsEQ(), createCall(), createChoice(), SBMLImporter::createCReactionFromReaction(), CMathContainer::createDiscontinuityTriggerInfix(), createFunction(), createGeneralPower(), createItemPower(), createItemPowerItem(), createLogical(), createLogicalChoice(), createLogicalItem(), CEvaluationNodeOperator::createModuloTree(), SBMLImporter::divideByObject(), SBMLImporter::doMapping(), CNormalTranslation::elementaryElimination(), CNormalTranslation::elementaryEliminationDivide(), CNormalTranslation::elementaryEliminationFunction(), CNormalTranslation::elementaryEliminationMinus(), CNormalTranslation::elementaryEliminationModulus(), CNormalTranslation::elementaryEliminationMultiply(), CNormalTranslation::elementaryEliminationPlus(), CNormalTranslation::elementaryEliminationPower(), CNormalTranslation::eliminateDirectlyNestedFractions(), CNormalTranslation::eliminateNestedPowers(), CNormalTranslation::eliminatePowersOfFractions(), expand_function_call(), expand_function_calls(), CNormalTranslation::expandPowerBases(), CNormalTranslation::expandPowerExponents(), CNormalTranslation::expandPowerNodes(), CNormalTranslation::expandProducts(), CEvaluationNodeNormalizer::findChainNodes(), CSBMLExporter::findDirectlyUsedFunctions(), CSBMLExporter::findModelEntityDependencies(), CNormalTranslation::findNegativeNumbers(), CNormalTranslation::findSummands(), CEvaluationNode::findTopMinus(), CCopasiNode< size_t >::getChild(), CEvaluationNodeFunction::getMMLString(), CCopasiNode< size_t >::getNumChildren(), CQBrowserPaneDM::CNode::getRow(), CQBrowserPaneDM::index(), SBMLImporter::isConstantFlux(), isLogical(), SBMLImporter::isMassAction(), SBMLImporter::isMassActionExpression(), SBMLImporter::isSimpleFunctionCall(), CNormalTranslation::matchPowerBases(), CNormalTranslation::matchSummands(), CSBMLExporter::multiplyByObject(), CNormalTranslation::newCancel(), CNormalTranslation::newEvaluateNumbers(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeCall(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeChoice(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeDelay(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeFunction(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeLogical(), CEvaluationNodeNormalizer::normalizeDivideNode(), CEvaluationNodeNormalizer::normalizeMinusNode(), CEvaluationNodeNormalizer::normalizeModulusNode(), CEvaluationNodeNormalizer::normalizeMultiplyNode(), CEvaluationNodeNormalizer::normalizePlusNode(), CEvaluationNodeNormalizer::normalizePowerNode(), CEvaluationNodeDepthFirstIterator::operator++(), CEvaluationNode::operator<(), CNormalTranslation::order(), CNormalTranslation::printPointers(), CNormalTranslation::product2fraction(), CQBrowserPaneDM::removeRows(), SBMLImporter::renameMassActionParameters(), replace_variable_names(), CSBMLExporter::replaceSpeciesReferences(), SBMLImporter::separateProductArguments(), SBMLImporter::setCorrectUsage(), CSBMLExporter::setFunctionSBMLIds(), CEvaluationNodeOperator::simplifyNode(), CNormalTranslation::simplifyTree(), CNormalTranslation::splitProduct(), CNormalTranslation::splitSum(), CNormalTranslation::swapNegativeNumbers(), test000053::test1_bug1000(), test000053::test3_bug1000(), test000053::test5_bug1000(), 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(), test000040::test_hasOnlySubstanceUnits(), test000023::test_hasOnlySubstanceUnits(), test000042::test_hasOnlySubstanceUnits(), test000043::test_hasOnlySubstanceUnits(), test000025::test_hasOnlySubstanceUnits(), test000033::test_hasOnlySubstanceUnits(), test000026::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(), test000065::test_import_reaction_with_unsuitable_kinetic_1(), test000065::test_import_reaction_with_unsuitable_kinetic_2(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_1(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_4(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_6(), test000064::test_import_rule_expression_and_hasOnlySubstanceUnits_7(), test000075::test_import_time_dependent_function_definition(), SBMLImporter::variables2objects(), and CReaction::variables2objects().

210 {return mpChild;}
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
template<class _Data>
const CCopasiNode< Data >* CCopasiNode< _Data >::getChild ( ) const
inline

Retrieve the child of a node.

Returns
const CCopasiNode< Data > * pChild

Definition at line 216 of file CCopasiNode.h.

216 {return mpChild;}
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::getChild ( const size_t &  index)
inline

Retrieve the child with given index of a node. If index is out of range NULL is returned.

Returns
const CCopasiNode< Data > * pChild

Definition at line 223 of file CCopasiNode.h.

224  {
225  size_t count = 0;
226 
227  CCopasiNode< Data > * pChild = getChild();
228 
229  while (count < index && pChild != NULL)
230  {
231  count++;
232  pChild = pChild->getSibling();
233  }
234 
235  return pChild;
236  }
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
template<class _Data>
const CCopasiNode< Data >* CCopasiNode< _Data >::getChild ( const size_t &  index) const
inline

Retrieve the child with given index of a node. If index is out of range NULL is returned.

Returns
const CCopasiNode< Data > * pChild

Definition at line 243 of file CCopasiNode.h.

244  {
245  size_t count = 0;
246 
247  const CCopasiNode< Data > * pChild = getChild();
248 
249  while (count < index && pChild != NULL)
250  {
251  count++;
252  pChild = pChild->getSibling();
253  }
254 
255  return pChild;
256  }
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
template<class _Data>
virtual const Data& CCopasiNode< _Data >::getData ( ) const
inlinevirtual

Retrieve the data of the Node.

Returns
Data data

Reimplemented in CEvaluationNodeCall, and CEvaluationNodeObject.

Definition at line 118 of file CCopasiNode.h.

Referenced by CCellDesignerImporter::addDependency(), SBMLImporter::areEqualSubtrees(), CSBMLExporter::checkForUnsupportedFunctionCalls(), CEvaluationNodeNormalizer::collectIdenticalBranches(), CMathEventN::CTrigger::compile(), CMathEventN::CTrigger::compileVARIABLE(), CMathTrigger::copyBranch(), CMathContainer::copyBranch(), createCall(), SBMLImporter::createCReactionFromReaction(), createFraction(), CCellDesignerImporter::createSpeciesStyles(), CNormalTranslation::expandPowerExponents(), SBMLImporter::findCorrespondingFunction(), CSBMLExporter::findDirectlyUsedFunctions(), CCellDesignerImporter::findRootElementId(), CEvaluationNode::findTopMinus(), SBMLImporter::isConstantFlux(), SBMLImporter::isMassAction(), SBMLImporter::isMassActionExpression(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeDelay(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeFunction(), CEvaluationNodeNormalizer::normalizeCEvaluationNodeLogical(), CEvaluationNode::operator<(), CEvaluationNode::operator==(), replace_variable_names(), CSBMLExporter::replaceSpeciesReferences(), CEvaluationNodeOperator::simplifyNode(), test_compare_utilities::test_copasi_function_expansion(), test000091::test_delay_in_kinetic_law(), test000091::test_delay_in_kinetic_law_local_parameter(), test000065::test_import_reaction_with_unsuitable_kinetic_1(), test000065::test_import_reaction_with_unsuitable_kinetic_2(), test000075::test_import_time_dependent_function_definition(), test000078::test_l2v4_import_unordered_functions(), CReaction::variable2object(), SBMLImporter::variables2objects(), and CReaction::variables2objects().

119  {
120  return mData;
121  }
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::getNext ( )
inline

Retrieve a pointer to the next node, which is either a child, a sibling, or an ancestor. The nodes are evaluated in that order and the first non NULL pointer is returned. If all evaluate to NULL, NULL will be returned.

Returns
CCopasiNode< Data > * pNext

Definition at line 368 of file CCopasiNode.h.

Referenced by CCellDesignerImporter::addDependency(), CCellDesignerImporter::createSpeciesStyles(), and CCellDesignerImporter::findRootElementId().

369  {
370  if (mpChild) return mpChild;
371 
372  return getNextNonChild();
373  }
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
CCopasiNode< Data > * getNextNonChild()
Definition: CCopasiNode.h:396
template<class _Data>
const CCopasiNode< Data >* CCopasiNode< _Data >::getNext ( ) const
inline

Retrieve a pointer to the next node, which is either a child, a sibling, or an ancestor. The nodes are evaluated in that order and the first non NULL pointer is returned. If all evaluate to NULL, NULL will be returned.

Returns
const CCopasiNode< Data > * pNext

Definition at line 382 of file CCopasiNode.h.

383  {
384  if (mpChild) return mpChild;
385 
386  return getNextNonChild();
387  }
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
CCopasiNode< Data > * getNextNonChild()
Definition: CCopasiNode.h:396
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::getNextNonChild ( )
inline

Retrieve a pointer to the next node, which is not a child node This is either a sibling or an ancestor. The nodes are evaluated in that order and the first non NULL pointer is returned. If all evaluate to NULL, NULL will be returned.

Returns
CCopasiNode< Data > * pNextNonChild

Definition at line 396 of file CCopasiNode.h.

Referenced by CCopasiNode< size_t >::getNext().

397  {
398  if (mpSibling) return mpSibling;
399 
400  if (mpParent) return mpParent->getNextNonChild();
401 
402  return NULL;
403  }
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
const CCopasiNode< Data >* CCopasiNode< _Data >::getNextNonChild ( ) const
inline

Retrieve a pointer to the next node, which is not a child node This is either a sibling or an ancestor. The nodes are evaluated in that order and the first non NULL pointer is returned. If all evaluate to NULL, NULL will be returned.

Returns
const CCopasiNode< Data > * pNextNonChild

Definition at line 412 of file CCopasiNode.h.

413  {
414  if (mpSibling) return mpSibling;
415 
416  if (mpParent) return mpParent->getNextNonChild();
417 
418  return NULL;
419  }
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
size_t CCopasiNode< _Data >::getNumChildren ( ) const
inline

Retrieve the number of children

Returns
size_t numChildren

Definition at line 262 of file CCopasiNode.h.

Referenced by CQBrowserPaneDM::add(), CQBrowserPaneDM::data(), CQBrowserPaneDM::load(), and CQBrowserPaneDM::rowCount().

263  {
264  size_t count = 0;
265 
266  const CCopasiNode< Data > * pChild = getChild();
267 
268  while (pChild != NULL)
269  {
270  count++;
271  pChild = pChild->getSibling();
272  }
273 
274  return count;
275  }
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
CCopasiNode< Data > * getChild()
Definition: CCopasiNode.h:210
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::getParent ( )
inline
template<class _Data>
const CCopasiNode< Data >* CCopasiNode< _Data >::getParent ( ) const
inline

Retrieve the parent of a Node.

Returns
const CCopasiNode< Data > * pParent

Definition at line 145 of file CCopasiNode.h.

145 {return mpParent;}
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::getSibling ( )
inline

Retrieve the sibling of a node.

Returns
CCopasiNode< Data > * pSibling

Definition at line 353 of file CCopasiNode.h.

Referenced by CCellDesignerImporter::addDependency(), CCopasiNode< size_t >::addSibling(), SBMLImporter::areEqualSubtrees(), CSBMLExporter::checkForPiecewiseFunctions(), CSBMLExporter::checkForUnsupportedFunctionCalls(), CEvaluationNodeChoice::compile(), CEvaluationNodeOperator::compile(), CEvaluationNodeDelay::compile(), CEvaluationNodeLogical::compile(), CEvaluationNodeFunction::compile(), CMathTrigger::compileAND(), CMathTrigger::compileEQ(), CMathTrigger::compileFUNCTION(), CMathTrigger::compileGE(), CMathTrigger::compileGT(), CMathTrigger::compileLE(), CMathTrigger::compileLT(), CMathTrigger::compileNE(), CMathTrigger::compileOR(), CDerive::compileTree(), CMathTrigger::compileXOR(), createCall(), SBMLImporter::createCReactionFromReaction(), createLogical(), CEvaluationNodeOperator::createModuloTree(), SBMLImporter::divideByObject(), SBMLImporter::doMapping(), CNormalTranslation::elementaryElimination(), CNormalTranslation::elementaryEliminationDivide(), CNormalTranslation::elementaryEliminationFunction(), CNormalTranslation::elementaryEliminationMinus(), CNormalTranslation::elementaryEliminationModulus(), CNormalTranslation::elementaryEliminationMultiply(), CNormalTranslation::elementaryEliminationPlus(), CNormalTranslation::elementaryEliminationPower(), CNormalTranslation::eliminateDirectlyNestedFractions(), CNormalTranslation::eliminateNestedPowers(), CNormalTranslation::eliminatePowersOfFractions(), expand_function_call(), expand_function_calls(), CNormalTranslation::expandPowerBases(), CNormalTranslation::expandPowerExponents(), CNormalTranslation::expandPowerNodes(), CNormalTranslation::expandProducts(), CEvaluationNodeNormalizer::findChainNodes(), CSBMLExporter::findDirectlyUsedFunctions(), CSBMLExporter::findModelEntityDependencies(), CNormalTranslation::findNegativeNumbers(), CNormalTranslation::findSummands(), CCopasiNode< size_t >::getChild(), CCopasiNode< size_t >::getNumChildren(), CQBrowserPaneDM::CNode::getRow(), isLogical(), SBMLImporter::isMassAction(), SBMLImporter::isMassActionExpression(), SBMLImporter::isSimpleFunctionCall(), CQBrowserPaneDM::load(), CNormalTranslation::matchPowerBases(), CNormalTranslation::matchSummands(), CNormalTranslation::newCancel(), CNormalTranslation::newEvaluateNumbers(), CEvaluationNodeDepthFirstIterator::operator++(), CEvaluationNode::operator<(), CNormalTranslation::order(), CNormalTranslation::printPointers(), CEvaluationNode::printRecursively(), CNormalTranslation::product2fraction(), CQBrowserPaneDM::removeRows(), CCopasiNode< size_t >::removeSibling(), SBMLImporter::renameMassActionParameters(), replace_variable_names(), CSBMLExporter::replaceSpeciesReferences(), SBMLImporter::separateProductArguments(), SBMLImporter::setCorrectUsage(), CSBMLExporter::setFunctionSBMLIds(), CNormalTranslation::simplifyTree(), CEvaluationNode::splitBranch(), CNormalTranslation::splitProduct(), CNormalTranslation::splitSum(), CNormalTranslation::swapNegativeNumbers(), test000053::test1_bug1000(), test000053::test3_bug1000(), test000053::test5_bug1000(), 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(), CEvaluationNodeDelay::toAST(), CEvaluationNodeChoice::toAST(), CEvaluationNodeCall::toAST(), CEvaluationNodeOperator::toAST(), CEvaluationNodeLogical::toAST(), CEvaluationNodeFunction::toAST(), and CReaction::variables2objects().

353 {return mpSibling;}
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
const CCopasiNode< Data >* CCopasiNode< _Data >::getSibling ( ) const
inline

Retrieve the sibling of a node.

Returns
const CCopasiNode< Data > * pSibling

Definition at line 359 of file CCopasiNode.h.

359 {return mpSibling;}
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
virtual bool CCopasiNode< _Data >::removeChild ( CCopasiNode< Data > *  pChild)
inlinevirtual

Remove a child from a node.

Parameters
CCopasiNode<Data > * pChild
Returns
bool Success

Reimplemented in CEvaluationNodeCall.

Definition at line 181 of file CCopasiNode.h.

Referenced by CMathEventN::CTrigger::compileNE(), convertToCEvaluationNode(), CNormalTranslation::elementaryElimination(), CNormalTranslation::eliminateDirectlyNestedFractions(), CNormalTranslation::eliminateNestedPowers(), CNormalTranslation::eliminatePowersOfFractions(), CNormalTranslation::expandPowerBases(), CODEExporter::exportSingleFunction(), CODEExporter::modifyTreeForMassAction(), CEvaluationNodeCall::removeChild(), and CNormalTranslation::swapNegativeNumbers().

182  {
183  if (!pChild) return false; // Nothing to remove.
184 
185  if (mpChild != pChild)
186  return mpChild->removeSibling(pChild);
187 
188  mpChild = mpChild->getSibling();
189 
190  pChild->setParent(NULL);
191  pChild->setSibling(NULL);
192 
193  return true;
194  }
bool setParent(CCopasiNode< Data > *pParent)
Definition: CCopasiNode.h:427
bool setSibling(CCopasiNode< Data > *pSibling)
Definition: CCopasiNode.h:448
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
template<class _Data>
bool CCopasiNode< _Data >::removeSibling ( CCopasiNode< Data > *  pSibling)
inlineprivate

Remove a sibling.

Parameters
CCopasiNode<Data > * pSibling
Returns
bool Success

Definition at line 316 of file CCopasiNode.h.

317  {
318  if (!pSibling) return false; // Nothing to remove.
319 
320  if (this == pSibling)
321  {
322  if (mpParent)
323  mpParent->removeChild(pSibling);
324  else
325  return false; // Root can not be removed
326  }
327 
328  CCopasiNode< Data > * pTmp = this;
329  CCopasiNode< Data > * pTmpSibling = this->mpSibling;
330 
331  while (pTmpSibling != pSibling && pTmpSibling != NULL)
332  {
333  pTmp = pTmpSibling;
334  pTmpSibling = pTmpSibling->getSibling();
335  }
336 
337  if (!pTmpSibling)
338  return false; // We did not find a sibling.
339 
340  pTmp->setSibling(pSibling->getSibling());
341 
342  pSibling->setParent(NULL);
343  pSibling->setSibling(NULL);
344 
345  return true;
346  }
CCopasiNode< Data > * getSibling()
Definition: CCopasiNode.h:353
bool setParent(CCopasiNode< Data > *pParent)
Definition: CCopasiNode.h:427
bool setSibling(CCopasiNode< Data > *pSibling)
Definition: CCopasiNode.h:448
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59
template<class _Data>
bool CCopasiNode< _Data >::setChild ( CCopasiNode< Data > *  pChild)
inlineprotected

Set the child of a node.

Parameters
CCopasiNode<Data > * pChild
Returns
bool Success

Definition at line 438 of file CCopasiNode.h.

439  {
440  mpChild = pChild;
441  return true;
442  }
CCopasiNode< Data > * mpChild
Definition: CCopasiNode.h:54
template<class _Data>
virtual bool CCopasiNode< _Data >::setData ( const Data data)
inlinevirtual

Set the data of the Node.

Parameters
constData & data
Returns
bool success

Reimplemented in CEvaluationNodeCall, and CEvaluationNodeObject.

Definition at line 128 of file CCopasiNode.h.

Referenced by CCellDesignerImporter::addDependency().

129  {
130  mData = data;
131 
132  return true;
133  }
template<class _Data>
bool CCopasiNode< _Data >::setParent ( CCopasiNode< Data > *  pParent)
inlineprotected

Set the parent of a Node.

Parameters
CCopasiNode<Data > * pParent
Returns
bool Success

Definition at line 427 of file CCopasiNode.h.

Referenced by CCopasiNode< size_t >::addSibling(), CCopasiNode< size_t >::removeChild(), and CCopasiNode< size_t >::removeSibling().

428  {
429  mpParent = pParent;
430  return true;
431  }
CCopasiNode< Data > * mpParent
Definition: CCopasiNode.h:49
template<class _Data>
bool CCopasiNode< _Data >::setSibling ( CCopasiNode< Data > *  pSibling)
inlineprotected

Set the sibling of a node.

Parameters
CCopasiNode<Data > * pSibling
Returns
bool Success

Definition at line 448 of file CCopasiNode.h.

Referenced by CCopasiNode< size_t >::addChild(), CCopasiNode< size_t >::addSibling(), CCopasiNode< size_t >::removeChild(), and CCopasiNode< size_t >::removeSibling().

449  {
450  mpSibling = pSibling;
451  return true;
452  }
CCopasiNode< Data > * mpSibling
Definition: CCopasiNode.h:59

Member Data Documentation

template<class _Data>
Data CCopasiNode< _Data >::mData
protected

The data content of the node;

Definition at line 65 of file CCopasiNode.h.

Referenced by CCopasiNode< size_t >::getData(), operator<<(), and CCopasiNode< size_t >::setData().

template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::mpChild
private
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::mpParent
private
template<class _Data>
CCopasiNode< Data >* CCopasiNode< _Data >::mpSibling
private

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