ITK  5.1.0
Insight Toolkit
Public Types | Public Member Functions | List of all members
itk::TreeIteratorBase< TTreeType > Class Template Referenceabstract

#include <itkTreeIteratorBase.h>

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

Public Types

using ChildIdentifier = typename TreeNodeType::ChildIdentifier
 
using NodeType = TreeIteratorBaseNodeEnum
 
using Self = TreeIteratorBase
 
using TreeNodeType = typename TTreeType::TreeNodeType
 
using ValueType = typename TTreeType::ValueType
 

Public Member Functions

virtual bool Add (int position, ValueType element)
 
virtual bool Add (TTreeType &subTree)
 
virtual bool Add (ValueType element)
 
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 () const
 
bool IsAtEnd () const
 
virtual bool IsLeaf () const
 
virtual bool IsRoot () const
 
virtual TreeIteratorBase< TTreeType > * Parents ()
 
bool Remove ()
 
virtual bool RemoveChild (int number)
 
void Set (ValueType element)
 
TreeNodeTypem_Position
 
TreeNodeTypem_Begin
 
const TreeNodeTypem_Root
 
TTreeType * m_Tree
 
Selfoperator++ ()
 
void operator++ (int)
 
Selfoperator= (const Self &iterator)
 
virtual ~TreeIteratorBase ()=default
 
 TreeIteratorBase (TTreeType *tree, const TreeNodeType *start)
 
 TreeIteratorBase (const TTreeType *tree, const TreeNodeType *start)
 
virtual bool HasNext () const =0
 
virtual const ValueTypeNext ()=0
 

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.

Examples
Examples/DataRepresentation/Containers/TreeContainer.cxx.

Definition at line 58 of file itkTreeIteratorBase.h.

Member Typedef Documentation

◆ ChildIdentifier

template<typename TTreeType>
using itk::TreeIteratorBase< TTreeType >::ChildIdentifier = typename TreeNodeType::ChildIdentifier

Definition at line 65 of file itkTreeIteratorBase.h.

◆ NodeType

template<typename TTreeType>
using itk::TreeIteratorBase< TTreeType >::NodeType = TreeIteratorBaseNodeEnum

Backwards compatibility for enum values

Definition at line 68 of file itkTreeIteratorBase.h.

◆ Self

template<typename TTreeType>
using itk::TreeIteratorBase< TTreeType >::Self = TreeIteratorBase

Typedefs

Definition at line 62 of file itkTreeIteratorBase.h.

◆ TreeNodeType

template<typename TTreeType>
using itk::TreeIteratorBase< TTreeType >::TreeNodeType = typename TTreeType::TreeNodeType

Definition at line 64 of file itkTreeIteratorBase.h.

◆ ValueType

template<typename TTreeType>
using itk::TreeIteratorBase< TTreeType >::ValueType = typename TTreeType::ValueType

Definition at line 63 of file itkTreeIteratorBase.h.

Constructor & Destructor Documentation

◆ ~TreeIteratorBase()

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

operator++

◆ TreeIteratorBase() [1/2]

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

Constructors

◆ TreeIteratorBase() [2/2]

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

operator++

Member Function Documentation

◆ Add() [1/3]

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

Add an element at a given position

◆ Add() [2/3]

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

Add a subtree

◆ Add() [3/3]

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

Add an element to the tree

◆ ChildPosition()

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

Return the current ChildPosition of an element

◆ Children()

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

Return a list of children

◆ Clone()

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

◆ Count()

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

Count the number of nodes

◆ CountChildren()

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

Count the number of children

◆ Disconnect()

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

Disconnect the tree

◆ Get()

template<typename TTreeType>
virtual const ValueType& itk::TreeIteratorBase< TTreeType >::Get ( ) const
virtual

◆ GetChild()

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

Return a list of child

◆ GetNode() [1/2]

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

Get the current node

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

◆ GetNode() [2/2]

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

◆ GetParent()

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

Return the first parent found

◆ GetRoot() [1/2]

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

Get the root

◆ GetRoot() [2/2]

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

◆ GetSubTree()

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

Get the subtree

◆ GetTree()

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

Get the tree

◆ GetType()

template<typename TTreeType>
virtual NodeType itk::TreeIteratorBase< TTreeType >::GetType ( ) const
pure virtual

◆ GoToBegin()

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

Move an iterator to the beginning of the tree

Definition at line 194 of file itkTreeIteratorBase.h.

◆ GoToChild()

template<typename TTreeType>
virtual bool itk::TreeIteratorBase< TTreeType >::GoToChild ( ChildIdentifier  number = 0)
virtual

Go to the specified child

Reimplemented in itk::ChildTreeIterator< TTreeType >.

◆ GoToEnd()

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

Move an iterator to the end of the tree.

Definition at line 201 of file itkTreeIteratorBase.h.

◆ GoToParent()

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

Go to the parent

Reimplemented in itk::ChildTreeIterator< TTreeType >.

◆ HasChild()

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

Return true if the current node has a child

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

◆ HasNext()

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

◆ HasParent()

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

Return true if the current node has a parent

◆ IsAtBegin()

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

Is the iterator at the beginning of the tree?

Definition at line 208 of file itkTreeIteratorBase.h.

◆ IsAtEnd()

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

Is the iterator at the end of the tree?

Definition at line 215 of file itkTreeIteratorBase.h.

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

◆ IsLeaf()

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

Return true if the current node is a leaf

◆ IsRoot()

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

Return true if the current node is a root

◆ Next()

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

◆ operator++() [1/2]

template<typename TTreeType>
Self& itk::TreeIteratorBase< TTreeType >::operator++ ( )
inline

operator++

Definition at line 226 of file itkTreeIteratorBase.h.

◆ operator++() [2/2]

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

operator++

Definition at line 235 of file itkTreeIteratorBase.h.

◆ operator=()

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

◆ Parents()

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

Return a list of parents

◆ Remove()

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

Remove the current node from the tree

◆ RemoveChild()

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

Remove a child

◆ Set()

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

Set the current value of the node

Member Data Documentation

◆ m_Begin

template<typename TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Begin
mutableprotected

◆ m_Position

template<typename TTreeType>
TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Position
mutableprotected

◆ m_Root

template<typename TTreeType>
const TreeNodeType* itk::TreeIteratorBase< TTreeType >::m_Root
protected

◆ m_Tree

template<typename TTreeType>
TTreeType* itk::TreeIteratorBase< TTreeType >::m_Tree
protected

operator++

Definition at line 266 of file itkTreeIteratorBase.h.

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


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