https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const > Class Template Reference

Iterator over tracked constructed entries. More...

#include <KokkosArray.h>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = T
 
using difference_type = std::ptrdiff_t
 
using pointer = std::conditional_t< is_const, const T *, T * >
 
using reference = std::conditional_t< is_const, const T &, T & >
 
using array_type = std::conditional_t< is_const, const ArrayBase, ArrayBase >
 

Public Member Functions

reference operator* () const
 
pointer operator-> () const
 
constructed_entry_iteratoroperator++ ()
 
constructed_entry_iterator operator++ (int)
 
bool operator== (const constructed_entry_iterator &other) const
 
bool operator!= (const constructed_entry_iterator &other) const
 

Private Member Functions

 constructed_entry_iterator (array_type &array, index_type i)
 
void advanceToConstructed ()
 

Private Attributes

array_type_array
 Array whose constructed entries are being iterated. More...
 
index_type _i = 0
 Current slot index in _array. More...
 

Friends

class constructed_entry_range< is_const >
 

Detailed Description

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
class Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >

Iterator over tracked constructed entries.

Definition at line 196 of file KokkosArray.h.

Member Typedef Documentation

◆ array_type

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
using Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::array_type = std::conditional_t<is_const, const ArrayBase, ArrayBase>

Definition at line 204 of file KokkosArray.h.

◆ difference_type

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
using Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::difference_type = std::ptrdiff_t

Definition at line 201 of file KokkosArray.h.

◆ iterator_category

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
using Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::iterator_category = std::forward_iterator_tag

Definition at line 199 of file KokkosArray.h.

◆ pointer

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
using Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::pointer = std::conditional_t<is_const, const T *, T *>

Definition at line 202 of file KokkosArray.h.

◆ reference

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
using Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::reference = std::conditional_t<is_const, const T &, T &>

Definition at line 203 of file KokkosArray.h.

◆ value_type

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
using Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::value_type = T

Definition at line 200 of file KokkosArray.h.

Constructor & Destructor Documentation

◆ constructed_entry_iterator()

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::constructed_entry_iterator ( array_type array,
index_type  i 
)
private

Definition at line 719 of file KokkosArray.h.

723  : _array(array), _i(i)
724 {
726 }
index_type _i
Current slot index in _array.
Definition: KokkosArray.h:227
void advanceToConstructed()
Definition: KokkosArray.h:769
array_type & _array
Array whose constructed entries are being iterated.
Definition: KokkosArray.h:223

Member Function Documentation

◆ advanceToConstructed()

template<typename T , unsigned int dimension, typename index_type >
template<bool is_const>
void Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::advanceToConstructed ( )
private

Definition at line 769 of file KokkosArray.h.

Referenced by Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::constructed_entry_iterator().

770 {
771  while (_i < _array._size && !_array.isSlotConstructed(_i))
772  ++_i;
773 }
index_type _i
Current slot index in _array.
Definition: KokkosArray.h:227
array_type & _array
Array whose constructed entries are being iterated.
Definition: KokkosArray.h:223

◆ operator!=()

template<typename T , unsigned int dimension, typename index_type >
template<bool is_const>
bool Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::operator!= ( const constructed_entry_iterator< is_const > &  other) const

Definition at line 760 of file KokkosArray.h.

762 {
763  return !(*this == other);
764 }

◆ operator*()

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
reference Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::operator* ( ) const
inline

Definition at line 206 of file KokkosArray.h.

206 { return _array._host_data[_i]; }
index_type _i
Current slot index in _array.
Definition: KokkosArray.h:227
array_type & _array
Array whose constructed entries are being iterated.
Definition: KokkosArray.h:223

◆ operator++() [1/2]

template<typename T , unsigned int dimension, typename index_type >
template<bool is_const>
ArrayBase< T, dimension, index_type >::template constructed_entry_iterator< is_const > & Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::operator++ ( )

Definition at line 731 of file KokkosArray.h.

732 {
733  ++_i;
735  return *this;
736 }
index_type _i
Current slot index in _array.
Definition: KokkosArray.h:227
void advanceToConstructed()
Definition: KokkosArray.h:769

◆ operator++() [2/2]

template<typename T , unsigned int dimension, typename index_type >
template<bool is_const>
ArrayBase< T, dimension, index_type >::template constructed_entry_iterator< is_const > Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::operator++ ( int  )

Definition at line 741 of file KokkosArray.h.

742 {
743  constructed_entry_iterator pre = *this;
744  ++(*this);
745  return pre;
746 }
constructed_entry_iterator(array_type &array, index_type i)
Definition: KokkosArray.h:719

◆ operator->()

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
pointer Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::operator-> ( ) const
inline

Definition at line 207 of file KokkosArray.h.

207 { return _array._host_data + _i; }
index_type _i
Current slot index in _array.
Definition: KokkosArray.h:227
array_type & _array
Array whose constructed entries are being iterated.
Definition: KokkosArray.h:223

◆ operator==()

template<typename T , unsigned int dimension, typename index_type >
template<bool is_const>
bool Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::operator== ( const constructed_entry_iterator< is_const > &  other) const

Definition at line 751 of file KokkosArray.h.

753 {
754  return &_array == &other._array && _i == other._i;
755 }
index_type _i
Current slot index in _array.
Definition: KokkosArray.h:227
array_type & _array
Array whose constructed entries are being iterated.
Definition: KokkosArray.h:223

Friends And Related Function Documentation

◆ constructed_entry_range< is_const >

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
friend class constructed_entry_range< is_const >
friend

Definition at line 214 of file KokkosArray.h.

Member Data Documentation

◆ _array

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
array_type& Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::_array
private

◆ _i

template<typename T, unsigned int dimension, typename index_type>
template<bool is_const>
index_type Moose::Kokkos::ArrayBase< T, dimension, index_type >::constructed_entry_iterator< is_const >::_i = 0
private

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