uTL
micro Template library
utl::iodev_it< cont_t, iter_t, _beg, _size > Class Template Reference

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

#include <dev_iterators.h>

Classes

struct  value_type_t
 

Public Types

enum  Cursor { beg = _beg, eod = _beg+_size }
 #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

Constructor / Destructor
 iodev_it () noexcept
 Default constructor. More...
 
 iodev_it (cont_t *owner, size_t cursor=eod) noexcept
 Basic constructor. More...
 
 iodev_it (const iterator_t &it) noexcept
 Basic copy constructor. More...
 
iterator_toperator= (const iterator_t &it) noexcept
 Basic copy assignment operator. More...
 
Public interface
reference operator* () noexcept
 
pointer operator-> () noexcept
 Arrow operator. This is where the input method is invoked. More...
 
iterator_toperator++ () noexcept
 Pre increment. More...
 
iterator_t operator++ (int) noexcept
 Post increment. More...
 
iterator_toperator-- () noexcept
 Pre decrement. More...
 
iterator_t operator-- (int) noexcept
 Post decrement. More...
 
reference operator[] (difference_type n) noexcept
 Random access through iterator. More...
 
iterator_toperator+= (difference_type n) noexcept
 Random cursor increment. More...
 
iterator_t operator+ (difference_type n) const noexcept
 Addition operation. More...
 
iterator_toperator-= (difference_type n) noexcept
 Random cursor decrement. More...
 
iterator_t operator- (difference_type n) const noexcept
 Subtraction operation. More...
 
const cont_t * owner () const noexcept
 Export container for comparison. More...
 
const index_tcursor () const noexcept
 Export cursor for comparison. More...
 

Private Types

using iterator_t = iodev_it< cont_t, iter_t, _beg, _size >
 < iterator type local name More...
 

Private Attributes

cont_t * owner_ {nullptr}
 
index_t cursor_ {eod}
 virtual cursor for comparison operators More...
 
struct utl::iodev_it::value_type_t value_
 

Detailed Description

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
class utl::iodev_it< cont_t, iter_t, _beg, _size >

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

Value meta-programming function for SPI interface checking

Parameters
_TpType to check
Returns
True if _Tp is a spi interface
Note
This is a contiguous iterator
Parameters
cont_tContainer/parent type
iter_tIterator data type (pointer to container_t::value_type)
_begStarting address of the device
_sizeDevice's address space size

Definition at line 740 of file dev_iterators.h.

Member Typedef Documentation

◆ difference_type

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

Definition at line 750 of file dev_iterators.h.

◆ iterator_category

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

STL iterator traits "forwarding"

Definition at line 748 of file dev_iterators.h.

◆ iterator_t

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

< iterator type local name

Definition at line 742 of file dev_iterators.h.

◆ pointer

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

Definition at line 751 of file dev_iterators.h.

◆ reference

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

Definition at line 752 of file dev_iterators.h.

◆ type

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

Export type as identity meta-function

Definition at line 744 of file dev_iterators.h.

◆ value_type

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

Definition at line 749 of file dev_iterators.h.

Member Enumeration Documentation

◆ Cursor

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

#define-like enumerator for Cursor

Enumerator
beg 

Points the first item.

eod 

Points one place after last item.

Definition at line 756 of file dev_iterators.h.

Constructor & Destructor Documentation

◆ iodev_it() [1/3]

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
utl::iodev_it< cont_t, iter_t, _beg, _size >::iodev_it ( )
inlinenoexcept

Default constructor.

Definition at line 790 of file dev_iterators.h.

◆ iodev_it() [2/3]

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

Basic constructor.

Definition at line 795 of file dev_iterators.h.

◆ iodev_it() [3/3]

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

Basic copy constructor.

Definition at line 800 of file dev_iterators.h.

Member Function Documentation

◆ cursor()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
const index_t& utl::iodev_it< cont_t, iter_t, _beg, _size >::cursor ( ) const
inlinenoexcept

Export cursor for comparison.

Definition at line 878 of file dev_iterators.h.

◆ operator*()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
reference utl::iodev_it< cont_t, iter_t, _beg, _size >::operator* ( )
inlinenoexcept

De-reference operator. This is where the input method is invoked

Note
No end() place dereference check is made.

Definition at line 819 of file dev_iterators.h.

◆ operator+()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
iterator_t utl::iodev_it< cont_t, iter_t, _beg, _size >::operator+ ( difference_type  n) const
inlinenoexcept

Addition operation.

Definition at line 862 of file dev_iterators.h.

◆ operator++() [1/2]

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

Pre increment.

Definition at line 830 of file dev_iterators.h.

◆ operator++() [2/2]

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

Post increment.

Definition at line 835 of file dev_iterators.h.

◆ operator+=()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
iterator_t& utl::iodev_it< cont_t, iter_t, _beg, _size >::operator+= ( difference_type  n)
inlinenoexcept

Random cursor increment.

Definition at line 857 of file dev_iterators.h.

◆ operator-()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
iterator_t utl::iodev_it< cont_t, iter_t, _beg, _size >::operator- ( difference_type  n) const
inlinenoexcept

Subtraction operation.

Definition at line 871 of file dev_iterators.h.

◆ operator--() [1/2]

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
iterator_t& utl::iodev_it< cont_t, iter_t, _beg, _size >::operator-- ( )
inlinenoexcept

Pre decrement.

Definition at line 841 of file dev_iterators.h.

◆ operator--() [2/2]

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
iterator_t utl::iodev_it< cont_t, iter_t, _beg, _size >::operator-- ( int  )
inlinenoexcept

Post decrement.

Definition at line 846 of file dev_iterators.h.

◆ operator-=()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
iterator_t& utl::iodev_it< cont_t, iter_t, _beg, _size >::operator-= ( difference_type  n)
inlinenoexcept

Random cursor decrement.

Definition at line 866 of file dev_iterators.h.

◆ operator->()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
pointer utl::iodev_it< cont_t, iter_t, _beg, _size >::operator-> ( )
inlinenoexcept

Arrow operator. This is where the input method is invoked.

Definition at line 824 of file dev_iterators.h.

◆ operator=()

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

Basic copy assignment operator.

Definition at line 805 of file dev_iterators.h.

◆ operator[]()

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
reference utl::iodev_it< cont_t, iter_t, _beg, _size >::operator[] ( difference_type  n)
inlinenoexcept

Random access through iterator.

Definition at line 852 of file dev_iterators.h.

◆ owner()

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

Export container for comparison.

Definition at line 876 of file dev_iterators.h.

Member Data Documentation

◆ cursor_

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

virtual cursor for comparison operators

Definition at line 767 of file dev_iterators.h.

◆ owner_

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

Pointer to parent/owner device class. Constructor demands owner container in order to access data. Considering the data don't "live" in memory.

Definition at line 762 of file dev_iterators.h.

◆ value_

template<typename cont_t, typename iter_t, index_t _beg = 0, size_t _size = static_cast<size_t>(-1)-_beg>
struct utl::iodev_it::value_type_t utl::iodev_it< cont_t, iter_t, _beg, _size >::value_
private

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