Taskflow  3.2.0-Master-Branch
Loading...
Searching...
No Matches
tf::Pipe< C > Class Template Reference

class to create a pipe object for a pipeline stage More...

#include <pipeline.hpp>

Public Types

using callable_t = C
 alias of the callable type
 

Public Member Functions

 Pipe ()=default
 default constructor
 
 Pipe (PipeType d, C &&callable)
 constructs the pipe object
 
PipeType type () const
 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
 

Friends

template<typename... Ps>
class Pipeline
 
template<typename P >
class ScalablePipeline
 

Detailed Description

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

class to create a pipe object for a pipeline stage

Template Parameters
Ccallable 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 tf::Pipeflow object in reference:

class to create a pipe object for a pipeline stage
Definition pipeline.hpp:136
class to create a pipeflow object used by the pipe callable
Definition pipeline.hpp:42
@ SERIAL
serial type

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

Constructor & Destructor Documentation

◆ Pipe()

template<typename C = std::function<void(tf::Pipeflow&)>>
tf::Pipe< C >::Pipe ( PipeType  d,
C &&  callable 
)
inline

constructs the pipe object

Parameters
dpipe type (tf::PipeType)
callablecallable type

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

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

Member Function Documentation

◆ callable()

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

assigns a new callable to the pipe

Template Parameters
Ucallable type
Parameters
callablea callable object constructible from std::function<void(tf::Pipeflow&)>

Assigns a new callable to the pipe with universal forwarding.

◆ type() [1/2]

template<typename C = std::function<void(tf::Pipeflow&)>>
PipeType tf::Pipe< C >::type ( ) const
inline

queries the type of the pipe

Returns the type of the callable.

◆ type() [2/2]

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

assigns a new type to the pipe

Parameters
typea tf::PipeType variable

The documentation for this class was generated from the following file: