COPASI API  4.40.278
CNodeContextIterator< Node, Context > Class Template Reference

#include <CNodeIterator.h>

Inheritance diagram for CNodeContextIterator< Node, Context >:
[legend]

Classes

class  CStackElement
 

Public Member Functions

 CNodeContextIterator ()
 
 CNodeContextIterator (const CNodeContextIterator &src)
 
 CNodeContextIterator (Node *pNode, Context *pParentContext=NULL)
 
Context & context ()
 
CNodeIteratorMode::State end () const
 
CNodeIteratorMode::Flag getProcessingModes () const
 
size_t level ()
 
const CNodeIteratorMode::Statenext ()
 
Node * operator* ()
 
Node * operator-> ()
 
Context * parentContextPtr ()
 
const CNodeIteratorMode::StateprocessingMode () const
 
void setProcessingModes (const CNodeIteratorMode::Flag &processingModes)
 
const CNodeIteratorMode::StateskipChildren ()
 
 ~CNodeContextIterator ()
 

Private Member Functions

void increment ()
 

Private Attributes

CNodeIteratorMode::State mCurrentMode
 
CNodeIteratorMode::Flag mProcessingModes
 
std::stack< CStackElementmStack
 

Constructor & Destructor Documentation

◆ CNodeContextIterator() [1/3]

template<class Node , class Context >
CNodeContextIterator< Node, Context >::CNodeContextIterator ( )
inline

Default constructor

◆ CNodeContextIterator() [2/3]

template<class Node , class Context >
CNodeContextIterator< Node, Context >::CNodeContextIterator ( const CNodeContextIterator< Node, Context > &  src)
inline

Copy constructor

Parameters
constCNodeContextIterator & src

◆ CNodeContextIterator() [3/3]

template<class Node , class Context >
CNodeContextIterator< Node, Context >::CNodeContextIterator ( Node *  pNode,
Context *  pParentContext = NULL 
)
inline

Constructor

Parameters
Node* pNode
Context* pParentContext (default: NULL)

References CNodeContextIterator< Node, Context >::mStack.

◆ ~CNodeContextIterator()

template<class Node , class Context >
CNodeContextIterator< Node, Context >::~CNodeContextIterator ( )
inline

Destructor

Member Function Documentation

◆ context()

◆ end()

template<class Node , class Context >
CNodeIteratorMode::State CNodeContextIterator< Node, Context >::end ( ) const
inline

Retrieve the end of the iterator, i.e., the

References CNodeIteratorMode::End.

Referenced by CEvaluationNode::buildBerkeleyMadonnaString(), CEvaluationTree::buildCalculationSequence(), CEvaluationNode::buildCCodeString(), CEvaluationNode::buildDisplayString(), CEvaluationNode::buildInfix(), CEvaluationNode::buildMMLString(), CEvaluationNode::buildXPPString(), SBMLImporter::checkForUnitsOnNumbers(), CMathEvent::CTrigger::compile(), CEvaluationTree::compileNodes(), CEvaluationNode::copyBranch(), CMathContainer::copyBranch(), CDerive::copyBranch_var2obj(), CMathEvent::CTrigger::countRoots(), CMathContainer::createDiscontinuityEvents(), CFunctionAnalyzer::evaluateNode(), SBMLImporter::find_local_parameters_in_delay(), SBMLImporter::findIdInASTTree(), CEvaluationNode::findTopMinus(), CEvaluationTree::fromAST(), SBMLImporter::getIdsFromNode(), CEvaluationNodeOperator::getUnit(), CUnitValidator::getUnits(), SBMLImporter::isDelayFunctionUsed(), SBMLImporter::multiplySubstanceOnlySpeciesByVolume(), CReaction::objects2variables(), CEvaluationNode::operator==(), SBMLImporter::replace_delay_nodes(), SBMLImporter::replace_name_nodes(), SBMLImporter::replace_time_with_initial_time(), SBMLImporter::replaceAmountReferences(), SBMLImporter::replaceCallNodeNames(), SBMLImporter::replaceObjectNames(), SBMLImporter::replaceTimeAndAvogadroNodeNames(), SBMLImporter::replaceTimeDependentFunctionCalls(), SBMLImporter::replaceTimeNodesInFunctionDefinition(), CModelParameterSet::saveToStream(), CEvaluationTree::setTree(), CUnitValidator::setUnits(), CModelVersionHierarchy::size(), and CModelVersionHierarchy::updateVersionXML().

◆ getProcessingModes()

template<class Node , class Context >
CNodeIteratorMode::Flag CNodeContextIterator< Node, Context >::getProcessingModes ( ) const
inline

Retrieve the processing modes to which the method next will advance the iterator.

Returns
CNodeIteratorMode::Flag processingModes

References CNodeIteratorMode::End, and CNodeContextIterator< Node, Context >::mProcessingModes.

◆ increment()

template<class Node , class Context >
void CNodeContextIterator< Node, Context >::increment ( )
inlineprivate

This method moves the iterator to the next node in the tree. The tree is traversed depth first. A return value of false indicates that the tree has been completed traversed.

Please note that the iterator points to the same node twice, once before the first child and once after the last child to allow pre and post processing. This behavior is also true for childless nodes. To determine whether the iterator is in the pre or post processing phase one may check the nextChildIndex where zero indicates pre and None indicates post processing.

Returns
bool moreNodes

References CNodeIteratorMode::After, CNodeIteratorMode::Before, CNodeIteratorMode::End, CNodeIteratorMode::Intermediate, CNodeContextIterator< Node, Context >::CStackElement::mChildCount, CNodeContextIterator< Node, Context >::CStackElement::mContext, CNodeContextIterator< Node, Context >::mCurrentMode, CNodeContextIterator< Node, Context >::CStackElement::mNextChildIndex, CNodeContextIterator< Node, Context >::CStackElement::mpNode, and CNodeContextIterator< Node, Context >::mStack.

Referenced by CNodeContextIterator< Node, Context >::next().

◆ level()

template<class Node , class Context >
size_t CNodeContextIterator< Node, Context >::level ( )
inline

The nesting level of the tree. Note, the nesting level of the root of the tree is 1. This is to distinguish its level from the end of the iterator which reports 0.

References CNodeContextIterator< Node, Context >::mStack.

Referenced by CModelParameterSet::saveToStream().

◆ next()

template<class Node , class Context >
const CNodeIteratorMode::State& CNodeContextIterator< Node, Context >::next ( )
inline

This method moves the iterator to the next node based on the setting of the processing modes and returns the processing mode of the iterator.

Returns
const CNodeIteratorMode::State & processingMode

References CNodeIteratorMode::Before, CNodeContextIterator< Node, Context >::increment(), CFlags< Enum >::isSet(), CNodeContextIterator< Node, Context >::mCurrentMode, CNodeContextIterator< Node, Context >::mProcessingModes, and CNodeIteratorMode::Start.

Referenced by CEvaluationNode::buildBerkeleyMadonnaString(), CEvaluationTree::buildCalculationSequence(), CEvaluationNode::buildCCodeString(), CEvaluationNode::buildDisplayString(), CEvaluationNode::buildInfix(), CEvaluationNode::buildMMLString(), CEvaluationNode::buildXPPString(), SBMLImporter::checkForUnitsOnNumbers(), CMathEvent::CTrigger::compile(), CEvaluationTree::compileNodes(), CEvaluationNode::copyBranch(), CMathContainer::copyBranch(), CDerive::copyBranch_var2obj(), CMathEvent::CTrigger::countRoots(), CMathContainer::createDiscontinuityEvents(), CFunctionAnalyzer::evaluateNode(), SBMLImporter::find_local_parameters_in_delay(), SBMLImporter::findIdInASTTree(), CEvaluationNode::findTopMinus(), CEvaluationTree::fromAST(), SBMLImporter::getIdsFromNode(), CModelVersionHierarchy::getNodeIterator(), CEvaluationNodeOperator::getUnit(), CUnitValidator::getUnits(), SBMLImporter::isDelayFunctionUsed(), SBMLImporter::multiplySubstanceOnlySpeciesByVolume(), CReaction::objects2variables(), CEvaluationNode::operator==(), SBMLImporter::replace_delay_nodes(), SBMLImporter::replace_name_nodes(), SBMLImporter::replace_time_with_initial_time(), SBMLImporter::replaceAmountReferences(), SBMLImporter::replaceCallNodeNames(), SBMLImporter::replaceObjectNames(), SBMLImporter::replaceTimeAndAvogadroNodeNames(), SBMLImporter::replaceTimeDependentFunctionCalls(), SBMLImporter::replaceTimeNodesInFunctionDefinition(), CModelParameterSet::saveToStream(), CEvaluationTree::setTree(), CUnitValidator::setUnits(), CModelVersionHierarchy::size(), and CModelVersionHierarchy::updateVersionXML().

◆ operator*()

template<class Node , class Context >
Node* CNodeContextIterator< Node, Context >::operator* ( )
inline

Dereference the iterator

Returns
Node * pNode

References CNodeContextIterator< Node, Context >::mStack.

◆ operator->()

template<class Node , class Context >
Node* CNodeContextIterator< Node, Context >::operator-> ( )
inline

Dereference the iterator

Returns
Node * pNode

References CNodeContextIterator< Node, Context >::mStack.

◆ parentContextPtr()

◆ processingMode()

template<class Node , class Context >
const CNodeIteratorMode::State& CNodeContextIterator< Node, Context >::processingMode ( ) const
inline

◆ setProcessingModes()

template<class Node , class Context >
void CNodeContextIterator< Node, Context >::setProcessingModes ( const CNodeIteratorMode::Flag processingModes)
inline

◆ skipChildren()

Member Data Documentation

◆ mCurrentMode

◆ mProcessingModes

template<class Node , class Context >
CNodeIteratorMode::Flag CNodeContextIterator< Node, Context >::mProcessingModes
private

◆ mStack


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