graph¶
[flow_graph.graph]
Class that serves as a handle to a flow graph of nodes and edges.
// Defined in header <tbb/flow_graph.h>
namespace tbb {
namespace flow {
class graph {
public:
graph();
graph(task_group_context& context);
~graph();
void wait_for_all();
bool is_cancelled();
bool exception_thrown();
void reset(reset_flags f = rf_reset_protocol);
};
} // namespace flow
} // namespace tbb
reset_flags enumeration¶
Member functions¶
-
graph(task_group_context &group)¶ Constructs a graph with no nodes. If
groupis specified the graph tasks are executed in this group. By default the graph is executed in a bound context of its own.
-
~graph()¶ Calls
wait_for_allon the graph, then destroys the graph.
-
void
wait_for_all()¶ Blocks until all tasks associated with the graph have completed.
-
void
reset(reset_flags f = rf_reset_protocol)¶ Reset the graph regards to specified flags. Flags to
reset()can be combined with bitwise-or.
-
bool
is_cancelled()¶ Returns:
trueif the graph was cancelled during the last call towait_for_all(),falseotherwise.
-
bool
exception_thrown()¶ Returns:
trueif during the last call towait_for_all()an exception was thrown,falseotherwise.