CBMC
map_iteratort< iteratort, outputt > Class Template Reference

Iterator which applies some given function f after each increment and returns its result on dereference. More...

#include <range.h>

+ Collaboration diagram for map_iteratort< iteratort, outputt >:

Public Types

using difference_type = typename iteratort::difference_type
 
using value_type = outputt
 
using pointer = const outputt *
 
using reference = const outputt &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

bool operator== (const map_iteratort &other) const
 
bool operator!= (const map_iteratort &other) const
 
map_iteratortoperator++ ()
 Preincrement operator. More...
 
map_iteratort operator++ (int)
 Postincrement operator. More...
 
value_typeoperator* ()
 
value_typeoperator-> ()
 
const value_typeoperator* () const
 
const value_typeoperator-> () const
 
 map_iteratort (iteratort underlying, iteratort underlying_end, std::shared_ptr< std::function< value_type(const typename iteratort::value_type &)>> f)
 

Private Attributes

iteratort underlying
 
iteratort underlying_end
 
std::shared_ptr< std::function< value_type(const typename iteratort::value_type &)> > f
 
std::shared_ptr< outputt > current = nullptr
 Stores the result of f at the current position of the iterator. More...
 

Detailed Description

template<typename iteratort, typename outputt>
class map_iteratort< iteratort, outputt >

Iterator which applies some given function f after each increment and returns its result on dereference.

Definition at line 26 of file range.h.

Member Typedef Documentation

◆ difference_type

template<typename iteratort , typename outputt >
using map_iteratort< iteratort, outputt >::difference_type = typename iteratort::difference_type

Definition at line 29 of file range.h.

◆ iterator_category

template<typename iteratort , typename outputt >
using map_iteratort< iteratort, outputt >::iterator_category = std::forward_iterator_tag

Definition at line 33 of file range.h.

◆ pointer

template<typename iteratort , typename outputt >
using map_iteratort< iteratort, outputt >::pointer = const outputt *

Definition at line 31 of file range.h.

◆ reference

template<typename iteratort , typename outputt >
using map_iteratort< iteratort, outputt >::reference = const outputt &

Definition at line 32 of file range.h.

◆ value_type

template<typename iteratort , typename outputt >
using map_iteratort< iteratort, outputt >::value_type = outputt

Definition at line 30 of file range.h.

Constructor & Destructor Documentation

◆ map_iteratort()

template<typename iteratort , typename outputt >
map_iteratort< iteratort, outputt >::map_iteratort ( iteratort  underlying,
iteratort  underlying_end,
std::shared_ptr< std::function< value_type(const typename iteratort::value_type &)>>  f 
)
inlineexplicit

Definition at line 83 of file range.h.

Member Function Documentation

◆ operator!=()

template<typename iteratort , typename outputt >
bool map_iteratort< iteratort, outputt >::operator!= ( const map_iteratort< iteratort, outputt > &  other) const
inline

Definition at line 40 of file range.h.

◆ operator*() [1/2]

template<typename iteratort , typename outputt >
value_type& map_iteratort< iteratort, outputt >::operator* ( )
inline

Definition at line 63 of file range.h.

◆ operator*() [2/2]

template<typename iteratort , typename outputt >
const value_type& map_iteratort< iteratort, outputt >::operator* ( ) const
inline

Definition at line 73 of file range.h.

◆ operator++() [1/2]

template<typename iteratort , typename outputt >
map_iteratort& map_iteratort< iteratort, outputt >::operator++ ( )
inline

Preincrement operator.

Definition at line 46 of file range.h.

◆ operator++() [2/2]

template<typename iteratort , typename outputt >
map_iteratort map_iteratort< iteratort, outputt >::operator++ ( int  )
inline

Postincrement operator.

Definition at line 56 of file range.h.

◆ operator->() [1/2]

template<typename iteratort , typename outputt >
value_type* map_iteratort< iteratort, outputt >::operator-> ( )
inline

Definition at line 68 of file range.h.

◆ operator->() [2/2]

template<typename iteratort , typename outputt >
const value_type* map_iteratort< iteratort, outputt >::operator-> ( ) const
inline

Definition at line 78 of file range.h.

◆ operator==()

template<typename iteratort , typename outputt >
bool map_iteratort< iteratort, outputt >::operator== ( const map_iteratort< iteratort, outputt > &  other) const
inline

Definition at line 35 of file range.h.

Member Data Documentation

◆ current

template<typename iteratort , typename outputt >
std::shared_ptr<outputt> map_iteratort< iteratort, outputt >::current = nullptr
private

Stores the result of f at the current position of the iterator.

Equals nullptr if the iterator reached underlying_end.

Definition at line 105 of file range.h.

◆ f

template<typename iteratort , typename outputt >
std::shared_ptr< std::function<value_type(const typename iteratort::value_type &)> > map_iteratort< iteratort, outputt >::f
private

Definition at line 101 of file range.h.

◆ underlying

template<typename iteratort , typename outputt >
iteratort map_iteratort< iteratort, outputt >::underlying
private

Definition at line 97 of file range.h.

◆ underlying_end

template<typename iteratort , typename outputt >
iteratort map_iteratort< iteratort, outputt >::underlying_end
private

Definition at line 98 of file range.h.


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