xtd 0.2.0
Loading...
Searching...
No Matches
xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t > Class Template Reference
Inheritance diagram for xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >:
xtd::collections::generic::ienumerable< char_t > xtd::collections::generic::ienumerable< bool > xtd::collections::generic::ienumerable< xtd::collections::generic::key_value_pair< key_t, value_t > > xtd::collections::generic::ienumerable< list_type_t > xtd::collections::generic::ienumerable< xtd::sptr< xtd::diagnostics::trace_listener > > xtd::collections::generic::ienumerable< value_type > xtd::collections::generic::ienumerable< int32 > xtd::collections::generic::ienumerable< xtd::string > xtd::collections::generic::ienumerable< xtd::drawing::color > xtd::collections::generic::ienumerable< xtd::byte > xtd::collections::generic::ienumerable< xtd::drawing::imaging::encoder_parameter > xtd::collections::generic::ienumerable< xtd::basic_string > xtd::collections::generic::ienumerable< xtd::shared_ptr_object< xtd::forms::menu_item > > xtd::collections::generic::ienumerable< xtd::forms::style_sheets::shadow > xtd::collections::generic::ienumerable< byte > xtd::collections::generic::ienumerable< xtd::uint16 > xtd::collections::generic::ienumerable< xtd::net::ip_address > xtd::collections::generic::ienumerable< xtd::array< xtd::byte > > xtd::collections::generic::ienumerable< xtd::time_zone_info::adjustement_rule > xtd::collections::generic::ienumerable< xtd::tunit::test >

Definition

template<class type_t, class enumerable_t, class iterator_tag_t = std::bidirectional_iterator_tag>
class xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >

Internal enumarable iterators definition.

Definition
template<class type_t, class enumerable_t, class iterator_tag_t = std::bidirectional_iterator_tag>
Internal enumarable iterators definition.
Definition enumerable_iterators.hpp:48
Header
#include <xtd/collections/generic/extensions/enumerable_iterators>
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
The xtd::collections::generic::extensions::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 {};
parts.add(part {"item one", guid::new_guid()});
// ...
parts.add(part {"item n", guid::new_guid()}});
for (auto part : parts)
console::write_line(part);
Represents the standard input, output, and error streams for console applications.
Definition console.hpp:36
static guid new_guid() noexcept
Initializes a new instance of the xtd::guid structure.
Warning
Internal use only for xtd::collections::generic::ienumerable interfece.

Public Aliases

using iterator = enumerable_iterator
 Represents the iterator of enumarable value type.
 
using const_iterator = const enumerable_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.
 

Public Static Methods

template<class source_collection_t , class target_collection_t >
static target_collection_t::const_iterator to_iterator (typename source_collection_t::const_iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept
 Converts source iterator to target iterator.
 
template<class source_collection_t , class target_collection_t >
static target_collection_t::iterator to_iterator (typename source_collection_t::iterator &value, const source_collection_t &source_collection, const target_collection_t &target_collection) noexcept
 Converts source iterator to target iterator.
 
template<class source_collection_t , class target_collection_t >
static target_collection_t::const_iterator to_iterator (typename source_collection_t::const_iterator &value, source_collection_t &source_collection, target_collection_t &target_collection) noexcept
 Converts source iterator to target iterator.
 
template<class source_collection_t , class target_collection_t >
static target_collection_t::iterator to_iterator (typename source_collection_t::iterator &value, source_collection_t &source_collection, target_collection_t &target_collection) noexcept
 Converts source iterator to target iterator.
 

Member Typedef Documentation

◆ iterator

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
using xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::iterator = enumerable_iterator

Represents the iterator of enumarable value type.

◆ const_iterator

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
using xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::const_iterator = const enumerable_iterator

Represents the const iterator of enumarable value type.

Member Function Documentation

◆ begin() [1/2]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
virtual const_iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::begin ( ) const
inlinevirtual

◆ begin() [2/2]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
virtual iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::begin ( )
inlinevirtual

◆ cbegin()

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
virtual const_iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::cbegin ( ) const
inlinevirtual

◆ cend()

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
virtual const_iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_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< byte, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< value_type, allocator_t >, xtd::basic_array< xtd::array< xtd::byte >, allocator_t >, xtd::basic_array< xtd::basic_string, allocator_t >, xtd::basic_array< xtd::byte, allocator_t >, xtd::basic_array< xtd::drawing::color, allocator_t >, xtd::basic_array< xtd::drawing::imaging::encoder_parameter, allocator_t >, xtd::basic_array< xtd::net::ip_address, allocator_t >, xtd::basic_array< xtd::string, allocator_t >, xtd::basic_array< xtd::uint16, allocator_t >, xtd::collections::bit_array, xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::list< type_t, allocator_t >, xtd::collections::generic::list< byte >, xtd::collections::generic::list< int32 >, xtd::collections::generic::list< xtd::byte >, xtd::collections::generic::list< xtd::drawing::color >, xtd::collections::generic::list< xtd::forms::style_sheets::shadow >, xtd::collections::generic::list< xtd::shared_ptr_object< xtd::forms::menu_item > >, xtd::collections::generic::list< xtd::sptr< xtd::diagnostics::trace_listener > >, xtd::collections::generic::list< xtd::time_zone_info::adjustement_rule >, xtd::collections::generic::list< xtd::tunit::test >, and xtd::basic_string< char_t, traits_t, allocator_t >.

◆ end() [1/2]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
virtual const_iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_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< byte, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< value_type, allocator_t >, xtd::basic_array< xtd::array< xtd::byte >, allocator_t >, xtd::basic_array< xtd::basic_string, allocator_t >, xtd::basic_array< xtd::byte, allocator_t >, xtd::basic_array< xtd::drawing::color, allocator_t >, xtd::basic_array< xtd::drawing::imaging::encoder_parameter, allocator_t >, xtd::basic_array< xtd::net::ip_address, allocator_t >, xtd::basic_array< xtd::string, allocator_t >, xtd::basic_array< xtd::uint16, allocator_t >, xtd::collections::bit_array, xtd::collections::generic::dictionary< key_t, value_t, hasher_t, equator_t, allocator_t >, xtd::collections::generic::list< type_t, allocator_t >, xtd::collections::generic::list< byte >, xtd::collections::generic::list< int32 >, xtd::collections::generic::list< xtd::byte >, xtd::collections::generic::list< xtd::drawing::color >, xtd::collections::generic::list< xtd::forms::style_sheets::shadow >, xtd::collections::generic::list< xtd::shared_ptr_object< xtd::forms::menu_item > >, xtd::collections::generic::list< xtd::sptr< xtd::diagnostics::trace_listener > >, xtd::collections::generic::list< xtd::time_zone_info::adjustement_rule >, xtd::collections::generic::list< xtd::tunit::test >, and xtd::basic_string< char_t, traits_t, allocator_t >.

◆ end() [2/2]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
virtual iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::end ( )
inlinevirtual

◆ to_iterator() [1/4]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
template<class source_collection_t , class target_collection_t >
static target_collection_t::const_iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::to_iterator ( typename source_collection_t::const_iterator &  value,
const source_collection_t &  source_collection,
const target_collection_t &  target_collection 
)
inlinestaticnoexcept

Converts source iterator to target iterator.

Parameters
valueThe source iterator to convert.
sourceThe source collection from which the source iterator originates.
target_collectionThe target collection from which the target iterator originates.
Returns
The converted target iterator.
Remarks
This converter is used only to convert a source iterator position into a target iterator position.
Note
This converter does not check the validity and consistency of the data in the various collections; it is up to the user to ensure this.
Remarks
The distance to move the target iterator is calculated with std::distance(source_collection.begin(), value);. Then simply move the target iterator from target_collection.begin();.

◆ to_iterator() [2/4]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
template<class source_collection_t , class target_collection_t >
static target_collection_t::iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::to_iterator ( typename source_collection_t::iterator &  value,
const source_collection_t &  source_collection,
const target_collection_t &  target_collection 
)
inlinestaticnoexcept

Converts source iterator to target iterator.

Parameters
valueThe source iterator to convert.
sourceThe source collection from which the source iterator originates.
target_collectionThe target collection from which the target iterator originates.
Returns
The converted target iterator.
Remarks
This converter is used only to convert a source iterator position into a target iterator position.
Note
This converter does not check the validity and consistency of the data in the various collections; it is up to the user to ensure this.
Remarks
The distance to move the target iterator is calculated with std::distance(source_collection.begin(), value);. Then simply move the target iterator from target_collection.begin();.

◆ to_iterator() [3/4]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
template<class source_collection_t , class target_collection_t >
static target_collection_t::const_iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::to_iterator ( typename source_collection_t::const_iterator &  value,
source_collection_t &  source_collection,
target_collection_t &  target_collection 
)
inlinestaticnoexcept

Converts source iterator to target iterator.

Parameters
valueThe source iterator to convert.
sourceThe source collection from which the source iterator originates.
target_collectionThe target collection from which the target iterator originates.
Returns
The converted target iterator.
Remarks
This converter is used only to convert a source iterator position into a target iterator position.
Note
This converter does not check the validity and consistency of the data in the various collections; it is up to the user to ensure this.
Remarks
The distance to move the target iterator is calculated with std::distance(source_collection.begin(), value);. Then simply move the target iterator from target_collection.begin();.

◆ to_iterator() [4/4]

template<class type_t , class enumerable_t , class iterator_tag_t = std::bidirectional_iterator_tag>
template<class source_collection_t , class target_collection_t >
static target_collection_t::iterator xtd::collections::generic::extensions::enumerable_iterators< type_t, enumerable_t, iterator_tag_t >::to_iterator ( typename source_collection_t::iterator &  value,
source_collection_t &  source_collection,
target_collection_t &  target_collection 
)
inlinestaticnoexcept

Converts source iterator to target iterator.

Parameters
valueThe source iterator to convert.
sourceThe source collection from which the source iterator originates.
target_collectionThe target collection from which the target iterator originates.
Returns
The converted target iterator.
Remarks
This converter is used only to convert a source iterator position into a target iterator position.
Note
This converter does not check the validity and consistency of the data in the various collections; it is up to the user to ensure this.
Remarks
The distance to move the target iterator is calculated with std::distance(source_collection.begin(), value);. Then simply move the target iterator from target_collection.begin();.

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