theCore C++ embedded framework
ecl::list_iter< T, Mptr > Class Template Reference

Intrusive list's specific, safe iterator. More...

#include </home/travis/build/forGGe/theCore/lib/containers/export/ecl/list.hpp>

Public Member Functions

 list_iter (list_node &cur)
 Constructs iterator that iterates given list. More...
 
 ~list_iter ()
 Destroys iterator. More...
 
list_iteroperator++ ()
 Proceed to the next item in a list. More...
 
list_iter operator++ (int)
 Postfix version of the operatoris. More...
 
T * operator-> ()
 Accesses an object. More...
 
T & operator* ()
 Acessess an object. More...
 
bool operator== (const list_iter &other)
 Compares two iterators. More...
 
bool operator!= (const list_iter< T, Mptr > &other)
 Compares two iterators. More...
 
 list_iter (const list_iter &)=default
 
list_iteroperator= (list_iter &)=default
 
list_iteroperator= (const list_iter &)=default
 

Detailed Description

template<typename T, list_node T::* Mptr>
class ecl::list_iter< T, Mptr >

Intrusive list's specific, safe iterator.

It is safe to delete a node or an item and move this iterator after.

Template Parameters
TThe type of enclosing class or struct.
MptrThe member-pointer of the list node inside enclosing class.

Constructor & Destructor Documentation

◆ list_iter() [1/2]

template<typename T , list_node T::* Mptr>
ecl::list_iter< T, Mptr >::list_iter ( list_node cur)

Constructs iterator that iterates given list.

◆ ~list_iter()

template<typename T , list_node T::* Mptr>
ecl::list_iter< T, Mptr >::~list_iter ( )

Destroys iterator.

◆ list_iter() [2/2]

template<typename T, list_node T::* Mptr>
ecl::list_iter< T, Mptr >::list_iter ( const list_iter< T, Mptr > &  )
default

Member Function Documentation

◆ operator++() [1/2]

template<typename T , list_node T::* Mptr>
list_iter< T, Mptr > & ecl::list_iter< T, Mptr >::operator++ ( )

Proceed to the next item in a list.

◆ operator++() [2/2]

template<typename T , list_node T::* Mptr>
list_iter< T, Mptr > ecl::list_iter< T, Mptr >::operator++ ( int  )

Postfix version of the operatoris.

◆ operator->()

template<typename T , list_node T::* Mptr>
T * ecl::list_iter< T, Mptr >::operator-> ( )

Accesses an object.

Here is the call graph for this function:

◆ operator*()

template<typename T , list_node T::* Mptr>
T & ecl::list_iter< T, Mptr >::operator* ( )

Acessess an object.

◆ operator==()

template<typename T , list_node T::* Mptr>
bool ecl::list_iter< T, Mptr >::operator== ( const list_iter< T, Mptr > &  other)

Compares two iterators.

Warning
Comparing iterators from different lists is illegal.
Returns
True if iterators point to the same object within the same list.

◆ operator!=()

template<typename T , list_node T::* Mptr>
bool ecl::list_iter< T, Mptr >::operator!= ( const list_iter< T, Mptr > &  other)

Compares two iterators.

Warning
Comparing iterators from different lists is illegal.
Returns
False if iterators point to the same object within the same list.

◆ operator=() [1/2]

template<typename T, list_node T::* Mptr>
list_iter& ecl::list_iter< T, Mptr >::operator= ( list_iter< T, Mptr > &  )
default

◆ operator=() [2/2]

template<typename T, list_node T::* Mptr>
list_iter& ecl::list_iter< T, Mptr >::operator= ( const list_iter< T, Mptr > &  )
default

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