SPH
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Iterator< T > Class Template Reference

Simple (forward) iterator over continuous array of objects of type T. More...

#include <Iterator.h>

Inheritance diagram for Iterator< T >:
ThreadLocal< Type >::LocalIterator< T >

Public Types

using TCounter = ptrdiff_t
 
using iterator_category = std::random_access_iterator_tag
 
using value_type = T
 
using difference_type = ptrdiff_t
 
using pointer = T *
 
using reference = T &
 

Public Member Functions

 Iterator ()=default
 
 Iterator (T *data, const T *begin, const T *end)
 
 Iterator (std::nullptr_t)
 
INLINE const TValueoperator* () const
 
INLINE TValueoperator* ()
 
INLINE T * operator-> ()
 
INLINE const T * operator-> () const
 
INLINE operator bool () const
 
INLINE Iterator operator+ (const TCounter n) const
 
INLINE Iterator operator- (const TCounter n) const
 
INLINE void operator+= (const TCounter n)
 
INLINE void operator-= (const TCounter n)
 
INLINE Iteratoroperator++ ()
 
INLINE Iterator operator++ (int)
 
INLINE Iteratoroperator-- ()
 
INLINE Iterator operator-- (int)
 
INLINE difference_type operator- (const Iterator &iter) const
 
INLINE bool operator< (const Iterator &iter) const
 
INLINE bool operator> (const Iterator &iter) const
 
INLINE bool operator<= (const Iterator &iter) const
 
INLINE bool operator>= (const Iterator &iter) const
 
INLINE bool operator== (const Iterator &iter) const
 
INLINE bool operator!= (const Iterator &iter) const
 
INLINE operator Iterator< const T > () const
 

Protected Types

using TValue = typename UnwrapReferenceType< T >::Type
 

Protected Member Functions

 Iterator (T *data)
 

Protected Attributes

T * data
 

Detailed Description

template<typename T>
class Iterator< T >

Simple (forward) iterator over continuous array of objects of type T.

Can be used with STL algorithms.

Definition at line 18 of file Iterator.h.

Member Typedef Documentation

◆ difference_type

template<typename T >
using Iterator< T >::difference_type = ptrdiff_t

Definition at line 36 of file Iterator.h.

◆ iterator_category

template<typename T >
using Iterator< T >::iterator_category = std::random_access_iterator_tag

Definition at line 34 of file Iterator.h.

◆ pointer

template<typename T >
using Iterator< T >::pointer = T*

Definition at line 37 of file Iterator.h.

◆ reference

template<typename T >
using Iterator< T >::reference = T&

Definition at line 38 of file Iterator.h.

◆ TCounter

template<typename T >
using Iterator< T >::TCounter = ptrdiff_t

Definition at line 32 of file Iterator.h.

◆ TValue

template<typename T >
using Iterator< T >::TValue = typename UnwrapReferenceType<T>::Type
protected

Definition at line 20 of file Iterator.h.

◆ value_type

template<typename T >
using Iterator< T >::value_type = T

Definition at line 35 of file Iterator.h.

Constructor & Destructor Documentation

◆ Iterator() [1/4]

template<typename T >
Iterator< T >::Iterator ( T *  data)
inlineprotected

Definition at line 28 of file Iterator.h.

◆ Iterator() [2/4]

template<typename T >
Iterator< T >::Iterator ( )
default

◆ Iterator() [3/4]

template<typename T >
Iterator< T >::Iterator ( T *  data,
const T *  begin,
const T *  end 
)
inline

Definition at line 42 of file Iterator.h.

◆ Iterator() [4/4]

template<typename T >
Iterator< T >::Iterator ( std::nullptr_t  )
inline

Definition at line 52 of file Iterator.h.

Member Function Documentation

◆ operator bool()

template<typename T >
INLINE Iterator< T >::operator bool ( ) const
inlineexplicit

Definition at line 82 of file Iterator.h.

◆ operator Iterator< const T >()

template<typename T >
INLINE Iterator< T >::operator Iterator< const T > ( ) const
inline

Definition at line 160 of file Iterator.h.

◆ operator!=()

template<typename T >
INLINE bool Iterator< T >::operator!= ( const Iterator< T > &  iter) const
inline

Definition at line 157 of file Iterator.h.

◆ operator*() [1/2]

template<typename T >
INLINE TValue& Iterator< T >::operator* ( )
inline

Definition at line 66 of file Iterator.h.

◆ operator*() [2/2]

template<typename T >
INLINE const TValue& Iterator< T >::operator* ( ) const
inline

Definition at line 61 of file Iterator.h.

◆ operator+()

template<typename T >
INLINE Iterator Iterator< T >::operator+ ( const TCounter  n) const
inline

Definition at line 96 of file Iterator.h.

◆ operator++() [1/2]

template<typename T >
INLINE Iterator& Iterator< T >::operator++ ( )
inline

Definition at line 111 of file Iterator.h.

◆ operator++() [2/2]

template<typename T >
INLINE Iterator Iterator< T >::operator++ ( int  )
inline

Definition at line 116 of file Iterator.h.

◆ operator+=()

template<typename T >
INLINE void Iterator< T >::operator+= ( const TCounter  n)
inline

Definition at line 103 of file Iterator.h.

◆ operator-() [1/2]

template<typename T >
INLINE difference_type Iterator< T >::operator- ( const Iterator< T > &  iter) const
inline

Definition at line 133 of file Iterator.h.

◆ operator-() [2/2]

template<typename T >
INLINE Iterator Iterator< T >::operator- ( const TCounter  n) const
inline

Definition at line 99 of file Iterator.h.

◆ operator--() [1/2]

template<typename T >
INLINE Iterator& Iterator< T >::operator-- ( )
inline

Definition at line 122 of file Iterator.h.

◆ operator--() [2/2]

template<typename T >
INLINE Iterator Iterator< T >::operator-- ( int  )
inline

Definition at line 127 of file Iterator.h.

◆ operator-=()

template<typename T >
INLINE void Iterator< T >::operator-= ( const TCounter  n)
inline

Definition at line 107 of file Iterator.h.

◆ operator->() [1/2]

template<typename T >
INLINE T* Iterator< T >::operator-> ( )
inline

Definition at line 71 of file Iterator.h.

◆ operator->() [2/2]

template<typename T >
INLINE const T* Iterator< T >::operator-> ( ) const
inline

Definition at line 76 of file Iterator.h.

◆ operator<()

template<typename T >
INLINE bool Iterator< T >::operator< ( const Iterator< T > &  iter) const
inline

Definition at line 138 of file Iterator.h.

◆ operator<=()

template<typename T >
INLINE bool Iterator< T >::operator<= ( const Iterator< T > &  iter) const
inline

Definition at line 146 of file Iterator.h.

◆ operator==()

template<typename T >
INLINE bool Iterator< T >::operator== ( const Iterator< T > &  iter) const
inline

Definition at line 154 of file Iterator.h.

◆ operator>()

template<typename T >
INLINE bool Iterator< T >::operator> ( const Iterator< T > &  iter) const
inline

Definition at line 142 of file Iterator.h.

◆ operator>=()

template<typename T >
INLINE bool Iterator< T >::operator>= ( const Iterator< T > &  iter) const
inline

Definition at line 150 of file Iterator.h.

Member Data Documentation

◆ data

template<typename T >
T* Iterator< T >::data
protected

Definition at line 22 of file Iterator.h.


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