Classes | Public Types | Public Member Functions | Friends | List of all members
tbb::flow::interface10::graph Class Reference

The graph class. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface10::graph:
tbb::flow::interface10::graph_proxy

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.
 
 graph (task_group_context &use_this_context)
 Constructs a graph with use_this_context as context.
 
 ~graph ()
 Destroys the graph. More...
 
void set_name (const char *name)
 
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...
 
task * root_task ()
 Returns the root task of the graph.
 
iterator begin ()
 start iterator
 
iterator end ()
 end iterator
 
const_iterator begin () const
 start const iterator
 
const_iterator end () const
 end const iterator
 
const_iterator cbegin () const
 start const iterator
 
const_iterator cend () const
 end const iterator
 
bool is_cancelled ()
 return status of graph execution
 
bool exception_thrown ()
 
void reset (reset_flags f=rf_reset_protocol)
 

Friends

class graph_node
 
template<typename C , typename N >
class graph_iterator
 
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, task *tp)
 
template<typename F >
void internal::execute_in_graph_arena (graph &g, F &f)
 

Detailed Description

The graph class.

This class serves as a handle to the graph

Constructor & Destructor Documentation

tbb::flow::interface10::graph::~graph ( )
inline

Destroys the graph.

Calls wait_for_all, then destroys the root task and context.

References wait_for_all().

Member Function Documentation

void tbb::flow::interface10::graph::release_wait ( )
virtual

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.

void tbb::flow::interface10::graph::reserve_wait ( )
virtual

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.

template<typename Receiver , typename Body >
void tbb::flow::interface10::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.

References root_task().

template<typename Body >
void tbb::flow::interface10::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.

References root_task().

void tbb::flow::interface10::graph::wait_for_all ( )
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.

Referenced by ~graph().


The documentation for this class was generated from the following file:

Copyright © 2005-2017 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.