OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
FilterIterator< InputIterator, UnaryPredicate >

#include <FilterIterator.hpp>

Public Member Functions

 FilterIterator (InputIterator first, InputIterator last, UnaryPredicate pred)
 
bool operator!= (const FilterIterator &it)
 
bool operator== (const FilterIterator &it)
 
InputIterator operator* ()
 
FilterIterator operator++ ()
 
FilterIterator begin () const
 
FilterIterator end () const
 

Detailed Description

template<class InputIterator, class UnaryPredicate>
class focs::FilterIterator< InputIterator, UnaryPredicate >

Iterator for filtering the results of other iterators.

This class shouldn't be used by external users. Its API is very odd and cumbersome and should/will probably be made better. As of writing this documentation, it's only used for focs::KvStore for filtering values via group.

Template Parameters
InputIteratorThe type of iterator to walk through.
UnaryPredicateFunction with which to filter values.

Example

Definition at line 27 of file FilterIterator.hpp.

Constructor & Destructor Documentation

◆ FilterIterator()

FilterIterator ( InputIterator  first,
InputIterator  last,
UnaryPredicate  pred 
)
inline

Sole and cumbersome constructor.

Parameters
firstCollection's begin() iterator.
lastCollection's end() iterator.
predFunction with which to filter, generally a lambda. It should take a single value of the type stored in the collection and return a boolean.

Definition at line 37 of file FilterIterator.hpp.

Member Function Documentation

◆ begin()

FilterIterator begin ( ) const
inline

Return a copy of the iterator reset back to the start.

Definition at line 73 of file FilterIterator.hpp.

◆ end()

FilterIterator end ( ) const
inline

Return an iterator with no values left to check.

Definition at line 75 of file FilterIterator.hpp.

◆ operator!=()

bool operator!= ( const FilterIterator< InputIterator, UnaryPredicate > &  it)
inline

Check if the underlying iterators are not equal.

Definition at line 47 of file FilterIterator.hpp.

◆ operator*()

InputIterator operator* ( )
inline

Return the underlying iterator.

Definition at line 57 of file FilterIterator.hpp.

◆ operator++()

FilterIterator operator++ ( )
inline

Find the next value that fulfills the UnaryPredicate's condition, or return end().

Definition at line 62 of file FilterIterator.hpp.

◆ operator==()

bool operator== ( const FilterIterator< InputIterator, UnaryPredicate > &  it)
inline

Check if the underlying iterators are equal.

Definition at line 52 of file FilterIterator.hpp.


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