PLaSK library
Loading...
Searching...
No Matches
plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value > Struct Template Reference

Template to create iterators which using method having index argument. More...

#include <plask/utils/iterators.hpp>

Inheritance diagram for plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >:
[legend]
Collaboration diagram for plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >:
[legend]

Public Member Functions

 MethodIterator ()
 Construct uninitialized iterator. Don't use it before initialization.
 
 MethodIterator (ContainerType *container, std::size_t index)
 Construct iterator which point to given index in given container.
 
std::size_t getIndex () const
 Get current iterator position (index).
 

Public Attributes

ContainerTypecontainer
 Pointer to container over which we iterate.
 
std::size_t index
 Current iterator position (index).
 

Friends

class boost::iterator_core_access
 
template<typename _ContainerType , typename _ReturnedType , _ReturnedType(_ContainerType::*)(std::size_t) _Method, typename _Reference , typename _Value >
struct MethodIterator
 

Detailed Description

template<typename ContainerType, typename ReturnedType, ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
struct plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >

Template to create iterators which using method having index argument.

Template Parameters
ContainerTypetype of container (can be const or non-const)
ReturnedTypeexact type returned by container method Method
Methodmethod used to get value
Referenceiterator reference type, should be the same type which return functor operator()
Valueiterator value type, should be the same type which return container operator[] but without reference

Definition at line 383 of file iterators.hpp.

Constructor & Destructor Documentation

◆ MethodIterator() [1/2]

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >::MethodIterator ( )
inline

Construct uninitialized iterator. Don't use it before initialization.

Definition at line 392 of file iterators.hpp.

◆ MethodIterator() [2/2]

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >::MethodIterator ( ContainerType container,
std::size_t  index 
)
inline

Construct iterator which point to given index in given container.

Parameters
containercontainer to iterate over
indexindex in container

Definition at line 399 of file iterators.hpp.

Member Function Documentation

◆ getIndex()

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
std::size_t plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >::getIndex ( ) const
inline

Get current iterator position (index).

Returns
current iterator position (index)

Definition at line 405 of file iterators.hpp.

Friends And Related Symbol Documentation

◆ boost::iterator_core_access

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
friend class boost::iterator_core_access
friend

Definition at line 408 of file iterators.hpp.

◆ MethodIterator

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
template<typename _ContainerType , typename _ReturnedType , _ReturnedType(_ContainerType::*)(std::size_t) _Method, typename _Reference , typename _Value >
friend struct MethodIterator
friend

Definition at line 415 of file iterators.hpp.

Member Data Documentation

◆ container

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
ContainerType* plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >::container

Pointer to container over which we iterate.

Definition at line 386 of file iterators.hpp.

◆ index

template<typename ContainerType , typename ReturnedType , ReturnedType(ContainerType::*)(std::size_t) Method, typename Reference = ReturnedType, typename Value = typename std::remove_reference<Reference>::type>
std::size_t plask::MethodIterator< ContainerType, ReturnedType, Method, Reference, Value >::index

Current iterator position (index).

Definition at line 389 of file iterators.hpp.


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