TiledArray::detail::RangeIterator< T, Container > Class Template Reference

Documentation

template<typename T, typename Container>
class TiledArray::detail::RangeIterator< T, Container >

Coordinate index iterate.

This is an input iterator that is used to iterate over the coordinate indexes of a Range.

Template Parameters
TThe value type of the iterator
ContainerThe container that the iterator references
Note
The container object must define the function Container::increment(T&) const, and be accessible to RangeIterator.

Definition at line 62 of file range_iterator.h.

Public Types

typedef RangeIterator< T, Container > RangeIterator_
 This class type. More...
 
typedef Container::index_type value_type
 Iterator value type. More...
 
typedef const value_typereference
 Iterator reference type. More...
 
typedef const value_typepointer
 Iterator pointer type. More...
 
typedef std::input_iterator_tag iterator_category
 
typedef std::ptrdiff_t difference_type
 Iterator category tag. More...
 

Public Member Functions

 RangeIterator (const RangeIterator_ &other)
 Copy constructor. More...
 
 RangeIterator (const T *v, const Container *c)
 Construct an index iterator. More...
 
RangeIterator_operator= (const RangeIterator_ &other)
 Copy constructor. More...
 
const Container * container () const
 
reference operator* () const
 Dereference operator. More...
 
RangeIterator_operator++ ()
 Increment operator. More...
 
RangeIterator_ operator++ (int)
 Increment operator. More...
 
pointer operator-> () const
 Pointer operator. More...
 
void advance (difference_type n)
 
difference_type distance_to (const RangeIterator_ &other) const
 

Friends

template<typename U , typename C >
bool operator== (const RangeIterator< U, C > &left_it, const RangeIterator< U, C > &right_it)
 

Member Typedef Documentation

◆ difference_type

template<typename T , typename Container >
typedef std::ptrdiff_t TiledArray::detail::RangeIterator< T, Container >::difference_type

Iterator category tag.

Iterator difference type

Definition at line 71 of file range_iterator.h.

◆ iterator_category

template<typename T , typename Container >
typedef std::input_iterator_tag TiledArray::detail::RangeIterator< T, Container >::iterator_category

Definition at line 70 of file range_iterator.h.

◆ pointer

template<typename T , typename Container >
typedef const value_type* TiledArray::detail::RangeIterator< T, Container >::pointer

Iterator pointer type.

Definition at line 69 of file range_iterator.h.

◆ RangeIterator_

template<typename T , typename Container >
typedef RangeIterator<T, Container> TiledArray::detail::RangeIterator< T, Container >::RangeIterator_

This class type.

Definition at line 64 of file range_iterator.h.

◆ reference

template<typename T , typename Container >
typedef const value_type& TiledArray::detail::RangeIterator< T, Container >::reference

Iterator reference type.

Definition at line 68 of file range_iterator.h.

◆ value_type

template<typename T , typename Container >
typedef Container::index_type TiledArray::detail::RangeIterator< T, Container >::value_type

Iterator value type.

Definition at line 67 of file range_iterator.h.

Constructor & Destructor Documentation

◆ RangeIterator() [1/2]

template<typename T , typename Container >
TiledArray::detail::RangeIterator< T, Container >::RangeIterator ( const RangeIterator_ other)
inline

Copy constructor.

Parameters
otherThe other iterator to be copied

Definition at line 76 of file range_iterator.h.

◆ RangeIterator() [2/2]

template<typename T , typename Container >
TiledArray::detail::RangeIterator< T, Container >::RangeIterator ( const T *  v,
const Container *  c 
)
inline

Construct an index iterator.

Parameters
vThe initial value of the iterator index
cThe container that the iterator will reference

Definition at line 83 of file range_iterator.h.

Member Function Documentation

◆ advance()

template<typename T , typename Container >
void TiledArray::detail::RangeIterator< T, Container >::advance ( difference_type  n)
inline

Definition at line 137 of file range_iterator.h.

Here is the caller graph for this function:

◆ container()

template<typename T , typename Container >
const Container* TiledArray::detail::RangeIterator< T, Container >::container ( ) const
inline

Definition at line 97 of file range_iterator.h.

Here is the caller graph for this function:

◆ distance_to()

template<typename T , typename Container >
difference_type TiledArray::detail::RangeIterator< T, Container >::distance_to ( const RangeIterator_ other) const
inline

Definition at line 142 of file range_iterator.h.

Here is the caller graph for this function:

◆ operator*()

template<typename T , typename Container >
reference TiledArray::detail::RangeIterator< T, Container >::operator* ( ) const
inline

Dereference operator.

Returns
A reference to the current data
Note
this asserts that the iterator is valid

Definition at line 103 of file range_iterator.h.

◆ operator++() [1/2]

template<typename T , typename Container >
RangeIterator_& TiledArray::detail::RangeIterator< T, Container >::operator++ ( )
inline

Increment operator.

Increment the iterator

Returns
The modified iterator

Definition at line 112 of file range_iterator.h.

◆ operator++() [2/2]

template<typename T , typename Container >
RangeIterator_ TiledArray::detail::RangeIterator< T, Container >::operator++ ( int  )
inline

Increment operator.

Increment the iterator

Returns
An unmodified copy of the iterator

Definition at line 122 of file range_iterator.h.

◆ operator->()

template<typename T , typename Container >
pointer TiledArray::detail::RangeIterator< T, Container >::operator-> ( ) const
inline

Pointer operator.

Returns
A pointer to the current data

Definition at line 132 of file range_iterator.h.

◆ operator=()

template<typename T , typename Container >
RangeIterator_& TiledArray::detail::RangeIterator< T, Container >::operator= ( const RangeIterator_ other)
inline

Copy constructor.

Parameters
otherThe other iterator to be copied
Returns
A reference to this object

Definition at line 90 of file range_iterator.h.

Friends And Related Function Documentation

◆ operator==

template<typename T , typename Container >
template<typename U , typename C >
bool operator== ( const RangeIterator< U, C > &  left_it,
const RangeIterator< U, C > &  right_it 
)
friend

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