xtd 0.2.0
Loading...
Searching...
No Matches
xtd::collections::generic::enumerable_iterators< type_t, enumerable_t > Class Template Reference
Inheritance diagram for xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >:
xtd::collections::generic::ienumerable< char_t > xtd::collections::generic::ienumerable< list_type_t > xtd::collections::generic::ienumerable< value_type > xtd::basic_string< char_t, traits_t, allocator_t >

Definition

template<typename type_t, typename enumerable_t>
class xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >

Internal enumarable iterators definition.

Definition
template<typename type_t, typename enumerable_t>
Internal enumarable iterators definition.
Definition enumerable_iterators.hpp:44
Header
#include <xtd/collections/enumerable_iterators
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
The xtd::collections::generic::enumerable_iterators <type_t> class is use to hide the complexity of c++ std::iterator.
The objective is for any collection inheriting from the xtd::collections::generic::ienumerable <type_t> interface to provide the iterator and const_iterator types and begin and end methods needed to be able to iterate the collection as for example :
auto parts = part_collection {};
Items.add(part {"item one", guid::new_guid()});
/*...*&zwj;/
Items.add(part {"item n", guid::new_guid()}});
for (auto part : parts)
console::write_line(part);
static guid new_guid() noexcept
Initializes a new instance of the xtd::guid structure.
Warning
Internal use only for xtd::collections::generic::ienumerable interfece.

Classes

class  iterator
 Represents the iterator of enumarable value type. More...
 

Public Aliases

using const_iterator = const iterator
 Represents the const iterator of enumarable value type.
 

Public Methods

virtual const_iterator begin () const
 Returns an iterator to the first element of the enumarable.
 
virtual iterator begin ()
 Returns an iterator to the first element of the enumarable.
 
virtual const_iterator cbegin () const
 Returns an iterator to the first element of the enumarable.
 
virtual const_iterator cend () const
 Returns an iterator to the element following the last element of the enumarable.
 
virtual const_iterator end () const
 Returns an iterator to the element following the last element of the enumarable.
 
virtual iterator end ()
 Returns an iterator to the element following the last element of the enumarable.
 

Member Typedef Documentation

◆ const_iterator

template<typename type_t , typename enumerable_t >
using xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::const_iterator = const iterator

Represents the const iterator of enumarable value type.

Member Function Documentation

◆ begin() [1/2]

template<typename type_t , typename enumerable_t >
virtual const_iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::begin ( ) const
inlinevirtual

◆ begin() [2/2]

template<typename type_t , typename enumerable_t >
virtual iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::begin ( )
inlinevirtual

Returns an iterator to the first element of the enumarable.

Returns
Iterator to the first element.

Reimplemented in xtd::basic_array< type_t, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< value_type, allocator_t >, and xtd::collections::generic::list< type_t, allocator_t >.

◆ cbegin()

template<typename type_t , typename enumerable_t >
virtual const_iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::cbegin ( ) const
inlinevirtual

◆ cend()

template<typename type_t , typename enumerable_t >
virtual const_iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::cend ( ) const
inlinevirtual

Returns an iterator to the element following the last element of the enumarable.

Returns
Iterator to the element following the last element.

Reimplemented in xtd::basic_array< type_t, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< value_type, allocator_t >, xtd::collections::generic::list< type_t, allocator_t >, and xtd::basic_string< char_t, traits_t, allocator_t >.

◆ end() [1/2]

template<typename type_t , typename enumerable_t >
virtual const_iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::end ( ) const
inlinevirtual

Returns an iterator to the element following the last element of the enumarable.

Returns
Iterator to the element following the last element.

Reimplemented in xtd::basic_array< type_t, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< value_type, allocator_t >, xtd::collections::generic::list< type_t, allocator_t >, and xtd::basic_string< char_t, traits_t, allocator_t >.

◆ end() [2/2]

template<typename type_t , typename enumerable_t >
virtual iterator xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >::end ( )
inlinevirtual

Returns an iterator to the element following the last element of the enumarable.

Returns
Iterator to the element following the last element.

Reimplemented in xtd::basic_array< type_t, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< value_type, allocator_t >, and xtd::collections::generic::list< type_t, allocator_t >.


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