Orfeo Toolbox  4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
itk::TreeIteratorBase< TTreeType > Class Template Referenceabstract

This class provides the base implementation for tree iterators. More...

#include <itkTreeIteratorBase.h>

+ Inheritance diagram for itk::TreeIteratorBase< TTreeType >:

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

TreeNodeTypem_Begin
 
TreeNodeTypem_End
 
TreeNodeTypem_Position
 
const TreeNodeTypem_Root
 
TTreeType * m_Tree
 

Detailed Description

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

This class provides the base implementation for tree iterators.

Events will notify interested observers about tree changes. These events all derive from TreeChangeEvent. They are:

All those events have a member GetChangePosition(), which returns an iterator to the position that has changd. Please note that this iterator may not be fully functional, but you should always be able to use its Get() method to retrieve the thing it points to.

Definition at line 42 of file itkTreeIteratorBase.h.

Member Typedef Documentation

template<typename TTreeType>
typedef TreeNodeType::ChildIdentifier itk::TreeIteratorBase< TTreeType >::ChildIdentifier

Definition at line 50 of file itkTreeIteratorBase.h.

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

Typedefs

Definition at line 47 of file itkTreeIteratorBase.h.

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

Definition at line 49 of file itkTreeIteratorBase.h.

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

Definition at line 48 of file itkTreeIteratorBase.h.

Member Enumeration Documentation

template<typename TTreeType>
enum itk::TreeIteratorBase::NodeType

Enumerations

Enumerator
UNDEFIND 
PREORDER 
INORDER 
POSTORDER 
LEVELORDER 
CHILD 
ROOT 
LEAF 

Definition at line 53 of file itkTreeIteratorBase.h.

Constructor & Destructor Documentation

template<typename TTreeType>
virtual itk::TreeIteratorBase< TTreeType >::~TreeIteratorBase ( )
inlinevirtual

Definition at line 194 of file itkTreeIteratorBase.h.

template<typename TTreeType >
itk::TreeIteratorBase< TTreeType >::TreeIteratorBase ( TTreeType *  tree,
const TreeNodeType start 
)
protected

Constructors

Constructor

Definition at line 42 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType >
itk::TreeIteratorBase< TTreeType >::TreeIteratorBase ( const TTreeType *  tree,
const TreeNodeType start 
)
protected

Constructor

Definition at line 61 of file itkTreeIteratorBase.hxx.

References NULL.

Member Function Documentation

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::Add ( ValueType  element)
virtual

Add an element to the tree

Add a value to the node. This creates a new child node

Definition at line 99 of file itkTreeIteratorBase.hxx.

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

Referenced by itk::TreeContainer< TValueType >::Add().

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::Add ( int  position,
ValueType  element 
)
virtual

Add an element at a given position

Add a new element at a given position

Definition at line 138 of file itkTreeIteratorBase.hxx.

References itk::TreeIteratorBase< TTreeType >::m_Position.

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::Add ( TTreeType &  subTree)
virtual

Add a subtree

Definition at line 187 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType >
int itk::TreeIteratorBase< TTreeType >::ChildPosition ( ValueType  element) const
virtual

Return the current ChildPosition of an element

Return the current position of the child

Definition at line 244 of file itkTreeIteratorBase.hxx.

template<typename TTreeType >
TreeIteratorBase< TTreeType > * itk::TreeIteratorBase< TTreeType >::Children ( )
virtual

Return a list of children

Return the children list

Definition at line 341 of file itkTreeIteratorBase.hxx.

template<typename TTreeType>
virtual TreeIteratorBase< TTreeType >* itk::TreeIteratorBase< TTreeType >::Clone ( )
pure virtual
template<typename TTreeType >
int itk::TreeIteratorBase< TTreeType >::Count ( )
virtual

Count the number of nodes

Count the number of nodes from the beginning

Definition at line 431 of file itkTreeIteratorBase.hxx.

template<typename TTreeType >
int itk::TreeIteratorBase< TTreeType >::CountChildren ( ) const
virtual

Count the number of children

Definition at line 284 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::Disconnect ( )
virtual

Disconnect the tree

Definition at line 304 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType >
const TreeIteratorBase< TTreeType >::ValueType & itk::TreeIteratorBase< TTreeType >::Get ( void  ) const
virtual
template<typename TTreeType >
TreeIteratorBase< TTreeType > * itk::TreeIteratorBase< TTreeType >::GetChild ( int  number) const
virtual

Return a list of child

Get a child given a number

Definition at line 411 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType >
TreeIteratorBase< TTreeType >::TreeNodeType * itk::TreeIteratorBase< TTreeType >::GetNode ( )
virtual
template<typename TTreeType >
const TreeIteratorBase< TTreeType >::TreeNodeType * itk::TreeIteratorBase< TTreeType >::GetNode ( ) const
virtual

Get the node pointed by the iterator

Definition at line 458 of file itkTreeIteratorBase.hxx.

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

Return the first parent found

Definition at line 352 of file itkTreeIteratorBase.hxx.

References NULL.

Referenced by itk::TreeContainer< TValueType >::PrintSelf().

template<typename TTreeType >
TreeIteratorBase< TTreeType >::TreeNodeType * itk::TreeIteratorBase< TTreeType >::GetRoot ( )

Get the root

Definition at line 466 of file itkTreeIteratorBase.hxx.

template<typename TTreeType >
const TreeIteratorBase< TTreeType >::TreeNodeType * itk::TreeIteratorBase< TTreeType >::GetRoot ( ) const

Get the root (const)

Definition at line 474 of file itkTreeIteratorBase.hxx.

template<typename TTreeType >
TTreeType * itk::TreeIteratorBase< TTreeType >::GetSubTree ( ) const
virtual

Get the subtree

Return the subtree

Definition at line 217 of file itkTreeIteratorBase.hxx.

template<typename TTreeType >
TTreeType * itk::TreeIteratorBase< TTreeType >::GetTree ( ) const

Get the tree

Return the tree

Definition at line 526 of file itkTreeIteratorBase.hxx.

template<typename TTreeType>
virtual NodeType itk::TreeIteratorBase< TTreeType >::GetType ( ) const
pure virtual
template<typename TTreeType>
void itk::TreeIteratorBase< TTreeType >::GoToBegin ( void  )
inline
template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::GoToChild ( ChildIdentifier  number = 0)
virtual

Go to the specified child

Go to a child

Reimplemented in itk::ChildTreeIterator< TTreeType >.

Definition at line 374 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType>
void itk::TreeIteratorBase< TTreeType >::GoToEnd ( void  )
inline

Move an iterator to the end of the tree.

Definition at line 152 of file itkTreeIteratorBase.h.

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

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::GoToParent ( )
virtual

Go to the parent

Go to a parent

Reimplemented in itk::ChildTreeIterator< TTreeType >.

Definition at line 393 of file itkTreeIteratorBase.hxx.

References NULL.

Referenced by otb::VectorData< TPrecision, VDimension, TValuePrecision >::PrintSelf().

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::HasChild ( int  number = 0) const
virtual

Return true if the current node has a child

Return true of the current node has a child

Definition at line 228 of file itkTreeIteratorBase.hxx.

References NULL.

Referenced by itk::LeafTreeIterator< TTreeType >::FindNextNode().

template<typename TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::HasNext ( ) const
protectedpure virtual
template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::HasParent ( ) const
virtual

Return true if the current node has a parent

Return true of the pointed node has a parent

Definition at line 296 of file itkTreeIteratorBase.hxx.

References NULL.

Referenced by itk::TreeContainer< TValueType >::IsRoot(), and otb::VectorData< TPrecision, VDimension, TValuePrecision >::PrintSelf().

template<typename TTreeType>
bool itk::TreeIteratorBase< TTreeType >::IsAtBegin ( void  ) const
inline

Is the iterator at the beginning of the tree?

Definition at line 155 of file itkTreeIteratorBase.h.

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

template<typename TTreeType>
bool itk::TreeIteratorBase< TTreeType >::IsAtEnd ( void  ) const
inline
template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::IsLeaf ( ) const
virtual

Return true if the current node is a leaf

Return true if the current pointed node is a leaf

Definition at line 162 of file itkTreeIteratorBase.hxx.

Referenced by itk::TreeContainer< TValueType >::IsLeaf().

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::IsRoot ( ) const
virtual

Return true if the current node is a root

Return true if the current pointed node is a root

Definition at line 170 of file itkTreeIteratorBase.hxx.

References NULL.

template<typename TTreeType>
virtual const ValueType& itk::TreeIteratorBase< TTreeType >::Next ( )
protectedpure virtual
template<typename TTreeType>
Self& itk::TreeIteratorBase< TTreeType >::operator++ ( )
inline

operator++

Definition at line 166 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::Next().

template<typename TTreeType>
void itk::TreeIteratorBase< TTreeType >::operator++ ( int  )
inline

operator++

Definition at line 174 of file itkTreeIteratorBase.h.

References itk::TreeIteratorBase< TTreeType >::Next().

template<typename TTreeType>
Self& itk::TreeIteratorBase< TTreeType >::operator= ( const Self iterator)
inline
template<typename TTreeType >
TreeIteratorBase< TTreeType > * itk::TreeIteratorBase< TTreeType >::Parents ( )
virtual

Return a list of parents

Return the list of parents

Definition at line 364 of file itkTreeIteratorBase.hxx.

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::Remove ( )

Remove the current node from the tree

Remove a specific node (and its child nodes!)

Definition at line 482 of file itkTreeIteratorBase.hxx.

References NULL.

Referenced by itk::TreeContainer< TValueType >::Clear().

template<typename TTreeType >
bool itk::TreeIteratorBase< TTreeType >::RemoveChild ( int  number)
virtual

Remove a child

Definition at line 256 of file itkTreeIteratorBase.hxx.

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

template<typename TTreeType >
void itk::TreeIteratorBase< TTreeType >::Set ( ValueType  element)

Set the current value of the node

Definition at line 88 of file itkTreeIteratorBase.hxx.

Member Data Documentation

template<typename TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Begin
mutableprotected
template<typename TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_End
mutableprotected
template<typename TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Position
mutableprotected
template<typename TTreeType>
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Root
protected
template<typename TTreeType>
TTreeType* itk::TreeIteratorBase< TTreeType >::m_Tree
protected

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

Generated at Sat Mar 8 2014 17:54:30 for Orfeo Toolbox with doxygen 1.8.3.1