uTL
micro Template library
utl::outdev_it< cont_t, iter_t, _beg, _end > Class Template Reference

Output device iterator type. We "future call" interface methods from owner class to provide iterator functionality. More...

#include <dev_iterators.h>

Public Types

enum  Cursor { beg = _beg, eod = _end }
 #define-like enumerator for Cursor More...
 
using type = iterator_t
 
using iterator_category = typename dev_iterator_traits< std::output_iterator_tag, iter_t >::iterator_category
 
using value_type = typename dev_iterator_traits< std::output_iterator_tag, iter_t >::value_type
 
using difference_type = typename dev_iterator_traits< std::output_iterator_tag, iter_t >::difference_type
 
using pointer = typename dev_iterator_traits< std::output_iterator_tag, iter_t >::pointer
 
using reference = typename dev_iterator_traits< std::output_iterator_tag, iter_t >::reference
 

Public Member Functions

const cont_t * owner () const noexcept
 Export container for comparison. More...
 
const index_t cursor () const noexcept
 Export cursor for comparison. More...
 
Constructor / Destructor
 outdev_it () noexcept
 Default constructor results to end() More...
 
 outdev_it (cont_t *owner, index_t cursor=eod) noexcept
 Basic constructor. More...
 
 outdev_it (const iterator_t &it) noexcept
 Basic copy constructor. More...
 
iterator_toperator= (const iterator_t &it) noexcept
 Basic copy assignment operator. More...
 
Public interface

Iterator to const-iterator conversion (as STL requires)

Parameters
itIterator reference
iterator_toperator* () noexcept
 
iterator_toperator= (const value_type &value)
 Value-assignment operation. Where the output method is invoked. More...
 
++ operators
iterator_toperator++ () noexcept
 
iterator_t operator++ (int) noexcept
 

Private Types

using iterator_t = outdev_it< cont_t, iter_t, _beg, _end >
 iterator type local name More...
 

Private Attributes

cont_t * owner_ {nullptr}
 
index_t cursor_ {eod}
 virtual cursor for comparison operators More...
 

Detailed Description

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
class utl::outdev_it< cont_t, iter_t, _beg, _end >

Output device iterator type. We "future call" interface methods from owner class to provide iterator functionality.

Parameters
cont_tContainer/parent type
iter_tIterator data type (pointer to container_t::value_type)
devsizeDevice's address space size

Definition at line 250 of file dev_iterators.h.

Member Typedef Documentation

◆ difference_type

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::difference_type = typename dev_iterator_traits <std::output_iterator_tag, iter_t>::difference_type

Definition at line 260 of file dev_iterators.h.

◆ iterator_category

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::iterator_category = typename dev_iterator_traits <std::output_iterator_tag, iter_t>::iterator_category

STL iterator traits "forwarding"

Definition at line 258 of file dev_iterators.h.

◆ iterator_t

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::iterator_t = outdev_it <cont_t, iter_t, _beg, _end>
private

iterator type local name

Definition at line 252 of file dev_iterators.h.

◆ pointer

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::pointer = typename dev_iterator_traits <std::output_iterator_tag, iter_t>::pointer

Definition at line 261 of file dev_iterators.h.

◆ reference

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::reference = typename dev_iterator_traits <std::output_iterator_tag, iter_t>::reference

Definition at line 262 of file dev_iterators.h.

◆ type

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::type = iterator_t

Export type as identity meta-function

Definition at line 254 of file dev_iterators.h.

◆ value_type

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
using utl::outdev_it< cont_t, iter_t, _beg, _end >::value_type = typename dev_iterator_traits <std::output_iterator_tag, iter_t>::value_type

Definition at line 259 of file dev_iterators.h.

Member Enumeration Documentation

◆ Cursor

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
enum utl::outdev_it::Cursor

#define-like enumerator for Cursor

Enumerator
beg 

Points the first item (relative address)

eod 

Points one place after last item (relative address)

Definition at line 265 of file dev_iterators.h.

Constructor & Destructor Documentation

◆ outdev_it() [1/3]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
utl::outdev_it< cont_t, iter_t, _beg, _end >::outdev_it ( )
inlineexplicitnoexcept

Default constructor results to end()

Definition at line 283 of file dev_iterators.h.

◆ outdev_it() [2/3]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
utl::outdev_it< cont_t, iter_t, _beg, _end >::outdev_it ( cont_t *  owner,
index_t  cursor = eod 
)
inlineexplicitnoexcept

Basic constructor.

Definition at line 287 of file dev_iterators.h.

◆ outdev_it() [3/3]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
utl::outdev_it< cont_t, iter_t, _beg, _end >::outdev_it ( const iterator_t it)
inlineexplicitnoexcept

Basic copy constructor.

Definition at line 291 of file dev_iterators.h.

Member Function Documentation

◆ cursor()

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
const index_t utl::outdev_it< cont_t, iter_t, _beg, _end >::cursor ( ) const
inlinenoexcept

Export cursor for comparison.

Definition at line 343 of file dev_iterators.h.

◆ operator*()

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
iterator_t& utl::outdev_it< cont_t, iter_t, _beg, _end >::operator* ( )
inlinenoexcept

Definition at line 314 of file dev_iterators.h.

◆ operator++() [1/2]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
iterator_t& utl::outdev_it< cont_t, iter_t, _beg, _end >::operator++ ( )
inlinenoexcept

Definition at line 329 of file dev_iterators.h.

◆ operator++() [2/2]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
iterator_t utl::outdev_it< cont_t, iter_t, _beg, _end >::operator++ ( int  )
inlinenoexcept

Definition at line 333 of file dev_iterators.h.

◆ operator=() [1/2]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
iterator_t& utl::outdev_it< cont_t, iter_t, _beg, _end >::operator= ( const iterator_t it)
inlinenoexcept

Basic copy assignment operator.

Definition at line 295 of file dev_iterators.h.

◆ operator=() [2/2]

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
iterator_t& utl::outdev_it< cont_t, iter_t, _beg, _end >::operator= ( const value_type value)
inline

Value-assignment operation. Where the output method is invoked.

Parameters
valueAn instance of Cont_t::data_type
Returns
This iterator, for chained operations.

Definition at line 321 of file dev_iterators.h.

◆ owner()

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
const cont_t* utl::outdev_it< cont_t, iter_t, _beg, _end >::owner ( ) const
inlinenoexcept

Export container for comparison.

Definition at line 341 of file dev_iterators.h.

Member Data Documentation

◆ cursor_

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
index_t utl::outdev_it< cont_t, iter_t, _beg, _end >::cursor_ {eod}
private

virtual cursor for comparison operators

Definition at line 276 of file dev_iterators.h.

◆ owner_

template<typename cont_t, typename iter_t, index_t _beg = 0, index_t _end = static_cast<index_t>(-1)>
cont_t* utl::outdev_it< cont_t, iter_t, _beg, _end >::owner_ {nullptr}
private

Pointer to parent/owner device class. Usable iterator demands owner container in order to access data. Considering the data don't "live" in memory. A default constructed iterator will behave like end() just like the input version does.

Definition at line 270 of file dev_iterators.h.


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