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

#include <CCopasiTree.h>

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

Public Member Functions

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

Private Attributes

const _Node * mCurrent
 

Detailed Description

template<class _Node>
class CCopasiTree< _Node >::const_iterator

A const forward iterator used to traverse the tree.

Definition at line 166 of file CCopasiTree.h.

Constructor & Destructor Documentation

template<class _Node>
CCopasiTree< _Node >::const_iterator::const_iterator ( const _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 184 of file CCopasiTree.h.

184  :
185  mCurrent(begin)
186  {}
iterator begin() const
Definition: CCopasiTree.h:264
template<class _Node>
CCopasiTree< _Node >::const_iterator::const_iterator ( const const_iterator src)
inline

Copy constructor

Parameters
constiterator & src

Definition at line 192 of file CCopasiTree.h.

192  :
193  mCurrent(src.mCurrent)
194  {}
template<class _Node>
CCopasiTree< _Node >::const_iterator::~const_iterator ( )
inline

Destructor

Definition at line 199 of file CCopasiTree.h.

199 {}

Member Function Documentation

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

Comparison operator !=

Parameters
constiterator &rhs
Returns
bool not-equal

Definition at line 218 of file CCopasiTree.h.

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

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

Dereference operator * returns the node the iterator points to.

Returns
Node &

Definition at line 205 of file CCopasiTree.h.

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

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

Prefix increment operator ++

Returns
iterator &

Definition at line 237 of file CCopasiTree.h.

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

238  {
239  mCurrent = (_Node *) mCurrent->getNext();
240 
241  return *this;
242  }
template<class _Node>
const _Node* CCopasiTree< _Node >::const_iterator::operator-> ( ) const
inline

Dereference operator * returns the node the iterator points to.

Returns
Node &

Definition at line 211 of file CCopasiTree.h.

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

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

Assignment operator from a node to an iterator

Parameters
Node* pNode
Returns
iterator &

Definition at line 226 of file CCopasiTree.h.

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

227  {
228  mCurrent = pNode;
229  return *this;
230  }

Member Data Documentation

template<class _Node>
const _Node* CCopasiTree< _Node >::const_iterator::mCurrent
private

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