===== FastFlow (simple) pipeline =====
First of all,
#include
and possibly
using namespace ff;
Pipelines may be created creating an **ff_pipeline** object:
ff_pipeline myPipe;
Stages may be added using the **add_stage(ff_node*)** (in order).
myPipe.add_stage(stage1);
myPipe.add_stage(stage2);
A pipeline with all the stages added may be run by invoking the **run_and_wait_end()** method:
myPipe.run_and_wait_end();
Each stage returns:
* a pointer to a task (in case it wants to pass a result)
* a NULL pointer (in case it wants to terminate)
* a GO_ON constant (in case it does not terminate but wants to go waiting for a new task without actually delivering a result)
The values may returned with a **return** or (in any part of the code) via a **ff_send_out(...)** call (may be called multiple times in a stage)