cesium-native 0.52.0
Loading...
Searching...
No Matches
CesiumUtility::TransformIterator< TTransformFunction, TIterator > Class Template Reference

An iterator that wraps another iterator and applies a transformation function to each element as it is accessed. More...

#include <CesiumUtility/TransformIterator.h>

Classes

struct  pointer
 A pointer to the type being iterated over. More...
 

Public Types

using iterator_category
 The iterator category tag denoting this iterator has the same category as the underlying iterator.
 
using value_type
 The type of value that is being iterated over, which is the result of the transformation function applied to the underlying iterator's value.
 
using difference_type
 The type used to identify distance between iterators, which for this iterator is the same as the underlying iterator's different_type.
 

Public Member Functions

 TransformIterator (TTransformFunction transformFunction, TIterator iterator)
 Creates a new instance.
 
value_type operator* () const
 Returns the current item being iterated. This applies the transformation function to the current item of the underlying iterator.
 
pointer operator-> () const
 Returns a pointer to the current item being iterated. This applies the transformation function to the current item of the underlying iterator.
 
TransformIteratoroperator++ ()
 Advances the iterator to the next item (pre-incrementing).
 
TransformIterator operator++ (int)
 Advances the iterator to the next item (post-incrementing).
 
bool operator== (const TransformIterator &rhs) const
 Checks if two iterators are at the same item.
 
bool operator!= (const TransformIterator &other) const
 Checks if two iterators are NOT at the same item.
 

Detailed Description

template<typename TTransformFunction, typename TIterator>
class CesiumUtility::TransformIterator< TTransformFunction, TIterator >

An iterator that wraps another iterator and applies a transformation function to each element as it is accessed.

Definition at line 13 of file TransformIterator.h.

Member Typedef Documentation

◆ difference_type

template<typename TTransformFunction, typename TIterator>
using CesiumUtility::TransformIterator< TTransformFunction, TIterator >::difference_type
Initial value:
typename std::iterator_traits<TIterator>::difference_type

The type used to identify distance between iterators, which for this iterator is the same as the underlying iterator's different_type.

Definition at line 34 of file TransformIterator.h.

◆ iterator_category

template<typename TTransformFunction, typename TIterator>
using CesiumUtility::TransformIterator< TTransformFunction, TIterator >::iterator_category
Initial value:
typename std::iterator_traits<TIterator>::iterator_category

The iterator category tag denoting this iterator has the same category as the underlying iterator.

Definition at line 19 of file TransformIterator.h.

◆ value_type

template<typename TTransformFunction, typename TIterator>
using CesiumUtility::TransformIterator< TTransformFunction, TIterator >::value_type
Initial value:
typename std::invoke_result_t<
TTransformFunction,
typename std::iterator_traits<TIterator>::reference>

The type of value that is being iterated over, which is the result of the transformation function applied to the underlying iterator's value.

Definition at line 26 of file TransformIterator.h.

Constructor & Destructor Documentation

◆ TransformIterator()

template<typename TTransformFunction, typename TIterator>
CesiumUtility::TransformIterator< TTransformFunction, TIterator >::TransformIterator ( TTransformFunction transformFunction,
TIterator iterator )
inline

Creates a new instance.

Parameters
transformFunctionThe function to apply to each element as it is accessed. This function must be callable with a single argument of the type being iterated over.
iteratorThe underlying iterator to wrap.

Definition at line 65 of file TransformIterator.h.

Member Function Documentation

◆ operator!=()

template<typename TTransformFunction, typename TIterator>
bool CesiumUtility::TransformIterator< TTransformFunction, TIterator >::operator!= ( const TransformIterator< TTransformFunction, TIterator > & other) const
inline

Checks if two iterators are NOT at the same item.

Definition at line 111 of file TransformIterator.h.

◆ operator*()

template<typename TTransformFunction, typename TIterator>
value_type CesiumUtility::TransformIterator< TTransformFunction, TIterator >::operator* ( ) const
inline

Returns the current item being iterated. This applies the transformation function to the current item of the underlying iterator.

Definition at line 72 of file TransformIterator.h.

◆ operator++() [1/2]

template<typename TTransformFunction, typename TIterator>
TransformIterator & CesiumUtility::TransformIterator< TTransformFunction, TIterator >::operator++ ( )
inline

Advances the iterator to the next item (pre-incrementing).

Definition at line 87 of file TransformIterator.h.

◆ operator++() [2/2]

template<typename TTransformFunction, typename TIterator>
TransformIterator CesiumUtility::TransformIterator< TTransformFunction, TIterator >::operator++ ( int )
inline

Advances the iterator to the next item (post-incrementing).

Definition at line 95 of file TransformIterator.h.

◆ operator->()

template<typename TTransformFunction, typename TIterator>
pointer CesiumUtility::TransformIterator< TTransformFunction, TIterator >::operator-> ( ) const
inline

Returns a pointer to the current item being iterated. This applies the transformation function to the current item of the underlying iterator.

Definition at line 80 of file TransformIterator.h.

◆ operator==()

template<typename TTransformFunction, typename TIterator>
bool CesiumUtility::TransformIterator< TTransformFunction, TIterator >::operator== ( const TransformIterator< TTransformFunction, TIterator > & rhs) const
inline

Checks if two iterators are at the same item.

Definition at line 104 of file TransformIterator.h.


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