Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
The graph class. More...
#include <_flow_graph_impl.h>
Classes | |
class | run_and_put_task |
class | run_task |
class | spawn_functor |
A functor that spawns a task. More... | |
class | wait_functor |
Public Types | |
typedef graph_iterator< graph, graph_node > | iterator |
typedef graph_iterator< const graph, const graph_node > | const_iterator |
Public Member Functions | |
graph () | |
Constructs a graph with isolated task_group_context. More... | |
graph (tbb::task_group_context &use_this_context) | |
Constructs a graph with use_this_context as context. More... | |
~graph () | |
Destroys the graph. More... | |
void | increment_wait_count () |
void | decrement_wait_count () |
void | reserve_wait () __TBB_override |
Used to register that an external entity may still interact with the graph. More... | |
void | release_wait () __TBB_override |
Deregisters an external entity that may have interacted with the graph. More... | |
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. More... | |
template<typename Body > | |
void | run (Body body) |
Spawns a task that runs a function object. More... | |
void | wait_for_all () |
Wait until graph is idle and decrement_wait_count calls equals increment_wait_count calls. More... | |
tbb::task * | root_task () |
Returns the root task of the graph. More... | |
iterator | begin () |
start iterator More... | |
iterator | end () |
end iterator More... | |
const_iterator | begin () const |
start const iterator More... | |
const_iterator | end () const |
end const iterator More... | |
const_iterator | cbegin () const |
start const iterator More... | |
const_iterator | cend () const |
end const iterator More... | |
bool | is_cancelled () |
return status of graph execution More... | |
bool | exception_thrown () |
void | reset (reset_flags f=rf_reset_protocol) |
![]() | |
virtual | ~graph_proxy () |
Private Types | |
typedef std::list< tbb::task * > | task_list_type |
Private Member Functions | |
void | prepare_task_arena (bool reinit=false) |
void | register_node (graph_node *n) |
void | remove_node (graph_node *n) |
![]() | |
no_copy () | |
Allow default construction. More... | |
Friends | |
class | graph_node |
template<typename C , typename N > | |
class | graph_iterator |
template<typename Input , typename Output , typename Policy , typename Allocator > | |
class | async_node |
class | tbb::interface7::internal::task_arena_base |
void | internal::activate_graph (graph &g) |
void | internal::deactivate_graph (graph &g) |
bool | internal::is_graph_active (graph &g) |
void | internal::spawn_in_graph_arena (graph &g, tbb::task &arena_task) |
void | internal::add_task_to_graph_reset_list (graph &g, tbb::task *tp) |
template<typename F > | |
void | internal::execute_in_graph_arena (graph &g, F &f) |
The graph class.
This class serves as a handle to the graph
Definition at line 200 of file _flow_graph_impl.h.
typedef graph_iterator<const graph, const graph_node> tbb::flow::interface10::graph::const_iterator |
Definition at line 367 of file _flow_graph_impl.h.
Definition at line 366 of file _flow_graph_impl.h.
|
private |
Definition at line 235 of file _flow_graph_impl.h.
|
inline |
Constructs a graph with isolated task_group_context.
Definition at line 745 of file flow_graph.h.
|
inlineexplicit |
Constructs a graph with use_this_context as context.
Definition at line 757 of file flow_graph.h.
|
inline |
Destroys the graph.
Calls wait_for_all, then destroys the root task and context.
Definition at line 767 of file flow_graph.h.
References my_root_task, tbb::task::set_ref_count(), and wait_for_all().
|
inline |
start iterator
Definition at line 835 of file flow_graph.h.
Referenced by reset().
|
inline |
start const iterator
Definition at line 839 of file flow_graph.h.
|
inline |
start const iterator
Definition at line 843 of file flow_graph.h.
|
inline |
end const iterator
Definition at line 845 of file flow_graph.h.
|
inline |
Definition at line 288 of file _flow_graph_impl.h.
References release_wait().
|
inline |
end iterator
Definition at line 837 of file flow_graph.h.
Referenced by reset().
|
inline |
end const iterator
Definition at line 841 of file flow_graph.h.
|
inline |
Definition at line 385 of file _flow_graph_impl.h.
References caught_exception.
|
inline |
Definition at line 284 of file _flow_graph_impl.h.
References reserve_wait().
|
inline |
return status of graph execution
Definition at line 384 of file _flow_graph_impl.h.
References cancelled.
|
inlineprivate |
Definition at line 254 of file _flow_graph_impl.h.
References __TBB_ASSERT, tbb::interface7::task_arena::initialize(), tbb::interface7::task_arena::is_active(), my_task_arena, and tbb::interface7::task_arena::terminate().
Referenced by reset().
|
inlineprivate |
Definition at line 789 of file flow_graph.h.
|
inlinevirtual |
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.
Implements tbb::flow::interface10::graph_proxy.
Definition at line 782 of file flow_graph.h.
Referenced by tbb::flow::interface9::gfx_factory::callback(), decrement_wait_count(), and tbb::flow::interface10::async_node< Input, Output, Policy, Allocator >::receiver_gateway_impl::release_wait().
|
inlineprivate |
Definition at line 800 of file flow_graph.h.
|
inlinevirtual |
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.
Implements tbb::flow::interface10::graph_proxy.
Definition at line 775 of file flow_graph.h.
Referenced by increment_wait_count(), tbb::flow::interface10::async_node< Input, Output, Policy, Allocator >::receiver_gateway_impl::reserve_wait(), and tbb::flow::interface9::gfx_factory::send_kernel().
|
inline |
Definition at line 812 of file flow_graph.h.
References tbb::flow::interface10::internal::activate_graph(), begin(), cancelled, caught_exception, tbb::flow::interface10::internal::deactivate_graph(), end(), my_context, my_reset_task_list, prepare_task_arena(), tbb::task_group_context::reset(), tbb::flow::interface10::graph_node::reset_node(), and tbb::flow::interface10::internal::spawn_in_graph_arena().
|
inline |
Returns the root task of the graph.
Definition at line 357 of file _flow_graph_impl.h.
References my_root_task.
Referenced by tbb::flow::interface10::source_node< Output >::create_put_task(), tbb::flow::interface10::limiter_node< T >::forward_task(), tbb::flow::interface10::limiter_node< T >::register_predecessor(), tbb::flow::interface10::limiter_node< T >::register_successor(), run(), and tbb::flow::interface10::limiter_node< T >::try_put_task().
|
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.
Definition at line 306 of file _flow_graph_impl.h.
References tbb::interface7::task_arena::execute(), tbb::flow::interface10::internal::is_graph_active(), my_task_arena, and root_task().
|
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.
Definition at line 318 of file _flow_graph_impl.h.
References tbb::interface7::task_arena::execute(), tbb::flow::interface10::internal::is_graph_active(), my_task_arena, and root_task().
|
inline |
Wait until graph is idle and decrement_wait_count calls equals increment_wait_count calls.
The waiting thread will go off and steal work while it is block in the wait_for_all.
Definition at line 327 of file _flow_graph_impl.h.
References cancelled, caught_exception, tbb::task_group_context::concurrent_wait, tbb::interface7::task_arena::execute(), tbb::task_group_context::is_group_execution_cancelled(), my_context, my_root_task, my_task_arena, tbb::task_group_context::reset(), tbb::task::set_ref_count(), and tbb::task_group_context::traits().
Referenced by ~graph().
|
friend |
Definition at line 419 of file _flow_graph_impl.h.
|
friend |
Definition at line 363 of file _flow_graph_impl.h.
|
friend |
Definition at line 201 of file _flow_graph_impl.h.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 422 of file _flow_graph_impl.h.
|
private |
Definition at line 394 of file _flow_graph_impl.h.
Referenced by is_cancelled(), reset(), and wait_for_all().
|
private |
Definition at line 395 of file _flow_graph_impl.h.
Referenced by exception_thrown(), reset(), and wait_for_all().
|
private |
Definition at line 392 of file _flow_graph_impl.h.
Referenced by reset(), and wait_for_all().
|
private |
Definition at line 396 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::activate_graph(), tbb::flow::interface10::internal::deactivate_graph(), and tbb::flow::interface10::internal::is_graph_active().
|
private |
Definition at line 399 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::function_output< Output >::register_successor().
|
private |
Definition at line 399 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::function_output< Output >::register_successor().
|
private |
Definition at line 408 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::spawn_in_graph_arena().
|
private |
Definition at line 397 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::add_task_to_graph_reset_list(), and reset().
|
private |
Definition at line 391 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::key_matching_port< TraitsType >::key_matching_port(), root_task(), wait_for_all(), and ~graph().
|
private |
Definition at line 405 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::execute_in_graph_arena(), prepare_task_arena(), run(), and wait_for_all().
|
private |
Definition at line 401 of file _flow_graph_impl.h.
Referenced by tbb::flow::interface10::internal::function_output< Output >::register_successor(), and tbb::flow::interface10::internal::key_matching_port< TraitsType >::set_join_node_pointer().
|
private |
Definition at line 393 of file _flow_graph_impl.h.