#include <flow_graph.h>
Public Member Functions | |
| graph () | |
| Constructs a graph withy no nodes. | |
| ~graph () | |
| Destroys the graph. | |
| void | increment_wait_count () |
| Used to register that an external entity may still interact with the graph. | |
| void | decrement_wait_count () |
| Deregisters an external entity that may have interacted with the graph. | |
| template<typename Receiver, typename Body> | |
| void | run (Receiver &r, Body body) |
| Spawns a task that runs a body and puts its output to a specific receiver. | |
| template<typename Body> | |
| void | run (Body body) |
| Spawns a task that runs a function object. | |
| void | wait_for_all () |
| Waits until the graph is idle and the number of decrement_wait_count calls equals the number of increment_wait_count calls. | |
| task * | root_task () |
| Returns the root task of the graph. | |
Classes | |
| class | run_and_put_task |
| class | run_task |
This class serves as a handle to the graph
| tbb::flow::interface6::graph::~graph | ( | ) | [inline] |
Destroys the graph.
Calls wait_for_all on the graph, deletes all of the nodes appended by calls to add, and then destroys the root task of the graph.
| void tbb::flow::interface6::graph::decrement_wait_count | ( | ) | [inline] |
Deregisters an external entity that may have interacted with the graph.
The graph will not return from wait_for_all until all the number of decrement_wait_count calls matches the number of increment_wait_count calls.
| void tbb::flow::interface6::graph::increment_wait_count | ( | ) | [inline] |
Used to register that an external entity may still interact with the graph.
The graph will not return from wait_for_all until a matching number of decrement_wait_count calls is made.
| void tbb::flow::interface6::graph::run | ( | Body | body | ) | [inline] |
Spawns a task that runs a function object.
The task is spawned as a child of the graph. This is useful for running tasks that need to block a wait_for_all() on the graph. For example a one-off source.
| void tbb::flow::interface6::graph::run | ( | Receiver & | r, | |
| Body | body | |||
| ) | [inline] |
Spawns a task that runs a body and puts its output to a specific receiver.
The task is spawned as a child of the graph. This is useful for running tasks that need to block a wait_for_all() on the graph. For example a one-off source.
| void tbb::flow::interface6::graph::wait_for_all | ( | ) | [inline] |
Waits until the graph is idle and the number of decrement_wait_count calls equals the number of increment_wait_count calls.
The waiting thread will go off and steal work while it is block in the wait_for_all.