vecmem 1.14.0
|
Custom iterator for vecmem::jagged_device_vector
.
More...
#include <vecmem/containers/details/jagged_device_vector_iterator.hpp>
Classes | |
class | pointer |
Helper class for returning "pointer-like" objects from the iterator. More... | |
Public Types | |
Types describing the underlying data | |
typedef data::vector_view< TYPE > | data_type |
Type of the data object that we have an array of. | |
typedef std::add_pointer_t< std::add_const_t< data_type > > | data_pointer |
Pointer to the data object. | |
Type definitions, mimicking STL iterators | |
typedef device_vector< TYPE > | value_type |
Value type being (virtually) iterated on. | |
typedef std::ptrdiff_t | difference_type |
(Pointer) Difference type | |
typedef value_type | reference |
"Reference" type to the underlying (virtual) value | |
Public Member Functions | |
VECMEM_HOST_AND_DEVICE | jagged_device_vector_iterator () |
Default constructor. | |
VECMEM_HOST_AND_DEVICE | jagged_device_vector_iterator (data_pointer data) |
Constructor from an underlying data object. | |
template<typename OTHERTYPE , std::enable_if_t< details::is_same_nc< TYPE, OTHERTYPE >::value, bool > = true> | |
VECMEM_HOST_AND_DEVICE | jagged_device_vector_iterator (const data::vector_view< OTHERTYPE > *data) |
Constructor from a slightly different underlying data object. | |
VECMEM_HOST_AND_DEVICE | jagged_device_vector_iterator (const jagged_device_vector_iterator &parent) |
Copy constructor. | |
template<typename T > | |
VECMEM_HOST_AND_DEVICE | jagged_device_vector_iterator (const jagged_device_vector_iterator< T > &parent) |
Copy constructor. | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator & | operator= (const jagged_device_vector_iterator &rhs) |
Copy assignment operator. | |
Value accessor operators | |
VECMEM_HOST_AND_DEVICE reference | operator* () const |
De-reference the iterator. | |
VECMEM_HOST_AND_DEVICE pointer | operator-> () const |
Use the iterator as a pointer. | |
VECMEM_HOST_AND_DEVICE reference | operator[] (difference_type n) const |
Return the value at a specific offset. | |
Iterator updating operators | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator & | operator++ () |
Decrement the underlying iterator (with '++' as a prefix) | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator | operator++ (int) |
Decrement the underlying iterator (wuth '++' as a postfix) | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator & | operator-- () |
Increment the underlying iterator (with '–' as a prefix) | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator | operator-- (int) |
Increment the underlying iterator (with '–' as a postfix) | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator | operator+ (difference_type n) const |
Decrement the underlying iterator by a specific value. | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator & | operator+= (difference_type n) |
Decrement the underlying iterator by a specific value. | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator | operator- (difference_type n) const |
Increment the underlying iterator by a specific value. | |
VECMEM_HOST_AND_DEVICE jagged_device_vector_iterator & | operator-= (difference_type n) |
Increment the underlying iterator by a specific value. | |
Comparison operators | |
VECMEM_HOST_AND_DEVICE bool | operator== (const jagged_device_vector_iterator &other) const |
Check for the equality of two iterators. | |
VECMEM_HOST_AND_DEVICE bool | operator!= (const jagged_device_vector_iterator &other) const |
Check for the inequality of two iterators. | |
Custom iterator for vecmem::jagged_device_vector
.
In order for vecmem::jagged_device_vector
to be able to offer iteration over its elements in an efficient and safe way, it needs to use this custom iterator type.
It takes care of converting between the underlying data type and the type presented towards the users for access to the data. On top of providing all the functionality that an iterator has to.