Wrapping iterator that invokes a functor on dereference.
Declared in <bdlb_transformiterator.h>
template<
class FUNCTOR,
class ITERATOR>
class TransformIterator
: public TransformIterator_AllocatorOfIteratorMethod<TransformIterator<FUNCTOR, ITERATOR>, bslma::UsesBslmaAllocator<ITERATOR>::value>
, public TransformIterator_AllocatorOfFunctorMethod<TransformIterator<FUNCTOR, ITERATOR>, !bslma::UsesBslmaAllocator<ITERATOR>::value && bslma::UsesBslmaAllocator<FUNCTOR>::value>
The transform iterator class itself. Its job is to hold a functor and an iterator, pass through all iterator-related operations to the held iterator, and on dereference, call the functor on the result of dereferencing the iterator and return the result of the call instead.
| Name | Description |
|---|---|
TransformIterator_AllocatorOfIteratorMethod<TransformIterator<FUNCTOR, ITERATOR>, bslma::UsesBslmaAllocator<ITERATOR>::value> | Base class template that optionally provides an allocator method. |
TransformIterator_AllocatorOfFunctorMethod<TransformIterator<FUNCTOR, ITERATOR>, !bslma::UsesBslmaAllocator<ITERATOR>::value && bslma::UsesBslmaAllocator<FUNCTOR>::value> | Base class template that optionally provides an allocator method. |
| Name | Description |
|---|---|
difference_type | Type used to represent distances between iterators. |
iterator_category | Iterator category of this transform iterator. |
pointer | Pointer type for this iterator. |
reference | Reference type returned by dereferencing this iterator. |
value_type | Value type produced by dereferencing this iterator. |
| Name | Description |
|---|---|
TransformIterator [constructor] | Constructors |
operator= | Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. |
functor | functor overloads |
iterator | iterator overloads |
operator* | Return the result of applying this object's functor to *iterator(). |
operator++ | Increment this iterator and return a reference to it. |
operator+= | Advance this iterator by the specified offset. |
operator-- | Decrement this iterator and return a reference to it. |
operator-= | Regress this iterator by the specified offset. |
operator-> | Return the address of the transformed current element. |
operator[] | Return the transformed element at the specified offset. |
swap | Exchange the value of this object with that of other. |
operator BloombergLP::bslmf::NestedTraitDeclaration<TransformIterator, UsesBslmaAllocator, bslma::UsesBslmaAllocator<ITERATOR>::value || bslma::UsesBslmaAllocator<FUNCTOR>::value> | Nested trait declaration for bslma::UsesBslmaAllocator. |
| Name | Description |
|---|---|
operator!= | Return true if the underlying iterators of lhs and rhs are unequal. |
operator+ | Return a copy of iterator advanced by the specified offset. |
operator+ | Return a copy of iterator advanced by the specified offset. |
operator++ | Increment iterator and return a copy of its previous value. |
operator- | Return the distance from the underlying iterator of b to that of a. |
operator- | Return a copy of iterator regressed by the specified offset. |
operator-- | Decrement iterator and return a copy of its previous value. |
operator< | Return true if the underlying iterator of lhs is less than rhs. |
operator<= | Return true if the underlying iterator of lhs is at most that of rhs. |
operator== | Return true if the underlying iterators of lhs and rhs are equal. |
operator> | Return true if the underlying iterator of lhs is greater than rhs. |
operator>= | Return true if the underlying iterator of lhs is at least that of rhs. |
swap | Efficiently exchange the values of the specified a and b objects by applying swap to each of the functor and underlying iterator fields of the two objects. |