efl::eina::_common_iterator_base< T > Struct Template Reference

Public Types | Public Member Functions | Protected Attributes | Friends
efl::eina::_common_iterator_base< T > Struct Template Reference
Eina C++Eina C++ » | Data Types » Content Access » Iterator

Common implementations for iterators. More...

## Public Types
typedef T const | value_type
| Type for elements returned by the iterator. More...
typedef value_type * | pointer
| Type for a pointer to an element. More...
typedef value_type & | reference
| 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
| _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 ()
| Release the internal native Eina iterator handle.
| _common_iterator_base (self_type const &other)
| Creates an iterator from another iterator of the same type. More...
_common_iterator_base & | operator= (self_type const &other)
| Acquire the internal handle of the given iterator. More...

## Protected Attributes
Eina_Iterator * | _iterator

## Friends
bool | operator== (_common_iterator_base< T > const &lhs, _common_iterator_base< T > const &rhs)
| Check if the iterators wrap the same handle. More...
bool | operator!= (_common_iterator_base< T > const &lhs, _common_iterator_base< T > const &rhs)
| Check if the iterators wrap the different handles. More...

## Detailed Description

### template<typename T>
struct efl::eina::_common_iterator_base< T >

Common implementations for iterators.

## Member Typedef Documentation

## ◆ value_type

template<typename T>

typedef T const efl::eina::_common_iterator_base< T >::value_type

Type for elements returned by the iterator.

## ◆ pointer

template<typename T>

typedef value_type* efl::eina::_common_iterator_base< T >::pointer

Type for a pointer to an element.

## ◆ reference

template<typename T>

typedef value_type& efl::eina::_common_iterator_base< T >::reference

Type for a reference to an element.

## ◆ difference_type

template<typename T>

typedef std::ptrdiff_t efl::eina::_common_iterator_base< T >::difference_type

Type to represent the distance between two iterators.

## ◆ iterator_category

template<typename T>

typedef std::input_iterator_tag efl::eina::_common_iterator_base< T >::iterator_category

Defines the iterator as being an input iterator.

## Constructor & Destructor Documentation

## ◆ _common_iterator_base() [1/3]

template<typename T>

efl::eina::_common_iterator_base< T >::_common_iterator_base | ( |  | ) |
| inline

Default constructor.

Creates an iterator that points to nothing.

## ◆ _common_iterator_base() [2/3]

template<typename T>

efl::eina::_common_iterator_base< T >::_common_iterator_base | ( | Eina_Iterator * | iterator | ) |
| inlineexplicit

Creates a iterator wrapping the given native `Eina_Iterator` handle.

Parameters

  iterator | Handle to a native `Eina_Iterator`.

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

Warning
  The created iterator object gains ownership of the handle and will deallocate it at destruction time.

## ◆ _common_iterator_base() [3/3]

template<typename T>

efl::eina::_common_iterator_base< T >::_common_iterator_base | ( | self_type const & | other | ) |
| inline

Creates an iterator from another iterator of the same type.

Parameters

  other | Another iterator of the same type.

Warning
  The supplied iterator transfer its internal handle to the new iterator, thus `other` will point to nothing after the call of this constructor.

## Member Function Documentation

## ◆ operator=()

template<typename T>

_common_iterator_base& efl::eina::_common_iterator_base< T >::operator= | ( | self_type const & | other | ) |
| inline

Acquire the internal handle of the given iterator.

Parameters

  other | Another iterator of the same type.

Returns
  Reference for itself.

Warning
  The supplied iterator transfer its internal handle to the new iterator, thus `other` will point to nothing after the call of this constructor.

## Friends And Related Function Documentation

## ◆ operator==

template<typename T>

bool operator== | ( | _common_iterator_base< T > const & | lhs,
|  | _common_iterator_base< T > const & | rhs
| ) |  |
| friend

Check if the iterators wrap the same handle.

Parameters

  lhs | Iterator at the left side of the expression.
  lhs | Iterator at the right side of the expression.

Returns
  `true` if both iterators wrap the same handle, `false` otherwise.

## ◆ operator!=

template<typename T>

bool operator!= | ( | _common_iterator_base< T > const & | lhs,
|  | _common_iterator_base< T > const & | rhs
| ) |  |
| friend

Check if the iterators wrap the different handles.

Parameters

  lhs | Iterator at the left side of the expression.
  lhs | Iterator at the right side of the expression.

Returns
  `true` if the iterators wrap different handles, `false` otherwise.