DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
docwire::chaining Namespace Reference

Provides functionality for chaining function calls and value transformations. More...

Classes

struct  value_to_function_binding
 Binds a value to a function, enabling the creation of a function call chain. More...
 
struct  function_to_function_binding
 Binds a function to a function, enabling the creation of a function call chain. More...
 
struct  function_to_pushable_binding
 Binds a function to a pushable, enabling the creation of a function call chain. More...
 

Functions

template<invocation_concepts::not_invocable V, invocation_concepts::invocable F>
auto operator| (V &&value, F &&function)
 Binds a value to a function, enabling the creation of a function call chain. More...
 
template<invocation_concepts::invocable F1, invocation_concepts::invocable F2>
auto operator| (F1 &&function1, F2 &&function2)
 Binds a function to a function, enabling the creation of a function call chain. More...
 
template<invocation_concepts::invocable F, invocation_concepts::pushable C>
auto operator| (F &&function, C &&container)
 Binds a function to a pushable, enabling the creation of a function call chain. More...
 

Detailed Description

Provides functionality for chaining function calls and value transformations.

This namespace contains classes and functions that enable the creation of chains of function calls, allowing for the transformation of values in a flexible and composable way.

Function Documentation

◆ operator|() [1/3]

template<invocation_concepts::invocable F, invocation_concepts::pushable C>
auto docwire::chaining::operator| ( F &&  function,
C &&  container 
)

Binds a function to a pushable, enabling the creation of a function call chain.

This function template takes two type parameters: F (the function type) and C (the pushable type). It creates a function_to_pushable_binding object that allows the bound function to be called with specified arguments and the pushable push_back method as a callback.

If the created function has no arguments, it is immediately called.

Parameters
functionThe function to be bound.
containerThe pushable to be bound.
Returns
A function_to_pushable_binding object that allows the bound function to be called with the pushable push_back method as a callback or invocation result if the function was immediately called.
See also
function_to_pushable_binding
docwire::invocation_concepts::invocable
docwire::invocation_concepts::pushable

Definition at line 265 of file chaining.h.

◆ operator|() [2/3]

template<invocation_concepts::invocable F1, invocation_concepts::invocable F2>
auto docwire::chaining::operator| ( F1 &&  function1,
F2 &&  function2 
)

Binds a function to a function, enabling the creation of a function call chain.

This function template takes two type parameters: F1 and F2 (the function types). It creates a function_to_function_binding object that allows the first function to be called with specified arguments and the second function as a callback.

If the created function has no arguments, it is immediately called.

Parameters
function1The first function to be bound.
function2The second function to be bound.
Returns
A function_to_function_binding object that allows the first function to be called with the second function as a callback or invocation result if the function was immediately called..
See also
function_to_function_binding
docwire::invocation_concepts::invocable

Definition at line 184 of file chaining.h.

◆ operator|() [3/3]

template<invocation_concepts::not_invocable V, invocation_concepts::invocable F>
auto docwire::chaining::operator| ( V &&  value,
F &&  function 
)

Binds a value to a function, enabling the creation of a function call chain.

This function template takes two type parameters: V and F (the value and function types). It creates a value_to_function_binding object that allows the bound function to be called with the bound value and additional arguments.

If the created function has no arguments, it is immediately called.

Parameters
valueThe value to be bound.
functionThe function to be bound.
Returns
A value_to_function_binding object that allows the bound function to be called with the bound value or invocation result if the function was immediately called..
See also
value_to_function_binding
docwire::invocation_concepts::non_invocable
docwire::invocation_concepts::invocable

Definition at line 91 of file chaining.h.