Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::details::Bidirectional_iterator< Link, Rank > Class Template Reference

A common template for bidirectional iterators that work on identical modes of linking. More...

#include <spatial_bidirectional.hpp>

Inherits Rank.

Public Types

typedef mutate< typename Link::value_type >::type value_type
 The value_type can receive a copy of the reference pointed to be the iterator. More...
 
typedef Link::value_type & reference
 The reference type of the object pointed to by the iterator. More...
 
typedef Link::value_type * pointer
 The pointer type of the object pointed to by the iterator. More...
 
typedef std::ptrdiff_t difference_type
 The difference_type returned by the distance between 2 iterators. More...
 
typedef std::bidirectional_iterator_tag iterator_category
 The iterator category that is always Bidirectional_iterator_tag. More...
 
typedef Link::node_ptr node_ptr
 The type for the node pointed to by the iterator. More...
 
typedef Rank rank_type
 The type of rank used by the iterator. More...
 
typedef Link::invariant_category invariant_category
 The invariant category of the the iterator. More...
 

Public Member Functions

 Bidirectional_iterator ()
 Build an uninitialized iterator. More...
 
 Bidirectional_iterator (const Rank &rank_, node_ptr node_, dimension_type node_dim_)
 Initialize the node at construction time. More...
 
reference operator* ()
 Returns the reference to the value pointed to by the iterator. More...
 
pointer operator-> ()
 Returns a pointer to the value pointed to by the iterator. More...
 
bool operator== (const Const_node_iterator< Link > &x) const
 A bidirectional iterator can be compared with a node iterator if they work on identical linking modes. More...
 
bool operator!= (const Const_node_iterator< Link > &x) const
 A bidirectional iterator can be compared for inequality with a node iterator if they work on identical linking modes. More...
 
const rank_typerank () const
 Return the current Rank type used by the iterator. More...
 
dimension_type dimension () const
 Return the number of dimensions stored by the Rank of the iterator. More...
 
 operator Node_iterator< Link > () const
 This iterator can be casted silently into a container iterator. More...
 
 operator Const_node_iterator< Link > () const
 This iterator can be casted silently into a container iterator. More...
 

Public Attributes

node_ptr node
 The pointer to the current node. More...
 
dimension_type node_dim
 The dimension of the current node. More...
 

Detailed Description

template<typename Link, typename Rank>
class spatial::details::Bidirectional_iterator< Link, Rank >

A common template for bidirectional iterators that work on identical modes of linking.

This template defines all the basic features of a bidirectional iterator for this library.

Template Parameters
LinkA model of Link Mode.
RankThe rank of the iterator.

Definition at line 33 of file spatial_bidirectional.hpp.

Member Typedef Documentation

template<typename Link, typename Rank>
typedef std::ptrdiff_t spatial::details::Bidirectional_iterator< Link, Rank >::difference_type

The difference_type returned by the distance between 2 iterators.

Definition at line 44 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef Link::invariant_category spatial::details::Bidirectional_iterator< Link, Rank >::invariant_category

The invariant category of the the iterator.

Definition at line 52 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef std::bidirectional_iterator_tag spatial::details::Bidirectional_iterator< Link, Rank >::iterator_category

The iterator category that is always Bidirectional_iterator_tag.

Definition at line 46 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef Link::node_ptr spatial::details::Bidirectional_iterator< Link, Rank >::node_ptr

The type for the node pointed to by the iterator.

Definition at line 48 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef Link::value_type* spatial::details::Bidirectional_iterator< Link, Rank >::pointer

The pointer type of the object pointed to by the iterator.

Definition at line 42 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef Rank spatial::details::Bidirectional_iterator< Link, Rank >::rank_type

The type of rank used by the iterator.

Definition at line 50 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef Link::value_type& spatial::details::Bidirectional_iterator< Link, Rank >::reference

The reference type of the object pointed to by the iterator.

Definition at line 40 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
typedef mutate<typename Link::value_type>::type spatial::details::Bidirectional_iterator< Link, Rank >::value_type

The value_type can receive a copy of the reference pointed to be the iterator.

Definition at line 38 of file spatial_bidirectional.hpp.

Constructor & Destructor Documentation

template<typename Link, typename Rank>
spatial::details::Bidirectional_iterator< Link, Rank >::Bidirectional_iterator ( )

Build an uninitialized iterator.

Definition at line 55 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
spatial::details::Bidirectional_iterator< Link, Rank >::Bidirectional_iterator ( const Rank &  rank_,
node_ptr  node_,
dimension_type  node_dim_ 
)

Initialize the node at construction time.

Definition at line 58 of file spatial_bidirectional.hpp.

Member Function Documentation

template<typename Link, typename Rank>
dimension_type spatial::details::Bidirectional_iterator< Link, Rank >::dimension ( ) const

Return the number of dimensions stored by the Rank of the iterator.

Definition at line 112 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
spatial::details::Bidirectional_iterator< Link, Rank >::operator Const_node_iterator< Link > ( ) const

This iterator can be casted silently into a container iterator.

You can therefore use this iterator as an argument to the erase function of the container, for example.

Warning
When using this iterator as an argument to the erase function of the container, this iterator will get invalidated after erase.

Definition at line 100 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
spatial::details::Bidirectional_iterator< Link, Rank >::operator Node_iterator< Link > ( ) const

This iterator can be casted silently into a container iterator.

You can therefore use this iterator as an argument to the erase function of the container, for example.

Warning
When using this iterator as an argument to the erase function of the container, this iterator will get invalidated after erase.

Definition at line 97 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
bool spatial::details::Bidirectional_iterator< Link, Rank >::operator!= ( const Const_node_iterator< Link > &  x) const

A bidirectional iterator can be compared for inequality with a node iterator if they work on identical linking modes.

Parameters
xThe iterator on the right.

Definition at line 85 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
reference spatial::details::Bidirectional_iterator< Link, Rank >::operator* ( )

Returns the reference to the value pointed to by the iterator.

Definition at line 63 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
pointer spatial::details::Bidirectional_iterator< Link, Rank >::operator-> ( )

Returns a pointer to the value pointed to by the iterator.

Definition at line 67 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
bool spatial::details::Bidirectional_iterator< Link, Rank >::operator== ( const Const_node_iterator< Link > &  x) const

A bidirectional iterator can be compared with a node iterator if they work on identical linking modes.

Parameters
xThe iterator on the right.

Definition at line 76 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
const rank_type& spatial::details::Bidirectional_iterator< Link, Rank >::rank ( ) const

Return the current Rank type used by the iterator.

Definition at line 107 of file spatial_bidirectional.hpp.

Member Data Documentation

template<typename Link, typename Rank>
node_ptr spatial::details::Bidirectional_iterator< Link, Rank >::node

The pointer to the current node.

Modifying this attribute can potentially invalidate the iterator. Do not modify this attribute unless you know what you're doing. This iterator must always point to a valid node in the tree or to the end.

Definition at line 122 of file spatial_bidirectional.hpp.

template<typename Link, typename Rank>
dimension_type spatial::details::Bidirectional_iterator< Link, Rank >::node_dim

The dimension of the current node.

Modifying this attribute can potentially invalidate the iterator. Do not modify this attribute unless you know what you're doing. This iterator must always point to a valid node in the tree or to the end.

Definition at line 131 of file spatial_bidirectional.hpp.


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