- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

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 Eina C++Eina C++ » | Data Types » | Content Access

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

template<typename T>

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

Type for elements returned by the iterator.

template<typename T>

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

Type for a pointer to an element.

template<typename T>

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

Type for a reference to an element.

template<typename T>

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

Type to represent the distance between two iterators.

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

template<typename T>

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

Default constructor.

Creates an iterator that points to nothing.

template<typename T>

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

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.

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

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

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.

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.