DASH  0.3.0
dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType > Class Template Reference

Bi-directional global iterator on elements of a dash::List instance. More...

#include <GlobListIter.h>

Public Types

typedef ElementType value_type
 
typedef ReferenceType reference
 
typedef const ReferenceType const_reference
 
typedef PointerType pointer
 
typedef const PointerType const_pointer
 
typedef GlobMemType::local_pointer local_pointer
 
typedef internal::ListNode< value_type > node_type
 
typedef std::integral_constant< bool, false > has_view
 

Public Member Functions

 GlobListIter ()=default
 Default constructor. More...
 
 GlobListIter (GlobMemType *gmem, node_type &node)
 Constructor, creates a global iterator on a dash::List instance. More...
 
 GlobListIter (const self_t &other)=default
 Copy constructor. More...
 
self_toperator= (const self_t &other)=default
 Assignment operator. More...
 
 operator pointer () const
 Type conversion operator to pointer type. More...
 
reference operator* ()
 Dereference operator. More...
 
const_reference operator* () const
 Dereference operator. More...
 
self_t global () const
 Map iterator to global index domain. More...
 
constexpr bool is_relative () const noexcept
 Whether the iterator's position is relative to a view. More...
 
const GlobMemType & globmem () const
 The instance of GlobStaticMem used by this iterator to resolve addresses in global memory. More...
 
GlobMemType & globmem ()
 The instance of GlobStaticMem used by this iterator to resolve addresses in global memory. More...
 
self_toperator++ ()
 Prefix increment operator. More...
 
self_t operator++ (int)
 Postfix increment operator. More...
 
self_toperator-- ()
 Prefix decrement operator. More...
 
self_t operator-- (int)
 Postfix decrement operator. More...
 
bool operator== (const self_t &other) const
 Equality comparison operator. More...
 
bool operator!= (const self_t &other) const
 Inequality comparison operator. More...
 

Detailed Description

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
class dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >

Bi-directional global iterator on elements of a dash::List instance.

Implemented concept:
List Concept
Implemented concept:
Global Iterator Concept

Definition at line 25 of file GlobListIter.h.

Constructor & Destructor Documentation

◆ GlobListIter() [1/3]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::GlobListIter ( )
default

◆ GlobListIter() [2/3]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::GlobListIter ( GlobMemType *  gmem,
node_type &  node 
)
inline

Constructor, creates a global iterator on a dash::List instance.

Definition at line 64 of file GlobListIter.h.

67  : _globmem(gmem),
68  _node(&node),
70  {
71  DASH_LOG_TRACE("GlobListIter(gmem,node,pat)");
72  }
static global_unit_t GlobalUnitID()
The invariant unit ID in dash::Team::All().
Definition: Team.h:221

◆ GlobListIter() [3/3]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::GlobListIter ( const self_t other)
default

Copy constructor.

Member Function Documentation

◆ global()

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
self_t dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::global ( ) const
inline

Map iterator to global index domain.

Definition at line 121 of file GlobListIter.h.

122  {
123  return *this;
124  }

◆ globmem() [1/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
const GlobMemType& dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::globmem ( ) const
inline

The instance of GlobStaticMem used by this iterator to resolve addresses in global memory.

Definition at line 142 of file GlobListIter.h.

143  {
144  return *_globmem;
145  }

◆ globmem() [2/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
GlobMemType& dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::globmem ( )
inline

The instance of GlobStaticMem used by this iterator to resolve addresses in global memory.

Definition at line 151 of file GlobListIter.h.

152  {
153  return *_globmem;
154  }

◆ is_relative()

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
constexpr bool dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::is_relative ( ) const
inlinenoexcept

Whether the iterator's position is relative to a view.

TODO: should be iterator trait: dash::iterator_traits<GlobListIter<..>>::is_relative()::value

Definition at line 133 of file GlobListIter.h.

134  {
135  return false;
136  }

◆ operator pointer()

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator pointer ( ) const
inline

Type conversion operator to pointer type.

Returns
A global reference to the element at the iterator's position

Definition at line 91 of file GlobListIter.h.

92  {
93  pointer ptr;
94  // TODO
95  return ptr;
96  }

◆ operator!=()

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
bool dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator!= ( const self_t other) const
inline

Inequality comparison operator.

Definition at line 205 of file GlobListIter.h.

206  {
207  return _node != other._node;
208  }

◆ operator*() [1/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
reference dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator* ( )
inline

Dereference operator.

Returns
A global reference to the element at the iterator's position.

Definition at line 103 of file GlobListIter.h.

104  {
105  return reference(this);
106  }

◆ operator*() [2/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
const_reference dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator* ( ) const
inline

Dereference operator.

Returns
A global const reference to the element at the iterator's position.

Definition at line 114 of file GlobListIter.h.

115  {
116  }

◆ operator++() [1/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
self_t& dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator++ ( )
inline

Prefix increment operator.

Definition at line 159 of file GlobListIter.h.

160  {
161  increment();
162  return *this;
163  }

◆ operator++() [2/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
self_t dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator++ ( int  )
inline

Postfix increment operator.

Definition at line 168 of file GlobListIter.h.

169  {
170  self_t result = *this;
171  increment();
172  return result;
173  }

◆ operator--() [1/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
self_t& dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator-- ( )
inline

Prefix decrement operator.

Definition at line 178 of file GlobListIter.h.

179  {
180  decrement();
181  return *this;
182  }

◆ operator--() [2/2]

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
self_t dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator-- ( int  )
inline

Postfix decrement operator.

Definition at line 187 of file GlobListIter.h.

188  {
189  self_t result = *this;
190  decrement();
191  return result;
192  }

◆ operator=()

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
self_t& dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator= ( const self_t other)
default

◆ operator==()

template<typename ElementType, class GlobMemType, class PointerType = GlobPtr<ElementType, GlobMemType>, class ReferenceType = GlobRef<ElementType>>
bool dash::GlobListIter< ElementType, GlobMemType, PointerType, ReferenceType >::operator== ( const self_t other) const
inline

Equality comparison operator.

Definition at line 197 of file GlobListIter.h.

198  {
199  return _node == other._node;
200  }

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