Back to Taskflow

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

docs/classtf_1_1Pipe.html

4.0.03.6 KB
Original Source

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

class to create a pipe object for a pipeline stage

Template parameters
C

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() defaulteddefault constructorPipe(PipeType d, C&& callable)constructs the pipe object

Public functions

auto type() const -> PipeTypequeries the type of the pipevoid 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
callable

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

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

assigns a new callable to the pipe

Template parameters
U
Parameters
---
callable

Assigns a new callable to the pipe with universal forwarding.