Back to Taskflow

Taskflow: A General

docs/classtf_1_1Pipe.html

4.1.05.8 KB
Original Source

| | Taskflow: A General-purpose Task-parallel Programming System |

Loading...

Searching...

No Matches

Public Types | Public Member Functions | Friends | List of all members

tf::Pipe< C > Class Template Reference

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

#include <taskflow/algorithm/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

| 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::Pipe::Pipe

Pipe()=default

default constructor

tf::Pipeflow

class to create a pipeflow object used by the pipe callable

Definition pipeline.hpp:43

tf::PipeType::SERIAL

@ SERIAL

serial type

Definition pipeline.hpp:117

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

| 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, {}}

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

| 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.

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

| type | a tf::PipeType variable |


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