classPiiFilteredIterator
#include <PiiIterator.h>
An iterator that picks selected elements out of another iterator.
Description
PiiFilteredIterator is initialized with two ranges of equal length: the range to be filtered an the filter. When advanced, PiiFilteredIterator steps over items whose corresponding element in the filter range is zero.
Public types
|
typedef std::iterator_traits< Iterator >::difference_type
|
|
|
typedef std::iterator_traits< Iterator >::iterator_category
|
|
|
typedef Pii::If<
bConst, const value_type *, value_type * >::Type
|
|
|
typedef Pii::If<
bConst, const value_type &, value_type & >::Type
|
|
|
typedef std::iterator_traits< Iterator >::value_type
|
Constructors and destructor
|
(
Constructs a new filtered iterator that works in the range [begin, end). |
|
|
(
Constructs a new filtered iterator that works in the range [begin, end). |
|
|
Constructs a copy of other. |
Public member functions
|
Iterator
|
( )
|
|
Iterator
|
( )
|
|
Iterator
|
( )
|
|
FilterIterator
|
( )
|
|
bool
|
Returns |
|
value_type
|
( )
Returns the current value of |
|
reference
|
( )
|
|
( )
Increments |
|
|
(
Increments both |
|
|
(
Moves both iterators forwards i elements. |
|
|
(
Decrements both |
|
|
( )
Decrements |
|
|
(
Moves both iterators backwards i elements. |
|
|
bool
|
|
|
bool
|
|
|
Copies other and returns a reference to |
|
|
bool
|
Returns |
|
bool
|
|
|
bool
|
|
|
(
Returns a new PiiFilteredIterator that is initialized with
|
|
|
template<class Iterator, class FilterIterator>
PiiFilteredIterator<
Iterator, FilterIterator >
|
(
Create an iterator that accesses the elements in the range [begin, end) that match filter. |
|
template<class Iterator, class FilterIterator>
PiiFilteredIterator<
Iterator, FilterIterator >
|
(
Create an iterator that accesses the elements in the range [begin, end) that match filter. |
Function details
-
PiiFilteredIterator
(- const Iterator & begin
- const Iterator & end
- const FilterIterator & filter
[inline]Constructs a new filtered iterator that works in the range [begin, end).
The start of the filter range is filter. The current item is set to the first item in the range whose corresponding element in filter is non-zero.
-
PiiFilteredIterator
(- const Iterator & begin
- const Iterator & end
- const Iterator & current
- const FilterIterator & filter
[inline]Constructs a new filtered iterator that works in the range [begin, end).
The start of the filter range is filter. The current item is placed at current, which must be within the range.
-
Constructs a copy of other.
-
Iterator begin
()[inline] -
Iterator current
()[inline] -
Iterator end
()[inline] -
FilterIterator filter
()[inline] -
Returns
falseif theiteratormembers ofthisand other are equal, andtrueotherwise. -
value_type operator*
()[inline]Returns the current value of
iterator. -
reference operator*
()[inline]This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
Increments
iteratorandfilteruntil*filteris non-zero.Returns a reference to
this. -
Increments both
iteratorandfilter.Returns a copy of
this. -
Moves both iterators forwards i elements.
Returns a reference to
this. -
Decrements both
iteratorandfilter.Returns a copy of
this. -
Decrements
iteratorandfilteruntil*filteris non-zero.Returns a reference to
this. -
Moves both iterators backwards i elements.
Returns a reference to
this. -
[inline]
-
-
Copies other and returns a reference to
this. -
Returns
trueif theiteratormembers ofthisand other are equal, andfalseotherwise. -
-
-
Returns a new PiiFilteredIterator that is initialized with
iterator[index] andfilter[index]. -
template<class Iterator, class FilterIterator>
PiiFilteredIterator< Iterator, FilterIterator > filteredIterator
(- Iterator begin
- Iterator end
- FilterIterator filter
Create an iterator that accesses the elements in the range [begin, end) that match filter.
The iterator will be initially moved to the first element matching the filter.
-
template<class Iterator, class FilterIterator>
PiiFilteredIterator< Iterator, FilterIterator > filteredIterator
(- Iterator begin
- Iterator end
- Iterator current
- FilterIterator filter
Create an iterator that accesses the elements in the range [begin, end) that match filter.
The iterator will be initially placed at current.
Add a note
Not a single note added yet. Be the first, add yours.