Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::details::Preorder_node_iterator< Link > Struct Template Reference

A forward iterator that iterates through the node of the container in preorder transversal. More...

#include <spatial_node.hpp>

Public Types

typedef mutate< typename Link::value_type >::type value_type
 
typedef const Link::value_type & reference
 
typedef const Link::value_type * pointer
 
typedef std::ptrdiff_t difference_type
 
typedef std::forward_iterator_tag iterator_category
 
typedef Link::const_node_ptr node_ptr
 

Public Member Functions

 Preorder_node_iterator ()
 Create an uninintialized iterator. More...
 
 Preorder_node_iterator (node_ptr x)
 Build and assign an interator to a link pointer. More...
 
reference operator* ()
 Dereferance the iterator: return the value of the node. More...
 
pointer operator-> ()
 Dereferance the iterator: return the pointer to the value of the node. More...
 
Selfoperator++ ()
 Moves the iterator to the next node in preorder transversal. More...
 
Self operator++ (int)
 Moves the iterator to the next node in preorder transversal and returns the iterator value before the move. More...
 
bool operator== (const Self &x) const
 Check if 2 iterators are equal: pointing at the same node. More...
 
bool operator!= (const Self &x) const
 Check if 2 iterators are different: pointing at different nodes. More...
 

Public Attributes

node_ptr node
 The node pointed to by the iterator. More...
 

Private Types

typedef Preorder_node_iterator< Link > Self
 

Detailed Description

template<typename Link>
struct spatial::details::Preorder_node_iterator< Link >

A forward iterator that iterates through the node of the container in preorder transversal.

It provides constant access to the node. It is used to clone the tree.

Template Parameters
LinkThe linking mode for the node.

Definition at line 688 of file spatial_node.hpp.

Member Typedef Documentation

template<typename Link >
typedef std::ptrdiff_t spatial::details::Preorder_node_iterator< Link >::difference_type

Definition at line 693 of file spatial_node.hpp.

template<typename Link >
typedef std::forward_iterator_tag spatial::details::Preorder_node_iterator< Link >::iterator_category

Definition at line 694 of file spatial_node.hpp.

template<typename Link >
typedef Link::const_node_ptr spatial::details::Preorder_node_iterator< Link >::node_ptr

Definition at line 695 of file spatial_node.hpp.

template<typename Link >
typedef const Link::value_type* spatial::details::Preorder_node_iterator< Link >::pointer

Definition at line 692 of file spatial_node.hpp.

template<typename Link >
typedef const Link::value_type& spatial::details::Preorder_node_iterator< Link >::reference

Definition at line 691 of file spatial_node.hpp.

template<typename Link >
typedef Preorder_node_iterator<Link> spatial::details::Preorder_node_iterator< Link >::Self
private

Definition at line 698 of file spatial_node.hpp.

template<typename Link >
typedef mutate<typename Link::value_type>::type spatial::details::Preorder_node_iterator< Link >::value_type

Definition at line 690 of file spatial_node.hpp.

Constructor & Destructor Documentation

Create an uninintialized iterator.

This iterator should not be used until is has been assigned.

Definition at line 703 of file spatial_node.hpp.

template<typename Link >
spatial::details::Preorder_node_iterator< Link >::Preorder_node_iterator ( node_ptr  x)
explicit

Build and assign an interator to a link pointer.

Definition at line 707 of file spatial_node.hpp.

Member Function Documentation

template<typename Link >
bool spatial::details::Preorder_node_iterator< Link >::operator!= ( const Self x) const

Check if 2 iterators are different: pointing at different nodes.

Definition at line 731 of file spatial_node.hpp.

template<typename Link >
reference spatial::details::Preorder_node_iterator< Link >::operator* ( )

Dereferance the iterator: return the value of the node.

Definition at line 710 of file spatial_node.hpp.

template<typename Link >
Self& spatial::details::Preorder_node_iterator< Link >::operator++ ( )

Moves the iterator to the next node in preorder transversal.

Definition at line 718 of file spatial_node.hpp.

template<typename Link >
Self spatial::details::Preorder_node_iterator< Link >::operator++ ( int  )

Moves the iterator to the next node in preorder transversal and returns the iterator value before the move.

Definition at line 723 of file spatial_node.hpp.

template<typename Link >
pointer spatial::details::Preorder_node_iterator< Link >::operator-> ( )

Dereferance the iterator: return the pointer to the value of the node.

Definition at line 714 of file spatial_node.hpp.

template<typename Link >
bool spatial::details::Preorder_node_iterator< Link >::operator== ( const Self x) const

Check if 2 iterators are equal: pointing at the same node.

Definition at line 727 of file spatial_node.hpp.

Member Data Documentation

template<typename Link >
node_ptr spatial::details::Preorder_node_iterator< Link >::node

The node pointed to by the iterator.

Definition at line 735 of file spatial_node.hpp.


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