Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::TreeIteratorBase< TTreeType > Class Template Reference

TreeIteratorBase class. More...

#include <itkTreeIteratorBase.h>

Inheritance diagram for itk::TreeIteratorBase< TTreeType >:

Inheritance graph
[legend]
Collaboration diagram for itk::TreeIteratorBase< TTreeType >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TreeIteratorBase<
TTreeType > 
Self
typedef TTreeType::ValueType ValueType
typedef TTreeType::TreeNodeType TreeNodeType
enum  {
  UNDEFIND = 0, PREORDER = 1, INORDER = 2, POSTORDER = 3,
  LEVELORDER = 4, CHILD = 5, ROOT = 6, LEAF = 7
}

Public Member Functions

virtual bool Add (ValueType element)
virtual bool Add (int position, ValueType element)
virtual bool Add (TTreeType &subTree)
virtual const ValueTypeGet () const
virtual TTreeType * GetSubTree () const
virtual bool IsLeaf () const
virtual bool IsRoot () const
virtual int GetType () const=0
virtual bool GoToChild (int number=0)
virtual bool GoToParent ()
ValueTypeSet (ValueType element)
virtual bool HasChild (int number=0) const
virtual int ChildPosition (ValueType element) const
virtual bool RemoveChild (int number)
virtual int CountChildren () const
virtual bool HasParent () const
virtual bool Disconnect ()
virtual TreeIteratorBase<
TTreeType > * 
Children ()
virtual TreeIteratorBase<
TTreeType > * 
Parents ()
virtual TreeIteratorBase<
TTreeType > * 
GetChild (int number) const
virtual int Count ()
bool Remove ()
TTreeType * GetTree () const
const TreeNodeTypeGetParent () const
void GoToBegin ()
void GoToEnd ()
bool IsAtBegin (void) const
bool IsAtEnd (void) const
virtual TreeIteratorBase<
TTreeType > * 
Clone ()=0
virtual Selfoperator= (Self &iterator)
virtual TreeNodeTypeGetNode ()
virtual const TreeNodeTypeGetNode () const
TreeNodeType *& GetRoot ()
const TreeNodeType *& GetRoot () const
Selfoperator++ ()

Protected Member Functions

int Count (TreeNodeType *node)
virtual bool HasNext () const=0
virtual const ValueTypeNext ()=0
 TreeIteratorBase (TTreeType *tree, const TreeNodeType *start)
 TreeIteratorBase (const TTreeType *tree, const TreeNodeType *start)

Protected Attributes

TreeNodeTypem_Position
TreeNodeTypem_Begin
TreeNodeTypem_End
const TreeNodeTypem_Root
TTreeType * m_Tree

Detailed Description

template<class TTreeType>
class itk::TreeIteratorBase< TTreeType >

TreeIteratorBase class.

This class provides the base implementation for tree iterators

Definition at line 30 of file itkTreeIteratorBase.h.


Member Typedef Documentation

template<class TTreeType>
typedef TreeIteratorBase<TTreeType> itk::TreeIteratorBase< TTreeType >::Self
 

Typedefs

Reimplemented in itk::ChildTreeIterator< TTreeType >, and itk::LevelOrderTreeIterator< TTreeType >.

Definition at line 35 of file itkTreeIteratorBase.h.

template<class TTreeType>
typedef TTreeType::TreeNodeType itk::TreeIteratorBase< TTreeType >::TreeNodeType
 

Reimplemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.

Definition at line 37 of file itkTreeIteratorBase.h.

template<class TTreeType>
typedef TTreeType::ValueType itk::TreeIteratorBase< TTreeType >::ValueType
 

Reimplemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.

Definition at line 36 of file itkTreeIteratorBase.h.


Member Enumeration Documentation

template<class TTreeType>
anonymous enum
 

Enumerations

Enumeration values:
UNDEFIND 
PREORDER 
INORDER 
POSTORDER 
LEVELORDER 
CHILD 
ROOT 
LEAF 

Definition at line 149 of file itkTreeIteratorBase.h.


Constructor & Destructor Documentation

template<class TTreeType>
itk::TreeIteratorBase< TTreeType >::TreeIteratorBase TTreeType *  tree,
const TreeNodeType start
[protected]
 

Constructors

template<class TTreeType>
itk::TreeIteratorBase< TTreeType >::TreeIteratorBase const TTreeType *  tree,
const TreeNodeType start
[protected]
 

Constructors


Member Function Documentation

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::Add TTreeType &  subTree  )  [virtual]
 

Add a subtree

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::Add int  position,
ValueType  element
[virtual]
 

Add an element at a given position

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::Add ValueType  element  )  [virtual]
 

Add an element to the tree

template<class TTreeType>
virtual int itk::TreeIteratorBase< TTreeType >::ChildPosition ValueType  element  )  const [virtual]
 

Return the current ChildPosition of an element

template<class TTreeType>
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::Children  )  [virtual]
 

Return a list of children

template<class TTreeType>
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::Clone  )  [pure virtual]
 

Clone the iterator

Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.

template<class TTreeType>
int itk::TreeIteratorBase< TTreeType >::Count TreeNodeType node  )  [protected]
 

template<class TTreeType>
virtual int itk::TreeIteratorBase< TTreeType >::Count  )  [virtual]
 

Count the number of nodes

template<class TTreeType>
virtual int itk::TreeIteratorBase< TTreeType >::CountChildren  )  const [virtual]
 

Count the number of children

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::Disconnect  )  [virtual]
 

Disconnect the tree

template<class TTreeType>
virtual const ValueType& itk::TreeIteratorBase< TTreeType >::Get  )  const [virtual]
 

Get a value

template<class TTreeType>
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::GetChild int  number  )  const [virtual]
 

Return a list of child

template<class TTreeType>
virtual const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetNode  )  const [virtual]
 

Get the current node

template<class TTreeType>
virtual TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetNode  )  [virtual]
 

Get the current node

template<class TTreeType>
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::GetParent  )  const
 

Return the first parent found

template<class TTreeType>
const TreeNodeType* & itk::TreeIteratorBase< TTreeType >::GetRoot  )  const
 

Get the root

template<class TTreeType>
TreeNodeType* & itk::TreeIteratorBase< TTreeType >::GetRoot  ) 
 

Get the root

template<class TTreeType>
virtual TTreeType* itk::TreeIteratorBase< TTreeType >::GetSubTree  )  const [virtual]
 

Get the subtree

template<class TTreeType>
TTreeType* itk::TreeIteratorBase< TTreeType >::GetTree  )  const
 

Get the tree

template<class TTreeType>
virtual int itk::TreeIteratorBase< TTreeType >::GetType  )  const [pure virtual]
 

Get the type of iterator

Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.

template<class TTreeType>
void itk::TreeIteratorBase< TTreeType >::GoToBegin void   )  [inline]
 

Move an iterator to the beginning of the tree

Definition at line 122 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::m_Begin, and itk::TreeIteratorBase< TTreeType >::m_Position.

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::GoToChild int  number = 0  )  [virtual]
 

Go to the specified child

Reimplemented in itk::ChildTreeIterator< TTreeType >.

template<class TTreeType>
void itk::TreeIteratorBase< TTreeType >::GoToEnd void   )  [inline]
 

Move an iterator to the end of the tree.

Definition at line 128 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::m_End, and itk::TreeIteratorBase< TTreeType >::m_Position.

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::GoToParent  )  [virtual]
 

Go to the parent

Reimplemented in itk::ChildTreeIterator< TTreeType >.

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::HasChild int  number = 0  )  const [virtual]
 

Return true if the current node has a child

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::HasNext  )  const [protected, pure virtual]
 

Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::HasParent  )  const [virtual]
 

Return true if the current node has a parent

template<class TTreeType>
bool itk::TreeIteratorBase< TTreeType >::IsAtBegin void   )  const [inline]
 

Is the iterator at the beginning of the tree?

Definition at line 134 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::m_Begin, and itk::TreeIteratorBase< TTreeType >::m_Position.

template<class TTreeType>
bool itk::TreeIteratorBase< TTreeType >::IsAtEnd void   )  const [inline]
 

Is the iterator at the end of the tree?. The iterator is at the end if it points to NULL

Definition at line 140 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::m_End, and itk::TreeIteratorBase< TTreeType >::m_Position.

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::IsLeaf  )  const [virtual]
 

Return true if the current node is a leaf

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::IsRoot  )  const [virtual]
 

Return true if the current node is a root

template<class TTreeType>
virtual const ValueType& itk::TreeIteratorBase< TTreeType >::Next  )  [protected, pure virtual]
 

Implemented in itk::ChildTreeIterator< TTreeType >, itk::InOrderTreeIterator< TTreeType >, itk::LeafTreeIterator< TTreeType >, itk::LevelOrderTreeIterator< TTreeType >, itk::PostOrderTreeIterator< TTreeType >, itk::PreOrderTreeIterator< TTreeType >, and itk::RootTreeIterator< TTreeType >.

template<class TTreeType>
Self& itk::TreeIteratorBase< TTreeType >::operator++  )  [inline]
 

operator++

Definition at line 162 of file itkTreeIteratorBase.h.

template<class TTreeType>
virtual Self& itk::TreeIteratorBase< TTreeType >::operator= Self iterator  )  [inline, virtual]
 

operator =

Definition at line 170 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::m_Begin, itk::TreeIteratorBase< TTreeType >::m_End, itk::TreeIteratorBase< TTreeType >::m_Root, and itk::TreeIteratorBase< TTreeType >::m_Tree.

template<class TTreeType>
virtual TreeIteratorBase<TTreeType>* itk::TreeIteratorBase< TTreeType >::Parents  )  [virtual]
 

Return a list of parents

template<class TTreeType>
bool itk::TreeIteratorBase< TTreeType >::Remove  ) 
 

Remove the current node from the tree

template<class TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::RemoveChild int  number  )  [virtual]
 

Remove a child

template<class TTreeType>
ValueType& itk::TreeIteratorBase< TTreeType >::Set ValueType  element  ) 
 

Set the current value of the node


Member Data Documentation

template<class TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Begin [mutable, protected]
 

Definition at line 188 of file itkTreeIteratorBase.h.

Referenced by itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::IsAtBegin(), and itk::TreeIteratorBase< TTreeType >::operator=().

template<class TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_End [mutable, protected]
 

Definition at line 189 of file itkTreeIteratorBase.h.

Referenced by itk::TreeIteratorBase< TTreeType >::GoToEnd(), itk::TreeIteratorBase< TTreeType >::IsAtEnd(), and itk::TreeIteratorBase< TTreeType >::operator=().

template<class TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Position [mutable, protected]
 

Definition at line 187 of file itkTreeIteratorBase.h.

Referenced by itk::TreeIteratorBase< TTreeType >::GoToBegin(), itk::TreeIteratorBase< TTreeType >::GoToEnd(), itk::TreeIteratorBase< TTreeType >::IsAtBegin(), and itk::TreeIteratorBase< TTreeType >::IsAtEnd().

template<class TTreeType>
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Root [protected]
 

Definition at line 190 of file itkTreeIteratorBase.h.

Referenced by itk::TreeIteratorBase< TTreeType >::operator=().

template<class TTreeType>
TTreeType* itk::TreeIteratorBase< TTreeType >::m_Tree [protected]
 

Definition at line 191 of file itkTreeIteratorBase.h.

Referenced by itk::TreeIteratorBase< TTreeType >::operator=().


The documentation for this class was generated from the following file:
Generated at Thu May 25 02:31:29 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000