AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const > Class Template Reference

An iterator type for a map. Each increment operation advances the iterator to the next set element. To access the jth component values of the iterator's current element, use iter(j). More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/slam/Map.hpp>

Inheritance diagram for axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >:

Public Types

using IterBase = IteratorBase< MapRangeIterator, SetPosition >
 
using MapConstPtr = std::conditional_t< Const, const Map *, Map * >
 
using DataRefType = std::conditional_t< Const, ConstValueType, ValueType >
 
using DataType = std::remove_reference_t< DataRefType >
 
using PositionType = SetPosition
 
using StrideIndexType = typename StridePolicyType::IndexType
 
using iterator_category = std::random_access_iterator_tag
 
using value_type = axom::ArrayView< DataType, Dims >
 
using reference = const value_type &
 
using pointer = const value_type *
 
using difference_type = SetPosition
 
Equality and relational operators
using iterator = IteratorBase< MapRangeIterator< Const >, SetPosition >
 

Public Member Functions

 MapRangeIterator (MapConstPtr oMap, PositionType pos)
 
AXOM_HOST_DEVICE reference operator* () const
 Returns the current iterator value. More...
 
AXOM_HOST_DEVICE pointer operator-> () const
 
template<typename... ComponentIndex>
AXOM_HOST_DEVICE DataRefType operator() (ComponentIndex... comp_idx) const
 Returns the iterator's value at the specified component. Returns the first component if comp_idx is not specified. More...
 
template<typename ComponentIndex >
AXOM_HOST_DEVICE DataRefType value (ComponentIndex comp_idx) const
 
template<typename... ComponentIndex>
AXOM_HOST_DEVICE DataRefType value (ComponentIndex... comp_idx) const
 
value_type operator[] (PositionType n) const
 
SetElement index () const
 Returns the set element mapped by this iterator. More...
 
SetPosition flatIndex () const
 Returns the flat index pointed to by this iterator. More...
 
PositionType numComp () const
 Returns the number of components per element in the Map. More...
 
Iterator advance and distance operators
AXOM_HOST_DEVICE MapRangeIterator< Const > & operator++ ()
 Pre-increment operator. More...
 
MapRangeIterator< Const > operator++ (int)
 Post-increment operator. More...
 
MapRangeIterator< Const > & operator-- ()
 Pre-decrement operator. More...
 
MapRangeIterator< Const > operator-- (int)
 Post-decrement operator. More...
 
MapRangeIterator< Const > & operator+= (SetPosition n)
 Addition-assignment operator. More...
 
MapRangeIterator< Const > & operator-= (SetPosition n)
 Subtraction-assignment operator. More...
 

Static Public Attributes

constexpr static int Dims = StridePolicyType::NumDims
 

Protected Member Functions

AXOM_HOST_DEVICE void advance (PositionType n)
 

Protected Attributes

SetPosition m_pos
 

Detailed Description

template<typename T, typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
class axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >

An iterator type for a map. Each increment operation advances the iterator to the next set element. To access the jth component values of the iterator's current element, use iter(j).

Warning
Note the difference between the subscript operator ( iter[off] ) and the parenthesis operator ( iter(j) ).
iter[off] returns the value of the first component of the element at offset off from the currently pointed to element.
And iter(j) returns the value of the jth component of the currently pointed to element (where 0 <= j < numComp()).
For example: iter[off] is the same as (iter+off)(0)

Member Typedef Documentation

◆ IterBase

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::IterBase = IteratorBase<MapRangeIterator, SetPosition>

◆ MapConstPtr

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::MapConstPtr = std::conditional_t<Const, const Map*, Map*>

◆ DataRefType

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::DataRefType = std::conditional_t<Const, ConstValueType, ValueType>

◆ DataType

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::DataType = std::remove_reference_t<DataRefType>

◆ PositionType

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::PositionType = SetPosition

◆ StrideIndexType

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::StrideIndexType = typename StridePolicyType::IndexType

◆ iterator_category

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::iterator_category = std::random_access_iterator_tag

◆ value_type

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::value_type = axom::ArrayView<DataType, Dims>

◆ reference

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::reference = const value_type&

◆ pointer

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::pointer = const value_type*

◆ difference_type

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
using axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::difference_type = SetPosition

◆ iterator

Constructor & Destructor Documentation

◆ MapRangeIterator()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::MapRangeIterator ( MapConstPtr  oMap,
PositionType  pos 
)
inline

Member Function Documentation

◆ operator*()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
AXOM_HOST_DEVICE reference axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::operator* ( ) const
inline

Returns the current iterator value.

◆ operator->()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
AXOM_HOST_DEVICE pointer axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::operator-> ( ) const
inline

◆ operator()()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
template<typename... ComponentIndex>
AXOM_HOST_DEVICE DataRefType axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::operator() ( ComponentIndex...  comp_idx) const
inline

Returns the iterator's value at the specified component. Returns the first component if comp_idx is not specified.

Parameters
comp_idxZero-based index of the component.

References axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::value().

◆ value() [1/2]

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
template<typename ComponentIndex >
AXOM_HOST_DEVICE DataRefType axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::value ( ComponentIndex  comp_idx) const
inline

◆ value() [2/2]

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
template<typename... ComponentIndex>
AXOM_HOST_DEVICE DataRefType axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::value ( ComponentIndex...  comp_idx) const
inline

◆ operator[]()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
value_type axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::operator[] ( PositionType  n) const
inline

◆ index()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
SetElement axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::index ( ) const
inline

Returns the set element mapped by this iterator.

References axom::IteratorBase< MapRangeIterator< Const >, SetPosition >::m_pos.

◆ flatIndex()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
SetPosition axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::flatIndex ( ) const
inline

Returns the flat index pointed to by this iterator.

References axom::IteratorBase< MapRangeIterator< Const >, SetPosition >::m_pos.

◆ numComp()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
PositionType axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::numComp ( ) const
inline

Returns the number of components per element in the Map.

◆ advance()

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
AXOM_HOST_DEVICE void axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::advance ( PositionType  n)
inlineprotected

◆ operator++() [1/2]

AXOM_HOST_DEVICE MapRangeIterator< Const > & axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::operator++ ( )
inlineinherited

Pre-increment operator.

◆ operator++() [2/2]

MapRangeIterator< Const > axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::operator++ ( int  )
inlineinherited

Post-increment operator.

◆ operator--() [1/2]

MapRangeIterator< Const > & axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::operator-- ( )
inlineinherited

Pre-decrement operator.

◆ operator--() [2/2]

MapRangeIterator< Const > axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::operator-- ( int  )
inlineinherited

Post-decrement operator.

◆ operator+=()

MapRangeIterator< Const > & axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::operator+= ( SetPosition  n)
inlineinherited

Addition-assignment operator.

◆ operator-=()

MapRangeIterator< Const > & axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::operator-= ( SetPosition  n)
inlineinherited

Subtraction-assignment operator.

Member Data Documentation

◆ Dims

template<typename T , typename S = Set<>, typename IndPol = policies::STLVectorIndirection<typename S::PositionType, T>, typename StrPol = policies::StrideOne<typename S::PositionType>, typename IfacePol = policies::VirtualInterface>
template<bool Const>
constexpr static int axom::slam::Map< T, S, IndPol, StrPol, IfacePol >::MapRangeIterator< Const >::Dims = StridePolicyType::NumDims
staticconstexpr

◆ m_pos

SetPosition axom::IteratorBase< MapRangeIterator< Const > , SetPosition >::m_pos
protectedinherited

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