Alexandria  2.18
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Euclid::NdArray::NdArray< T >::Iterator< Const > Class Template Reference

#include <NdArray.h>

Inheritance diagram for Euclid::NdArray::NdArray< T >::Iterator< Const >:
[legend]
Collaboration diagram for Euclid::NdArray::NdArray< T >::Iterator< Const >:
[legend]

Public Types

using value_t = typename std::conditional< Const, const T, T >::type
 

Public Member Functions

 Iterator (const Iterator< false > &other)
 
Iteratoroperator++ ()
 
Iterator operator++ (int)
 
bool operator== (const Iterator &other) const
 
bool operator!= (const Iterator &other) const
 
value_toperator* ()
 
value_t operator* () const
 
Iteratoroperator+= (size_t n)
 
Iterator operator+ (size_t n)
 
Iteratoroperator-= (size_t n)
 
Iterator operator- (size_t n)
 
difference_type operator- (const Iterator &other)
 
value_toperator[] (size_t i)
 
bool operator< (const Iterator &other)
 
bool operator> (const Iterator &other)
 

Private Member Functions

 Iterator (ContainerInterface *container_ptr, size_t offset)
 

Private Attributes

ContainerInterfacem_container_ptr
 
size_t m_offset
 

Friends

class NdArray
 

Detailed Description

template<typename T>
template<bool Const>
class Euclid::NdArray::NdArray< T >::Iterator< Const >

Iterator type

Template Parameters
ConstIf true, this defines a const iterator

Definition at line 62 of file NdArray.h.

Member Typedef Documentation

template<typename T >
template<bool Const>
using Euclid::NdArray::NdArray< T >::Iterator< Const >::value_t = typename std::conditional<Const, const T, T>::type

Definition at line 72 of file NdArray.h.

Constructor & Destructor Documentation

template<typename T >
template<bool Const>
Euclid::NdArray::NdArray< T >::Iterator< Const >::Iterator ( ContainerInterface container_ptr,
size_t  offset 
)
private
template<typename T >
template<bool Const>
Euclid::NdArray::NdArray< T >::Iterator< Const >::Iterator ( const Iterator< false > &  other)

Construct a const iterator from a non-const iterator

Member Function Documentation

template<typename T >
template<bool Const>
bool Euclid::NdArray::NdArray< T >::Iterator< Const >::operator!= ( const Iterator< Const > &  other) const

Two iterators are not equal if they point to different data, or to different positions on the same

template<typename T >
template<bool Const>
value_t& Euclid::NdArray::NdArray< T >::Iterator< Const >::operator* ( )

De-reference operator

Returns
A modifiable reference to the value
template<typename T >
template<bool Const>
value_t Euclid::NdArray::NdArray< T >::Iterator< Const >::operator* ( ) const

De-reference operator

Returns
A non modifiable copy of the value
template<typename T >
template<bool Const>
Iterator Euclid::NdArray::NdArray< T >::Iterator< Const >::operator+ ( size_t  n)
Returns
A new iterator incremented n times
Note
No out of bounds check is perform! Going beyond the end of the container is undefined behavior
template<typename T >
template<bool Const>
Iterator& Euclid::NdArray::NdArray< T >::Iterator< Const >::operator++ ( )

Pre-increment

template<typename T >
template<bool Const>
Iterator Euclid::NdArray::NdArray< T >::Iterator< Const >::operator++ ( int  )

Post-increment

template<typename T >
template<bool Const>
Iterator& Euclid::NdArray::NdArray< T >::Iterator< Const >::operator+= ( size_t  n)

Increment the iterator n times in place

Note
No out of bounds check is perform! Going beyond the end of the container is undefined behavior
template<typename T >
template<bool Const>
Iterator Euclid::NdArray::NdArray< T >::Iterator< Const >::operator- ( size_t  n)
Returns
A new iterator incremented n times
Note
There is an assert in place to make sure n is not greater than the current position. However, the assert can be gone when compiling for release
template<typename T >
template<bool Const>
difference_type Euclid::NdArray::NdArray< T >::Iterator< Const >::operator- ( const Iterator< Const > &  other)
Returns
The number of positions between this and other
Note
If this and other point to different underlying data, this is undefined behavior
template<typename T >
template<bool Const>
Iterator& Euclid::NdArray::NdArray< T >::Iterator< Const >::operator-= ( size_t  n)

Decrement the iterator n times in place

Note
There is an assert in place to make sure n is not greater than the current position. However, the assert can be gone when compiling for release
template<typename T >
template<bool Const>
bool Euclid::NdArray::NdArray< T >::Iterator< Const >::operator< ( const Iterator< Const > &  other)
Returns
true if this is less than other
Note
If this and other point to different underlying data, this is undefined behavior
template<typename T >
template<bool Const>
bool Euclid::NdArray::NdArray< T >::Iterator< Const >::operator== ( const Iterator< Const > &  other) const

Two iterators are equal if they point to the same position on the same data

template<typename T >
template<bool Const>
bool Euclid::NdArray::NdArray< T >::Iterator< Const >::operator> ( const Iterator< Const > &  other)
Returns
true if this is greater than other
Note
If this and other point to different underlying data, this is undefined behavior
template<typename T >
template<bool Const>
value_t& Euclid::NdArray::NdArray< T >::Iterator< Const >::operator[] ( size_t  i)

Equivalent to *(iterator + i)

Friends And Related Function Documentation

template<typename T >
template<bool Const>
friend class NdArray
friend

Definition at line 69 of file NdArray.h.

Member Data Documentation

template<typename T >
template<bool Const>
ContainerInterface* Euclid::NdArray::NdArray< T >::Iterator< Const >::m_container_ptr
private

Definition at line 64 of file NdArray.h.

template<typename T >
template<bool Const>
size_t Euclid::NdArray::NdArray< T >::Iterator< Const >::m_offset
private

Definition at line 65 of file NdArray.h.


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