Support Class Library
A set of tools providing classes and utility
Namespaces | Functions
scl::stream::operators Namespace Reference

Namespace for intermediate operations on streams (lazy) More...

Namespaces

 details
 Namespace for implementation details of operators.
 

Functions

template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::decay_t< scl::tools::meta ::arg_t<Fn, 0>>>
details::filter_toolbox< T > filter (F &&predicate)
 Filter a stream. More...
 
template<class T >
details::filter_toolbox< T > filter_ (typename details::filter_toolbox< T >::pred_t pred)
 Filter a stream by explicitly giving the type arguments. More...
 
template<class T >
Stream< T > operator| (const Stream< T > &lhs, const details::filter_toolbox< T > &rhs)
 Pipe operator overload for filter operations. More...
 
template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::decay_t< scl::tools::meta ::arg_t<Fn, 0>>, class U = scl::tools::meta ::decay_t< scl::tools::meta ::return_t<Fn>>>
details::map_toolbox< T, U > map (F &&mapper)
 Map a stream. More...
 
template<class T , class U = T>
details::map_toolbox< T, U > map_ (typename details::map_toolbox< T, U >::mapper_t mapper)
 Map a stream by explicitly providing the type arguments. More...
 
template<class T , class U >
Stream< U > operator| (const Stream< T > &lhs, const details::map_toolbox< T, U > &rhs)
 Pipe operator overload for map toolbox tags. More...
 
details::unique_toolbox unique ()
 Remove duplicates from a stream. More...
 
template<class T , class U >
Stream< T > operator| (const Stream< T > &lhs, details::unique_toolbox rhs)
 Pipe operator overload for unique operations. More...
 
template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::decay_t< scl::tools::meta ::arg_t<Fn, 0>>, class U = scl::tools::meta ::decay_t< scl::tools::meta ::return_t<Fn>>>
details::uniqueBy_toolbox< T, U > uniqueBy (F &&mapper)
 Remove duplicates from a stream. More...
 
template<class T , class U >
details::uniqueBy_toolbox< T, U > uniqueBy_ (typename details::uniqueBy_toolbox< T, U >::map_t mapper)
 Remove duplicates from a stream by explicitly providing the type arguments. More...
 
template<class T , class U >
Stream< T > operator| (const Stream< T > &lhs, details::uniqueBy_toolbox< T, U > rhs)
 Pipe operator overload for uniqueBy (and unique) operations. More...
 

Detailed Description

Namespace for intermediate operations on streams (lazy)

Function Documentation

◆ filter()

template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::decay_t< scl::tools::meta ::arg_t<Fn, 0>>>
details::filter_toolbox<T> scl::stream::operators::filter ( F &&  predicate)

Filter a stream.

Template Parameters
Fbeing the type of the callable (deduced)
Fnbeing the function wrapper type (computed)
Tbeing the value type (computed)
Parameters
predicatebeing the predicate to use
Returns
a filter toolbox tag for pipe operator

Definition at line 94 of file filter.h.

◆ filter_()

template<class T >
details::filter_toolbox<T> scl::stream::operators::filter_ ( typename details::filter_toolbox< T >::pred_t  pred)

Filter a stream by explicitly giving the type arguments.

Template Parameters
Tbeing the value type
Parameters
predbeing the predicate to use for filtering
Returns
a filter toolbox tag for pipe operator

Definition at line 105 of file filter.h.

◆ map()

template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::decay_t< scl::tools::meta ::arg_t<Fn, 0>>, class U = scl::tools::meta ::decay_t< scl::tools::meta ::return_t<Fn>>>
details::map_toolbox<T, U> scl::stream::operators::map ( F &&  mapper)

Map a stream.

Template Parameters
Fbeing the type of the callable (deduced)
Fnbeing the function wrapper type (computed)
Tbeing the type to map from (computed)
Ubeing the type to map to (computed)
Parameters
mapperbeing the callable used to map values
Returns
a toolbox tag for pipe operators

Definition at line 97 of file map.h.

◆ map_()

template<class T , class U = T>
details::map_toolbox<T, U> scl::stream::operators::map_ ( typename details::map_toolbox< T, U >::mapper_t  mapper)

Map a stream by explicitly providing the type arguments.

Template Parameters
Tbeing the type to map from
Ubeing the type to map to
Parameters
mapperbeing the mapper function
Returns
the toolbox tag for pipe operators

Definition at line 109 of file map.h.

◆ operator|() [1/4]

template<class T , class U >
Stream<T> scl::stream::operators::operator| ( const Stream< T > &  lhs,
details::unique_toolbox  rhs 
)

Pipe operator overload for unique operations.

Template Parameters
Tbeing the value type
Ubeing the key type
Parameters
lhsbeing the stream to remove duplicates from
rhsbeing the unique toolbox tag

Definition at line 31 of file unique.h.

◆ operator|() [2/4]

template<class T >
Stream<T> scl::stream::operators::operator| ( const Stream< T > &  lhs,
const details::filter_toolbox< T > &  rhs 
)

Pipe operator overload for filter operations.

Template Parameters
Tbeing the value type
Parameters
lhsbeing the stream to filter
rhsbeing the filter toolbox tag
Returns
The filtered stream

Definition at line 117 of file filter.h.

◆ operator|() [3/4]

template<class T , class U >
Stream<U> scl::stream::operators::operator| ( const Stream< T > &  lhs,
const details::map_toolbox< T, U > &  rhs 
)

Pipe operator overload for map toolbox tags.

Template Parameters
Tbeing the type to map from
Ubeing the type to map to
Returns
The mapped stream

Definition at line 120 of file map.h.

◆ operator|() [4/4]

template<class T , class U >
Stream<T> scl::stream::operators::operator| ( const Stream< T > &  lhs,
details::uniqueBy_toolbox< T, U >  rhs 
)

Pipe operator overload for uniqueBy (and unique) operations.

Template Parameters
Tbeing the value type
Ubeing the key type
Parameters
lhsbeing the stream to remove duplicates from
rhsbeing the unique toolbox tag

Definition at line 148 of file uniqueBy.h.

◆ unique()

details::unique_toolbox scl::stream::operators::unique ( )

Remove duplicates from a stream.

Returns
a toolbox tag for pipe operator

Definition at line 19 of file unique.h.

◆ uniqueBy()

template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::decay_t< scl::tools::meta ::arg_t<Fn, 0>>, class U = scl::tools::meta ::decay_t< scl::tools::meta ::return_t<Fn>>>
details::uniqueBy_toolbox<T, U> scl::stream::operators::uniqueBy ( F &&  mapper)

Remove duplicates from a stream.

Template Parameters
Fbeing the callable type (deduce)
Fnbeing the function wrapper type (computed)
Tbeing the value type (computed)
Ubeing the key type (computed)
Parameters
mapperbeing the key computation function
Returns
a toolbox tag for pipe operator

Definition at line 124 of file uniqueBy.h.

◆ uniqueBy_()

template<class T , class U >
details::uniqueBy_toolbox<T, U> scl::stream::operators::uniqueBy_ ( typename details::uniqueBy_toolbox< T, U >::map_t  mapper)

Remove duplicates from a stream by explicitly providing the type arguments.

Template Parameters
Tbeing the value type
Ubeing the key type
Parameters
mapperbeing the key computation function
Returns
a toolbox tag for pipe operator

Definition at line 136 of file uniqueBy.h.