tf::Pipe class | Taskflow QuickStart

#
template<typename C = std::function<void(tf::Pipeflow&)>>
tf::Pipe class

class to create a pipe object for a pipeline stage

Template parameters
C | callable type

A pipe represents a stage of a pipeline. A pipe can be either parallel direction or serial direction (specified by tf::PipeType) and is coupled with a callable to invoke by the pipeline scheduler. The callable must take a referenced tf::Pipeflow object in the first argument:

    Pipe{PipeType::SERIAL, [](tf::Pipeflow&){}}

The pipeflow object is used to query the statistics of a scheduling token in the pipeline, such as pipe, line, and token numbers.

## Public types

using callable_t = C
  alias of the callable type

## Constructors, destructors, conversion operators

Pipe() defaulted
  default constructor
Pipe(PipeType d, C&& callable)
  constructs the pipe object

## Public functions

auto type() const -> PipeType
  queries the type of the pipe
void type(PipeType type)
  assigns a new type to the pipe
template<typename U>
void callable(U&& callable)
  assigns a new callable to the pipe

## Function documentation

###
template<typename C>
tf::Pipe<C>::Pipe(PipeType d, C&& callable)

constructs the pipe object

Parameters
d | pipe type (tf::PipeType)
callable | callable type

The constructor constructs a pipe with the given direction (tf::PipeType::SERIAL or tf::PipeType::PARALLEL) and the given callable. The callable must take a referenced tf::Pipeflow object in the first argument.

    Pipe{PipeType::SERIAL, [](tf::Pipeflow&){}}

When creating a pipeline, the direction of the first pipe must be serial (tf::PipeType::SERIAL).

###
template<typename C>
PipeType tf::Pipe<C>::type() const

queries the type of the pipe

Returns the type of the callable.

###
template<typename C>
void tf::Pipe<C>::type(PipeType type)

assigns a new type to the pipe

Parameters
type | a tf::PipeType variable

###
template<typename C> template<typename U>
void tf::Pipe<C>::callable(U&& callable)

assigns a new callable to the pipe

Template parameters
U | callable type
Parameters
callable | a callable object constructible from std::function<void(tf::Pipeflow&)>

Assigns a new callable to the pipe with universal forwarding.

Tab / T to search, Esc to close
…

Search for symbols, directories, files, pages or modules. You can omit any prefix from the symbol or file path; adding a `:` or `/` suffix lists all members of given symbol or directory.

Use ↓ / ↑ to navigate through the list, Enter to go. Tab autocompletes common prefix, you can copy a link to the result using ⌘ L while ⌘ M produces a Markdown link.

Sorry, nothing was found.