ORIGINAL
|
Pipe adapter for generator operations to enable fluent chaining. More...
#include <generators.h>
Friends | |
template<typename TYPE , typename F > | |
auto | operator| (coroutine::generator< TYPE > gen, genPipe< F > p) |
Pipe operator for generator operations. | |
template<typename T , typename U > | |
auto | join (coroutine::generator< T > gen2) |
template<typename T , typename U > | |
auto | flatten () |
Creates a flatten pipe operation. | |
template<typename F > | |
auto | transforms (F &&f) |
Creates a transform pipe operation. | |
template<typename F > | |
auto | filters (F &&f) |
Creates a filter pipe operation. | |
template<typename F > | |
auto | extract (F &&f) |
Creates an extract pipe operation. | |
template<typename > | |
auto | enumerate () |
Creates an enumerate pipe operation. | |
template<typename > | |
auto | take (u_integer n) |
Creates a take pipe operation. | |
template<typename > | |
auto | skip (u_integer n) |
Creates a skip pipe operation. | |
template<typename F > | |
auto | zipWith (coroutine::generator< F > gen2) |
template<typename > | |
auto | count () |
Creates a count pipe operation. | |
template<typename F > | |
auto | count (F &&f) |
Creates a conditional count pipe operation. | |
template<typename F > | |
auto | all (F &&f) |
Creates an all-match pipe operation. | |
template<typename F > | |
auto | none (F &&f) |
Creates a none-match pipe operation. | |
template<typename F > | |
auto | any (F &&f) |
Creates an any-match pipe operation. | |
template<typename F > | |
auto | position (F &&f) |
Creates a position-finding pipe operation. | |
template<typename F > | |
auto | find (F &&f) |
Creates an element-finding pipe operation. | |
Pipe adapter for generator operations to enable fluent chaining.
Callback | The operation to be applied in the pipe. |
This class enables the use of the pipe operator (|) for generator operations, allowing for fluent and readable generator pipelines.
The genPipe wraps generator operations so they can be composed using the pipe operator, creating expressive data processing pipelines.
Example usage:
Creates an all-match pipe operation.
F | The predicate function type. |
f | The validation predicate. |
Factory function for creating all-match operations.
Creates an any-match pipe operation.
F | The predicate function type. |
f | The existence predicate. |
Factory function for creating any-match operations.
Creates a count pipe operation.
Factory function for creating count operations that can be used with the pipe operator.
Creates a conditional count pipe operation.
F | The predicate function type. |
f | The counting predicate. |
Factory function for creating conditional count operations.
Creates an enumerate pipe operation.
Factory function for creating enumerate operations that can be used with the pipe operator.
Creates an extract pipe operation.
F | The predicate function type. |
f | The exclusion predicate. |
Factory function for creating extract operations that can be used with the pipe operator.
Creates a filter pipe operation.
F | The predicate function type. |
f | The filter predicate. |
Factory function for creating filter operations that can be used with the pipe operator.
Creates an element-finding pipe operation.
F | The predicate function type. |
f | The search predicate. |
Factory function for creating element-finding operations.
Creates a flatten pipe operation.
T | The first element type in couples. |
U | The second element type in couples. |
Factory function for creating flatten operations that can be used with the pipe operator.
Creates a none-match pipe operation.
F | The predicate function type. |
f | The exclusion predicate. |
Factory function for creating none-match operations.
Pipe operator for generator operations.
TYPE | The generator element type. |
F | The pipe operation type. |
gen | The source generator. |
p | The pipe operation to apply. |
Enables fluent chaining of generator operations using the | operator.
Example:
Creates a position-finding pipe operation.
F | The predicate function type. |
f | The search predicate. |
Factory function for creating position-finding operations.
Creates a skip pipe operation.
n | Number of elements to skip. |
Factory function for creating skip operations that can be used with the pipe operator.
Creates a take pipe operation.
n | Number of elements to take. |
Factory function for creating take operations that can be used with the pipe operator.
Creates a transform pipe operation.
F | The transformation function type. |
f | The transformation function. |
Factory function for creating transform operations that can be used with the pipe operator.
Example: