Name
pipeline Class — Abstract base class that performs pipelined execution.
Synopsis
#include "tbb/pipeline.h" class pipeline;
Description
A pipeline represents the pipelined application of a series of filters to a stream of items. Each filter is parallel or serial. See the filter class for details.
A pipeline contains one or more filters, denoted here as fi, where i denotes the position of the filter in the pipeline. The pipeline starts with filter f0, followed by f1, f2, and so on. The following steps describe how to use the class:
Derive
ficlasses fromfilter. The constructor forfispecifies whether it is serial via the Boolean parameter to the constructor for the base classfilter.Override the virtual method
filter::operator()to perform the filter’s action on the item, and return a pointer to the item to be processed by the next filter. The first filter,f0, generates the stream. It should returnNULLif there are no more items in the stream. The return value for the last filter is ignored.Create an instance of class
pipeline.Create instances of the
fifilters and add them to the pipeline in order from first to last. An instance of a filter can be added once, at most, to a pipeline. A filter should never be a member of more than one pipeline at a time.Call the method
pipeline::run. The parametermax_number_of_live_tokensputs an upper bound on the number of stages that will be run concurrently. Higher values may increase concurrency at the expense of more memory consumption from ...