const_iterator Class Reference

#include <const_iterator.h>

Inheritance diagram for const_iterator:

Inheritance graph
[legend]
List of all members.

Detailed Description

An iterator that can be used to inspect the tree but not modify it.

Definition at line 33 of file const_iterator.h.

Public Types

typedef std::bidirectional_iterator_tag iterator_category
typedef T value_type
typedef R reference
typedef P pointer
typedef size_t size_type
typedef ptrdiff_t difference_type

Public Member Functions

 const_iterator (void)
 const_iterator (const const_iterator &iter)
super::reference operator * (void) const
super::pointer operator-> (void) const
const_sibling_iterator beginChildren (void) const
const_sibling_iterator endChildren (void) const
const_iterator parent (void) const
size_t size (void) const
bool operator== (const tree_iterator &iter) const
bool operator!= (const tree_iterator &iter) const
long depth (void) const
bool leaf (void) const

Protected Member Functions

 const_iterator (tree_node< N > *current)
void destroy (void)

Static Protected Member Functions

static void post_inc (tree_node< N > *&current, long &depth)
static void post_dec (tree_node< N > *&current, long &depth)
static void pre_inc (tree_node< N > *&current, long &depth)
static void pre_dec (tree_node< N > *&current, long &depth)
static void sib_inc (tree_node< N > *&current)
static void sib_dec (tree_node< N > *&current)

Protected Attributes

tree_node< N > * current
long iter_depth

Private Types

typedef tree_iterator< N,
const N &, const N * > 
super

Private Member Functions

friend tree () const

Friends

class tree


Member Typedef Documentation

template<class T, class R, class P>
typedef ptrdiff_t tree_iterator< T, R, P >::difference_type [inherited]

Definition at line 92 of file tree_iterator.h.

template<class T, class R, class P>
typedef std::bidirectional_iterator_tag tree_iterator< T, R, P >::iterator_category [inherited]

Definition at line 87 of file tree_iterator.h.

template<class T, class R, class P>
typedef P tree_iterator< T, R, P >::pointer [inherited]

Definition at line 90 of file tree_iterator.h.

template<class T, class R, class P>
typedef R tree_iterator< T, R, P >::reference [inherited]

Definition at line 89 of file tree_iterator.h.

template<class T, class R, class P>
typedef size_t tree_iterator< T, R, P >::size_type [inherited]

Definition at line 91 of file tree_iterator.h.

typedef tree_iterator<N, const N&, const N*> const_iterator::super [private]

Definition at line 43 of file const_iterator.h.

template<class T, class R, class P>
typedef T tree_iterator< T, R, P >::value_type [inherited]

Definition at line 88 of file tree_iterator.h.


Constructor & Destructor Documentation

const_iterator::const_iterator ( tree_node< N > *  current  )  [inline, protected]

Definition at line 47 of file const_iterator.h.

const_iterator::const_iterator ( void   )  [inline]

Definition at line 51 of file const_iterator.h.

Referenced by beginChildren(), and endChildren().

const_iterator::const_iterator ( const const_iterator iter  )  [inline]

Definition at line 52 of file const_iterator.h.


Member Function Documentation

const_sibling_iterator const_iterator::beginChildren ( void   )  const [inline]

Definition at line 60 of file const_iterator.h.

References const_iterator().

Here is the call graph for this function:

template<class T, class R, class P>
long tree_iterator< T, R, P >::depth ( void   )  const [inline, inherited]

Definition at line 107 of file tree_iterator.h.

template<class T, class R, class P>
void tree_iterator< T, R, P >::destroy ( void   )  [inline, protected, inherited]

Destroys the node pointed to by this iterator.

Definition at line 63 of file tree_iterator.h.

const_sibling_iterator const_iterator::endChildren ( void   )  const [inline]

Definition at line 63 of file const_iterator.h.

References const_iterator().

Here is the call graph for this function:

template<class T, class R, class P>
bool tree_iterator< T, R, P >::leaf ( void   )  const [inline, inherited]

Definition at line 109 of file tree_iterator.h.

super::reference const_iterator::operator * ( void   )  const [inline]

Definition at line 55 of file const_iterator.h.

References tree_iterator< T, R, P >::current, and tree_node< T >::data.

template<class T, class R, class P>
bool tree_iterator< T, R, P >::operator!= ( const tree_iterator< T, R, P > &  iter  )  const [inline, inherited]

Definition at line 104 of file tree_iterator.h.

super::pointer const_iterator::operator-> ( void   )  const [inline]

Definition at line 58 of file const_iterator.h.

References tree_iterator< T, R, P >::current, and tree_node< T >::data.

template<class T, class R, class P>
bool tree_iterator< T, R, P >::operator== ( const tree_iterator< T, R, P > &  iter  )  const [inline, inherited]

Definition at line 101 of file tree_iterator.h.

const_iterator const_iterator::parent ( void   )  const [inline]

Definition at line 66 of file const_iterator.h.

References tree_iterator< T, R, P >::current, and tree_node< T >::parent.

template<class T, class R, class P>
static void tree_iterator< T, R, P >::post_dec ( tree_node< N > *&  current,
long &  depth 
) [inline, static, protected, inherited]

Referenced by postorder_iterator::operator--(), and const_postorder_iterator::operator--().

template<class T, class R, class P>
static void tree_iterator< T, R, P >::post_inc ( tree_node< N > *&  current,
long &  depth 
) [inline, static, protected, inherited]

Referenced by postorder_iterator::operator++(), and const_postorder_iterator::operator++().

template<class T, class R, class P>
static void tree_iterator< T, R, P >::pre_dec ( tree_node< N > *&  current,
long &  depth 
) [inline, static, protected, inherited]

Referenced by preorder_iterator::operator--(), and const_preorder_iterator::operator--().

template<class T, class R, class P>
static void tree_iterator< T, R, P >::pre_inc ( tree_node< N > *&  current,
long &  depth 
) [inline, static, protected, inherited]

Referenced by preorder_iterator::operator++(), and const_preorder_iterator::operator++().

template<class T, class R, class P>
static void tree_iterator< T, R, P >::sib_dec ( tree_node< N > *&  current  )  [inline, static, protected, inherited]

Referenced by sibling_iterator::operator--(), const_sibling_iterator::operator--(), and sibling_iterator::operator-=().

template<class T, class R, class P>
static void tree_iterator< T, R, P >::sib_inc ( tree_node< N > *&  current  )  [inline, static, protected, inherited]

Referenced by sibling_iterator::operator++(), const_sibling_iterator::operator++(), and sibling_iterator::operator+=().

size_t const_iterator::size ( void   )  const

Determines the size of the subtree below and including this position.

Returns:
The size of this subtree.

const_iterator::tree (  )  const [private]


Friends And Related Function Documentation

friend class tree [friend]

Reimplemented from tree_iterator< T, R, P >.

Reimplemented in const_bfs_iterator, const_postorder_iterator, const_preorder_iterator, and const_sibling_iterator.

Definition at line 35 of file const_iterator.h.


Member Data Documentation

template<class T, class R, class P>
tree_node<N>* tree_iterator< T, R, P >::current [protected, inherited]

Definition at line 41 of file tree_iterator.h.

Referenced by tree_iterator< const const N, N &, N * >::destroy(), iterator::operator *(), operator *(), tree_iterator< const const N, N &, N * >::operator!=(), const_bfs_iterator::operator++(), bfs_iterator::operator++(), iterator::operator->(), operator->(), tree_iterator< const const N, N &, N * >::operator==(), iterator::parent(), parent(), and const_preorder_iterator::prune().

template<class T, class R, class P>
long tree_iterator< T, R, P >::iter_depth [protected, inherited]

Definition at line 46 of file tree_iterator.h.

Referenced by tree_iterator< const const N, N &, N * >::depth(), tree_iterator< const const N, N &, N * >::destroy(), and const_preorder_iterator::prune().


The documentation for this class was generated from the following file:
Generated on Sat Apr 12 06:04:43 2008 for Geant4 by  doxygen 1.4.7