COPASI API
4.40.278
|
#include <CNodeIterator.h>
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::State & | next () |
Node * | operator* () |
Node * | operator-> () |
Context * | parentContextPtr () |
const CNodeIteratorMode::State & | processingMode () const |
void | setProcessingModes (const CNodeIteratorMode::Flag &processingModes) |
const CNodeIteratorMode::State & | skipChildren () |
~CNodeContextIterator () | |
Private Member Functions | |
void | increment () |
Private Attributes | |
CNodeIteratorMode::State | mCurrentMode |
CNodeIteratorMode::Flag | mProcessingModes |
std::stack< CStackElement > | mStack |
|
inline |
Default constructor
|
inline |
Copy constructor
const | CNodeContextIterator & src |
|
inline |
Constructor
Node | * pNode |
Context | * pParentContext (default: NULL) |
References CNodeContextIterator< Node, Context >::mStack.
|
inline |
Destructor
|
inline |
Retrieve the context of the current node.
References CNodeContextIterator< Node, Context >::mStack.
Referenced by CEvaluationNode::buildBerkeleyMadonnaString(), CEvaluationNode::buildCCodeString(), CEvaluationNode::buildDisplayString(), CEvaluationNode::buildInfix(), CEvaluationNode::buildMMLString(), CEvaluationNode::buildXPPString(), CMathEvent::CTrigger::compile(), CEvaluationNode::copyBranch(), CMathContainer::copyBranch(), CDerive::copyBranch_var2obj(), CMathEvent::CTrigger::countRoots(), CFunctionAnalyzer::evaluateNode(), CEvaluationNode::findTopMinus(), CEvaluationTree::fromAST(), CUnitValidator::getUnits(), and CReaction::objects2variables().
|
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().
|
inline |
Retrieve the processing modes to which the method next will advance the iterator.
References CNodeIteratorMode::End, and CNodeContextIterator< Node, Context >::mProcessingModes.
|
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.
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().
|
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().
|
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.
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().
|
inline |
Dereference the iterator
References CNodeContextIterator< Node, Context >::mStack.
|
inline |
Dereference the iterator
References CNodeContextIterator< Node, Context >::mStack.
|
inline |
Retrieve the pointer to the parent node context if it exists.
References CNodeContextIterator< Node, Context >::mStack.
Referenced by CEvaluationNode::buildBerkeleyMadonnaString(), CEvaluationNode::buildCCodeString(), CEvaluationNode::buildDisplayString(), CEvaluationNode::buildInfix(), CEvaluationNode::buildMMLString(), CEvaluationNode::buildXPPString(), CMathEvent::CTrigger::compile(), CEvaluationNode::copyBranch(), CMathContainer::copyBranch(), CDerive::copyBranch_var2obj(), CMathEvent::CTrigger::countRoots(), CFunctionAnalyzer::evaluateNode(), CEvaluationNode::findTopMinus(), CEvaluationTree::fromAST(), CUnitValidator::getUnits(), and CReaction::objects2variables().
|
inline |
Retrieve the processing mode
References CNodeContextIterator< Node, Context >::mCurrentMode.
Referenced by CMathEvent::CTrigger::compile(), CMathEvent::CTrigger::countRoots(), and CEvaluationNode::findTopMinus().
|
inline |
Set the processing modes to which the method next will advance the iterator. Note, the iterator will always stop at the end.
const | CNodeIteratorMode::Flag & processingModes |
References CNodeIteratorMode::End, and CNodeContextIterator< Node, Context >::mProcessingModes.
Referenced by CMathEvent::CTrigger::compile(), CMathEvent::CTrigger::countRoots(), CEvaluationNode::findTopMinus(), CModelVersionHierarchy::getNodeIterator(), SBMLImporter::multiplySubstanceOnlySpeciesByVolume(), SBMLImporter::replaceAmountReferences(), CModelParameterSet::saveToStream(), and CUnitValidator::setUnits().
|
inline |
This method moves the iterator beyond the last child.
References CNodeIteratorMode::After, CNodeContextIterator< Node, Context >::CStackElement::mChildCount, CNodeContextIterator< Node, Context >::mCurrentMode, CNodeContextIterator< Node, Context >::CStackElement::mNextChildIndex, and CNodeContextIterator< Node, Context >::mStack.
Referenced by CMathEvent::CTrigger::compile(), CMathEvent::CTrigger::countRoots(), CEvaluationNode::findTopMinus(), SBMLImporter::multiplySubstanceOnlySpeciesByVolume(), and SBMLImporter::replaceAmountReferences().
|
private |
The current processing mode.
Referenced by CNodeContextIterator< Node, Context >::increment(), CNodeContextIterator< Node, Context >::next(), CNodeContextIterator< Node, Context >::processingMode(), and CNodeContextIterator< Node, Context >::skipChildren().
|
private |
The processing modes to which the method next will advance the iterator
Referenced by CNodeContextIterator< Node, Context >::getProcessingModes(), CNodeContextIterator< Node, Context >::next(), and CNodeContextIterator< Node, Context >::setProcessingModes().
|
private |
A stack representing the nested elements of the tree.
Referenced by CNodeContextIterator< Node, Context >::CNodeContextIterator(), CNodeContextIterator< Node, Context >::context(), CNodeContextIterator< Node, Context >::increment(), CNodeContextIterator< Node, Context >::level(), CNodeContextIterator< Node, Context >::operator*(), CNodeContextIterator< Node, Context >::operator->(), CNodeContextIterator< Node, Context >::parentContextPtr(), and CNodeContextIterator< Node, Context >::skipChildren().