Public Types | Public Member Functions
efl::eina::iterator< T, Enable > Struct Template Reference

C++ wrappers to the native Eina_Iterator. More...

Public Types

typedef base_type::value_type value_type
 Type for elements returned by the iterator. More...
 
typedef base_type::pointer pointer
 Type for a pointer to an element. More...
 
typedef base_type::reference reference
 Type for a reference to an element. More...
 
typedef base_type::difference_type difference_type
 Type to represent the distance between two iterators. More...
 
typedef base_type::iterator_category iterator_category
 Defines the iterator category as the same of the base class. More...
 
- Public Types inherited from efl::eina::_common_iterator_base< std::enable_if<!std::is_convertible< T *, ::efl::eo::concrete const *const >::value, T const >::type >
typedef std::enable_if<!std::is_convertible< T *, ::efl::eo::concrete const *const >::value, T const >::type const value_type
 Type for elements returned by the iterator. More...
 
typedef value_typepointer
 Type for a pointer to an element. More...
 
typedef value_typereference
 Type for a reference to an element. More...
 
typedef std::ptrdiff_t difference_type
 Type to represent the distance between two iterators. More...
 
typedef std::input_iterator_tag iterator_category
 Defines the iterator as being an input iterator. More...
 

Public Member Functions

 iterator (Eina_Iterator *iterator_=0)
 Creates a iterator wrapping the given native Eina_Iterator handle. More...
 
self_typeoperator++ ()
 Move the iterator to the next position. More...
 
self_typeoperator++ (int)
 Move the iterator to the next position. More...
 
value_typeoperator* () const
 Get a reference to the element currently pointed by the iterator. More...
 
pointer operator-> () const
 Return a pointer to the current element, which member will be accessed. More...
 
- Public Member Functions inherited from efl::eina::_common_iterator_base< std::enable_if<!std::is_convertible< T *, ::efl::eo::concrete const *const >::value, T const >::type >
 _common_iterator_base ()
 Default constructor. More...
 
 _common_iterator_base (Eina_Iterator *iterator)
 Creates a iterator wrapping the given native Eina_Iterator handle. More...
 
 _common_iterator_base (self_type const &other)
 Creates an iterator from another iterator of the same type. More...
 
 ~_common_iterator_base ()
 Release the internal native Eina iterator handle.
 
_common_iterator_baseoperator= (self_type const &other)
 Acquire the internal handle of the given iterator. More...
 
Eina_Iteratornative_handle () const
 Get the handle for the wrapped Eina_Iterator. More...
 

Additional Inherited Members

- Protected Attributes inherited from efl::eina::_common_iterator_base< std::enable_if<!std::is_convertible< T *, ::efl::eo::concrete const *const >::value, T const >::type >
Eina_Iterator_iterator
 

Detailed Description

template<typename T, typename Enable = void>
struct efl::eina::iterator< T, Enable >

C++ wrappers to the native Eina_Iterator.

It provides a generic interface to the Eina_Iterator functions, and automatically take care of allocating a deallocating resources using the RAII programming idiom.

Member Typedef Documentation

◆ value_type

template<typename T, typename Enable = void>
typedef base_type::value_type efl::eina::iterator< T, Enable >::value_type

Type for elements returned by the iterator.

◆ pointer

template<typename T, typename Enable = void>
typedef base_type::pointer efl::eina::iterator< T, Enable >::pointer

Type for a pointer to an element.

◆ reference

template<typename T, typename Enable = void>
typedef base_type::reference efl::eina::iterator< T, Enable >::reference

Type for a reference to an element.

◆ difference_type

template<typename T, typename Enable = void>
typedef base_type::difference_type efl::eina::iterator< T, Enable >::difference_type

Type to represent the distance between two iterators.

◆ iterator_category

template<typename T, typename Enable = void>
typedef base_type::iterator_category efl::eina::iterator< T, Enable >::iterator_category

Defines the iterator category as the same of the base class.

Constructor & Destructor Documentation

◆ iterator()

template<typename T, typename Enable = void>
efl::eina::iterator< T, Enable >::iterator ( Eina_Iterator iterator_ = 0)
inlineexplicit

Creates a iterator wrapping the given native Eina_Iterator handle.

This constructor creates an iterator that wraps the given native Eina_Iterator handle, providing a generic interface to it.

Member Function Documentation

◆ operator++() [1/2]

template<typename T, typename Enable = void>
self_type& efl::eina::iterator< T, Enable >::operator++ ( )
inline

Move the iterator to the next position.

Returns
The iterator itself.

This operator increments the iterator, making it point to the position right after the current one. At the end, it returns a reference to itself.

References eina_iterator_next().

◆ operator++() [2/2]

template<typename T, typename Enable = void>
self_type& efl::eina::iterator< T, Enable >::operator++ ( int  )
inline

Move the iterator to the next position.

Returns
The iterator itself.

Works exactly like operator++().

◆ operator*()

template<typename T, typename Enable = void>
value_type& efl::eina::iterator< T, Enable >::operator* ( ) const
inline

Get a reference to the element currently pointed by the iterator.

Returns
Reference to the current element.

◆ operator->()

template<typename T, typename Enable = void>
pointer efl::eina::iterator< T, Enable >::operator-> ( ) const
inline

Return a pointer to the current element, which member will be accessed.

Returns
Pointer to the element currently pointed by the iterator.