CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::IteratorPrototype< T, D, C > Class Template Reference

Base class for simple iterators. More...

#include <CeresEngine/Foundation/Iterator.hpp>

Inheritance diagram for CeresEngine::IteratorPrototype< T, D, C >:
CeresEngine::Iterator< T, CeresEngine::impl::increment::ByMemberCall< T, decltype(&T::advance), &T::advance >, CeresEngine::impl::dereference::ByMemberCall< T, decltype(&T::value), &T::value >, CeresEngine::impl::compare::ByValue > CeresEngine::Iterator< T, F, D, C >

Public Types

using iterator_category = std::input_iterator_tag
 
using reference = decltype(std::declval< D >()(std::declval< T & >()))
 
using value_type = typename std::decay< reference >::type
 
using pointer = value_type *
 
using difference_type = std::ptrdiff_t
 
using DereferencedType = decltype(dereferencer(value))
 

Public Member Functions

 IteratorPrototype ()=delete
 
 IteratorPrototype (T &&first, D &&_dereferencer=D(), C &&_compare=C())
 
DereferencedType operator* ()
 
autooperator-> () const
 

Public Attributes

T value
 

Protected Attributes

D dereferencer
 
C compare
 

Friends

bool operator== (const IteratorPrototype &lhs, const IteratorPrototype &rhs)
 
bool operator!= (const IteratorPrototype &lhs, const IteratorPrototype &rhs)
 

Detailed Description

template<class T, typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
class CeresEngine::IteratorPrototype< T, D, C >

Base class for simple iterators.

Takes several template parameters. Implementations must define operator++() to update the value of value.

Template Parameters
TThe data type held by the iterator
DA functional that dereferences the data. Determines the value type of the iterator.
CA function that compares two values of type T. Used to determine if two iterators are equal.

Member Typedef Documentation

◆ DereferencedType

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
using CeresEngine::IteratorPrototype< T, D, C >::DereferencedType = decltype(dereferencer(value))

◆ difference_type

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
using CeresEngine::IteratorPrototype< T, D, C >::difference_type = std::ptrdiff_t

◆ iterator_category

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
using CeresEngine::IteratorPrototype< T, D, C >::iterator_category = std::input_iterator_tag

◆ pointer

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
using CeresEngine::IteratorPrototype< T, D, C >::pointer = value_type*

◆ reference

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
using CeresEngine::IteratorPrototype< T, D, C >::reference = decltype(std::declval<D>()(std::declval<T&>()))

◆ value_type

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
using CeresEngine::IteratorPrototype< T, D, C >::value_type = typename std::decay<reference>::type

Constructor & Destructor Documentation

◆ IteratorPrototype() [1/2]

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
CeresEngine::IteratorPrototype< T, D, C >::IteratorPrototype ( )
delete

◆ IteratorPrototype() [2/2]

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
CeresEngine::IteratorPrototype< T, D, C >::IteratorPrototype ( T &&  first,
D &&  _dereferencer = D(),
C &&  _compare = C() 
)
inlineexplicit

Member Function Documentation

◆ operator*()

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
DereferencedType CeresEngine::IteratorPrototype< T, D, C >::operator* ( )
inline

◆ operator->()

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
auto * CeresEngine::IteratorPrototype< T, D, C >::operator-> ( ) const
inline

Friends And Related Symbol Documentation

◆ operator!=

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
bool operator!= ( const IteratorPrototype< T, D, C > &  lhs,
const IteratorPrototype< T, D, C > &  rhs 
)
friend

◆ operator==

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
bool operator== ( const IteratorPrototype< T, D, C > &  lhs,
const IteratorPrototype< T, D, C > &  rhs 
)
friend

Member Data Documentation

◆ compare

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
C CeresEngine::IteratorPrototype< T, D, C >::compare
protected

◆ dereferencer

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
D CeresEngine::IteratorPrototype< T, D, C >::dereferencer
protected

◆ value

template<class T , typename D = impl::dereference::ByValueReference, typename C = impl::compare::ByValue>
T CeresEngine::IteratorPrototype< T, D, C >::value
mutable

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