COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CCopasiTree< _Node >::iterator Class Reference

#include <CCopasiTree.h>

Inheritance diagram for CCopasiTree< _Node >::iterator:
Inheritance graph
[legend]
Collaboration diagram for CCopasiTree< _Node >::iterator:
Collaboration graph
[legend]

Public Member Functions

 iterator (_Node *begin=NULL)
 
 iterator (const iterator &src)
 
bool operator!= (const iterator &rhs)
 
_Node & operator* () const
 
iteratoroperator++ ()
 
_Node * operator-> () const
 
iteratoroperator= (_Node *pNode)
 
 ~iterator ()
 

Private Attributes

_Node * mCurrent
 

Detailed Description

template<class _Node>
class CCopasiTree< _Node >::iterator

A forward iterator used to traverse the tree.

Definition at line 81 of file CCopasiTree.h.

Constructor & Destructor Documentation

template<class _Node>
CCopasiTree< _Node >::iterator::iterator ( _Node *  begin = NULL)
inline

Default constructor. Note: When no argument is given the iterator points to the end of the tree.

Parameters
Node* begin (default NULL)

Definition at line 99 of file CCopasiTree.h.

99  :
100  mCurrent(begin)
101  {}
iterator begin() const
Definition: CCopasiTree.h:264
template<class _Node>
CCopasiTree< _Node >::iterator::iterator ( const iterator src)
inline

Copy constructor

Parameters
constiterator & src

Definition at line 107 of file CCopasiTree.h.

107  :
108  mCurrent(src.mCurrent)
109  {}
template<class _Node>
CCopasiTree< _Node >::iterator::~iterator ( )
inline

Destructor

Definition at line 114 of file CCopasiTree.h.

114 {}

Member Function Documentation

template<class _Node>
bool CCopasiTree< _Node >::iterator::operator!= ( const iterator rhs)
inline

Comparison operator !=

Parameters
constiterator &rhs
Returns
bool not-equal

Definition at line 133 of file CCopasiTree.h.

References CCopasiTree< _Node >::iterator::mCurrent.

134  {return (mCurrent != rhs.mCurrent);}
template<class _Node>
_Node& CCopasiTree< _Node >::iterator::operator* ( ) const
inline

Dereference operator * returns the node the iterator points to.

Returns
Node &

Definition at line 120 of file CCopasiTree.h.

References CCopasiTree< _Node >::iterator::mCurrent.

120 {return * mCurrent;}
template<class _Node>
iterator& CCopasiTree< _Node >::iterator::operator++ ( )
inline

Prefix increment operator ++

Returns
iterator &

Definition at line 152 of file CCopasiTree.h.

References CCopasiTree< _Node >::iterator::mCurrent.

153  {
154  mCurrent = (_Node *) mCurrent->getNext();
155 
156  return *this;
157  }
template<class _Node>
_Node* CCopasiTree< _Node >::iterator::operator-> ( ) const
inline

Dereference operator * returns the node the iterator points to.

Returns
Node &

Definition at line 126 of file CCopasiTree.h.

References CCopasiTree< _Node >::iterator::mCurrent.

126 {return mCurrent;}
template<class _Node>
iterator& CCopasiTree< _Node >::iterator::operator= ( _Node *  pNode)
inline

Assignment operator from a node to an iterator

Parameters
Node* pNode
Returns
iterator &

Definition at line 141 of file CCopasiTree.h.

References CCopasiTree< _Node >::iterator::mCurrent.

142  {
143  mCurrent = pNode;
144  return *this;
145  }

Member Data Documentation

template<class _Node>
_Node* CCopasiTree< _Node >::iterator::mCurrent
private

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