flow_graph.h
Go to the documentation of this file.
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef __TBB_flow_graph_H
#define __TBB_flow_graph_H
#define __TBB_flow_graph_H_include_area
#include "internal/_warning_suppress_enable_notice.h"
#include "tbb_stddef.h"
#include "atomic.h"
#include "spin_mutex.h"
#include "null_mutex.h"
#include "spin_rw_mutex.h"
#include "null_rw_mutex.h"
#include "task.h"
#include "cache_aligned_allocator.h"
#include "tbb_exception.h"
#include "internal/_template_helpers.h"
#include "internal/_aggregator_impl.h"
#include "tbb_profiling.h"
#include "task_arena.h"
#if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ )
#if __INTEL_COMPILER
// Disabled warning "routine is both inline and noinline"
#pragma warning (push)
#pragma warning( disable: 2196 )
#endif
#define __TBB_NOINLINE_SYM __attribute__((noinline))
#else
#define __TBB_NOINLINE_SYM
#endif
#if __TBB_PREVIEW_ASYNC_MSG
#include <vector> // std::vector in internal::async_storage
#include <memory> // std::shared_ptr in async_msg
#endif
#if __TBB_PREVIEW_STREAMING_NODE
// For streaming_node
#include <array> // std::array
#include <unordered_map> // std::unordered_map
#include <type_traits> // std::decay, std::true_type, std::false_type
#endif // __TBB_PREVIEW_STREAMING_NODE
#if TBB_DEPRECATED_FLOW_ENQUEUE
#define FLOW_SPAWN(a) tbb::task::enqueue((a))
#else
#define FLOW_SPAWN(a) tbb::task::spawn((a))
#endif
// use the VC10 or gcc version of tuple if it is available.
#if __TBB_CPP11_TUPLE_PRESENT
#include <tuple>
namespace tbb {
namespace flow {
using std::tuple;
using std::tuple_size;
using std::tuple_element;
using std::get;
}
}
#else
#include "compat/tuple"
#endif
#include<list>
#include<queue>
namespace tbb {
namespace flow {
enum concurrency { unlimited = 0, serial = 1 };
namespace interface11 {
struct null_type {};
class continue_msg {};
template< typename T > class sender;
template< typename T > class receiver;
class continue_receiver;
template< typename T, typename U > class limiter_node; // needed for resetting decrementer
template< typename R, typename B > class run_and_put_task;
namespace internal {
template<typename T, typename M> class successor_cache;
template<typename T, typename M> class broadcast_cache;
template<typename T, typename M> class round_robin_cache;
template<typename T, typename M> class predecessor_cache;
template<typename T, typename M> class reservable_predecessor_cache;
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
namespace order {
struct following;
struct preceding;
}
template<typename Order, typename... Args> struct node_set;
#endif
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
// Holder of edges both for caches and for those nodes which do not have predecessor caches.
// C == receiver< ... > or sender< ... >, depending.
template<typename C>
class edge_container {
public:
typedef std::list<C *, tbb::tbb_allocator<C *> > edge_list_type;
void add_edge(C &s) {
built_edges.push_back(&s);
}
void delete_edge(C &s) {
for (typename edge_list_type::iterator i = built_edges.begin(); i != built_edges.end(); ++i) {
if (*i == &s) {
(void)built_edges.erase(i);
return; // only remove one predecessor per request
}
}
}
void copy_edges(edge_list_type &v) {
v = built_edges;
}
size_t edge_count() {
return (size_t)(built_edges.size());
}
void clear() {
built_edges.clear();
}
// methods remove the statement from all predecessors/successors liste in the edge
// container.
template< typename S > void sender_extract(S &s);
template< typename R > void receiver_extract(R &r);
private:
edge_list_type built_edges;
}; // class edge_container
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
} // namespace internal
} // namespace interfaceX
} // namespace flow
} // namespace tbb
#include "internal/_flow_graph_impl.h"
namespace tbb {
namespace flow {
namespace interface11 {
// enqueue left task if necessary. Returns the non-enqueued task if there is one.
static inline tbb::task *combine_tasks(graph& g, tbb::task * left, tbb::task * right) {
// if no RHS task, don't change left.
if (right == NULL) return left;
// right != NULL
if (left == NULL) return right;
if (left == SUCCESSFULLY_ENQUEUED) return right;
// left contains a task
if (right != SUCCESSFULLY_ENQUEUED) {
// both are valid tasks
internal::spawn_in_graph_arena(g, *left);
return right;
}
return left;
}
#if __TBB_PREVIEW_ASYNC_MSG
template < typename T > class async_msg;
namespace internal {
template < typename T > class async_storage;
template< typename T, typename = void >
struct async_helpers {
typedef async_msg<T> async_type;
typedef T filtered_type;
static const bool is_async_type = false;
static const void* to_void_ptr(const T& t) {
return static_cast<const void*>(&t);
}
static void* to_void_ptr(T& t) {
return static_cast<void*>(&t);
}
static const T& from_void_ptr(const void* p) {
return *static_cast<const T*>(p);
}
static T& from_void_ptr(void* p) {
return *static_cast<T*>(p);
}
static task* try_put_task_wrapper_impl(receiver<T>* const this_recv, const void *p, bool is_async) {
if (is_async) {
// This (T) is NOT async and incoming 'A<X> t' IS async
// Get data from async_msg
const async_msg<filtered_type>& msg = async_helpers< async_msg<filtered_type> >::from_void_ptr(p);
task* const new_task = msg.my_storage->subscribe(*this_recv, this_recv->graph_reference());
// finalize() must be called after subscribe() because set() can be called in finalize()
// and 'this_recv' client must be subscribed by this moment
msg.finalize();
return new_task;
}
else {
// Incoming 't' is NOT async
return this_recv->try_put_task(from_void_ptr(p));
}
}
};
template< typename T >
struct async_helpers< T, typename std::enable_if< std::is_base_of<async_msg<typename T::async_msg_data_type>, T>::value >::type > {
typedef T async_type;
typedef typename T::async_msg_data_type filtered_type;
static const bool is_async_type = true;
// Receiver-classes use const interfaces
static const void* to_void_ptr(const T& t) {
return static_cast<const void*>(&static_cast<const async_msg<filtered_type>&>(t));
}
static void* to_void_ptr(T& t) {
return static_cast<void*>(&static_cast<async_msg<filtered_type>&>(t));
}
// Sender-classes use non-const interfaces
static const T& from_void_ptr(const void* p) {
return *static_cast<const T*>(static_cast<const async_msg<filtered_type>*>(p));
}
static T& from_void_ptr(void* p) {
return *static_cast<T*>(static_cast<async_msg<filtered_type>*>(p));
}
// Used in receiver<T> class
static task* try_put_task_wrapper_impl(receiver<T>* const this_recv, const void *p, bool is_async) {
if (is_async) {
// Both are async
return this_recv->try_put_task(from_void_ptr(p));
}
else {
// This (T) is async and incoming 'X t' is NOT async
// Create async_msg for X
const filtered_type& t = async_helpers<filtered_type>::from_void_ptr(p);
const T msg(t);
return this_recv->try_put_task(msg);
}
}
};
class untyped_receiver;
class untyped_sender {
template< typename, typename > friend class internal::predecessor_cache;
template< typename, typename > friend class internal::reservable_predecessor_cache;
public:
typedef untyped_receiver successor_type;
virtual ~untyped_sender() {}
// NOTE: Following part of PUBLIC section is copy-paste from original sender<T> class
// TODO: Prevent untyped successor registration
virtual bool register_successor( successor_type &r ) = 0;
virtual bool remove_successor( successor_type &r ) = 0;
virtual bool try_release( ) { return false; }
virtual bool try_consume( ) { return false; }
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef internal::edge_container<successor_type> built_successors_type;
typedef built_successors_type::edge_list_type successor_list_type;
virtual built_successors_type &built_successors() = 0;
virtual void internal_add_built_successor( successor_type & ) = 0;
virtual void internal_delete_built_successor( successor_type & ) = 0;
virtual void copy_successors( successor_list_type &) = 0;
virtual size_t successor_count() = 0;
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
protected:
template< typename X >
bool try_get( X &t ) {
return try_get_wrapper( internal::async_helpers<X>::to_void_ptr(t), internal::async_helpers<X>::is_async_type );
}
template< typename X >
bool try_reserve( X &t ) {
return try_reserve_wrapper( internal::async_helpers<X>::to_void_ptr(t), internal::async_helpers<X>::is_async_type );
}
virtual bool try_get_wrapper( void* p, bool is_async ) = 0;
virtual bool try_reserve_wrapper( void* p, bool is_async ) = 0;
};
class untyped_receiver {
template< typename, typename > friend class run_and_put_task;
template< typename, typename > friend class internal::broadcast_cache;
template< typename, typename > friend class internal::round_robin_cache;
template< typename, typename > friend class internal::successor_cache;
#if __TBB_PREVIEW_OPENCL_NODE
template< typename, typename > friend class proxy_dependency_receiver;
#endif /* __TBB_PREVIEW_OPENCL_NODE */
public:
typedef untyped_sender predecessor_type;
virtual ~untyped_receiver() {}
template<typename X>
bool try_put(const X& t) {
task *res = try_put_task(t);
if (!res) return false;
if (res != SUCCESSFULLY_ENQUEUED) internal::spawn_in_graph_arena(graph_reference(), *res);
return true;
}
// NOTE: Following part of PUBLIC section is copy-paste from original receiver<T> class
// TODO: Prevent untyped predecessor registration
virtual bool register_predecessor( predecessor_type & ) { return false; }
virtual bool remove_predecessor( predecessor_type & ) { return false; }
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef internal::edge_container<predecessor_type> built_predecessors_type;
typedef built_predecessors_type::edge_list_type predecessor_list_type;
virtual built_predecessors_type &built_predecessors() = 0;
virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
virtual void internal_delete_built_predecessor( predecessor_type & ) = 0;
virtual void copy_predecessors( predecessor_list_type & ) = 0;
virtual size_t predecessor_count() = 0;
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
protected:
template<typename X>
task *try_put_task(const X& t) {
return try_put_task_wrapper( internal::async_helpers<X>::to_void_ptr(t), internal::async_helpers<X>::is_async_type );
}
virtual task* try_put_task_wrapper( const void* p, bool is_async ) = 0;
virtual graph& graph_reference() const = 0;
// NOTE: Following part of PROTECTED and PRIVATE sections is copy-paste from original receiver<T> class
virtual void reset_receiver(reset_flags f = rf_reset_protocol) = 0;
virtual bool is_continue_receiver() { return false; }
};
} // namespace internal
template< typename T >
class sender : public internal::untyped_sender {
public:
__TBB_DEPRECATED typedef T output_type;
__TBB_DEPRECATED typedef typename internal::async_helpers<T>::filtered_type filtered_type;
virtual bool try_get( T & ) { return false; }
virtual bool try_reserve( T & ) { return false; }
protected:
virtual bool try_get_wrapper( void* p, bool is_async ) __TBB_override {
// Both async OR both are NOT async
if ( internal::async_helpers<T>::is_async_type == is_async ) {
return try_get( internal::async_helpers<T>::from_void_ptr(p) );
}
// Else: this (T) is async OR incoming 't' is async
__TBB_ASSERT(false, "async_msg interface does not support 'pull' protocol in try_get()");
return false;
}
virtual bool try_reserve_wrapper( void* p, bool is_async ) __TBB_override {
// Both async OR both are NOT async
if ( internal::async_helpers<T>::is_async_type == is_async ) {
return try_reserve( internal::async_helpers<T>::from_void_ptr(p) );
}
// Else: this (T) is async OR incoming 't' is async
__TBB_ASSERT(false, "async_msg interface does not support 'pull' protocol in try_reserve()");
return false;
}
}; // class sender<T>
template< typename T >
class receiver : public internal::untyped_receiver {
template< typename > friend class internal::async_storage;
template< typename, typename > friend struct internal::async_helpers;
public:
__TBB_DEPRECATED typedef T input_type;
__TBB_DEPRECATED typedef typename internal::async_helpers<T>::filtered_type filtered_type;
bool try_put( const typename internal::async_helpers<T>::filtered_type& t ) {
return internal::untyped_receiver::try_put(t);
}
bool try_put( const typename internal::async_helpers<T>::async_type& t ) {
return internal::untyped_receiver::try_put(t);
}
protected:
virtual task* try_put_task_wrapper( const void *p, bool is_async ) __TBB_override {
return internal::async_helpers<T>::try_put_task_wrapper_impl(this, p, is_async);
}
virtual task *try_put_task(const T& t) = 0;
}; // class receiver<T>
#else // __TBB_PREVIEW_ASYNC_MSG
template< typename T >
class sender {
public:
__TBB_DEPRECATED typedef T output_type;
__TBB_DEPRECATED typedef receiver<T> successor_type;
virtual ~sender() {}
// NOTE: Following part of PUBLIC section is partly copy-pasted in sender<T> under #if __TBB_PREVIEW_ASYNC_MSG
__TBB_DEPRECATED virtual bool register_successor( successor_type &r ) = 0;
__TBB_DEPRECATED virtual bool remove_successor( successor_type &r ) = 0;
virtual bool try_get( T & ) { return false; }
virtual bool try_reserve( T & ) { return false; }
virtual bool try_release( ) { return false; }
virtual bool try_consume( ) { return false; }
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
__TBB_DEPRECATED typedef typename internal::edge_container<successor_type> built_successors_type;
__TBB_DEPRECATED typedef typename built_successors_type::edge_list_type successor_list_type;
__TBB_DEPRECATED virtual built_successors_type &built_successors() = 0;
__TBB_DEPRECATED virtual void internal_add_built_successor( successor_type & ) = 0;
__TBB_DEPRECATED virtual void internal_delete_built_successor( successor_type & ) = 0;
__TBB_DEPRECATED virtual void copy_successors( successor_list_type &) = 0;
__TBB_DEPRECATED virtual size_t successor_count() = 0;
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
}; // class sender<T>
template< typename T >
class receiver {
public:
__TBB_DEPRECATED typedef T input_type;
__TBB_DEPRECATED typedef sender<T> predecessor_type;
virtual ~receiver() {}
bool try_put( const T& t ) {
task *res = try_put_task(t);
if (!res) return false;
if (res != SUCCESSFULLY_ENQUEUED) internal::spawn_in_graph_arena(graph_reference(), *res);
return true;
}
protected:
template< typename R, typename B > friend class run_and_put_task;
template< typename X, typename Y > friend class internal::broadcast_cache;
template< typename X, typename Y > friend class internal::round_robin_cache;
virtual task *try_put_task(const T& t) = 0;
virtual graph& graph_reference() const = 0;
public:
// NOTE: Following part of PUBLIC and PROTECTED sections is copy-pasted in receiver<T> under #if __TBB_PREVIEW_ASYNC_MSG
__TBB_DEPRECATED virtual bool register_predecessor( predecessor_type & ) { return false; }
__TBB_DEPRECATED virtual bool remove_predecessor( predecessor_type & ) { return false; }
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
__TBB_DEPRECATED typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
__TBB_DEPRECATED typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
__TBB_DEPRECATED virtual built_predecessors_type &built_predecessors() = 0;
__TBB_DEPRECATED virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
__TBB_DEPRECATED virtual void internal_delete_built_predecessor( predecessor_type & ) = 0;
__TBB_DEPRECATED virtual void copy_predecessors( predecessor_list_type & ) = 0;
__TBB_DEPRECATED virtual size_t predecessor_count() = 0;
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
protected:
virtual void reset_receiver(reset_flags f = rf_reset_protocol) = 0;
template<typename TT, typename M> friend class internal::successor_cache;
virtual bool is_continue_receiver() { return false; }
#if __TBB_PREVIEW_OPENCL_NODE
template< typename, typename > friend class proxy_dependency_receiver;
#endif /* __TBB_PREVIEW_OPENCL_NODE */
}; // class receiver<T>
#endif // __TBB_PREVIEW_ASYNC_MSG
class continue_receiver : public receiver< continue_msg > {
public:
__TBB_DEPRECATED typedef continue_msg input_type;
__TBB_DEPRECATED typedef receiver<input_type>::predecessor_type predecessor_type;
__TBB_DEPRECATED explicit continue_receiver(
__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority)) {
my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
my_current_count = 0;
__TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = priority; )
}
__TBB_DEPRECATED continue_receiver( const continue_receiver& src ) : receiver<continue_msg>() {
my_predecessor_count = my_initial_predecessor_count = src.my_initial_predecessor_count;
my_current_count = 0;
__TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = src.my_priority; )
}
__TBB_DEPRECATED bool register_predecessor( predecessor_type & ) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
++my_predecessor_count;
return true;
}
__TBB_DEPRECATED bool remove_predecessor( predecessor_type & ) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
--my_predecessor_count;
return true;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
__TBB_DEPRECATED typedef internal::edge_container<predecessor_type> built_predecessors_type;
__TBB_DEPRECATED typedef built_predecessors_type::edge_list_type predecessor_list_type;
built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
__TBB_DEPRECATED void internal_add_built_predecessor( predecessor_type &s) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_built_predecessors.add_edge( s );
}
__TBB_DEPRECATED void internal_delete_built_predecessor( predecessor_type &s) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_built_predecessors.delete_edge(s);
}
__TBB_DEPRECATED void copy_predecessors( predecessor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_built_predecessors.copy_edges(v);
}
__TBB_DEPRECATED size_t predecessor_count() __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
return my_built_predecessors.edge_count();
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
// execute body is supposed to be too small to create a task for.
task *try_put_task( const input_type & ) __TBB_override {
{
spin_mutex::scoped_lock l(my_mutex);
if ( ++my_current_count < my_predecessor_count )
return SUCCESSFULLY_ENQUEUED;
else
my_current_count = 0;
}
task * res = execute();
return res? res : SUCCESSFULLY_ENQUEUED;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
// continue_receiver must contain its own built_predecessors because it does
// not have a node_cache.
built_predecessors_type my_built_predecessors;
#endif
spin_mutex my_mutex;
int my_predecessor_count;
int my_current_count;
int my_initial_predecessor_count;
__TBB_FLOW_GRAPH_PRIORITY_EXPR( node_priority_t my_priority; )
// the friend declaration in the base class did not eliminate the "protected class"
// error in gcc 4.1.2
template<typename U, typename V> friend class tbb::flow::interface11::limiter_node;
void reset_receiver( reset_flags f ) __TBB_override {
my_current_count = 0;
if (f & rf_clear_edges) {
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
my_built_predecessors.clear();
#endif
my_predecessor_count = my_initial_predecessor_count;
}
}
virtual task * execute() = 0;
template<typename TT, typename M> friend class internal::successor_cache;
bool is_continue_receiver() __TBB_override { return true; }
}; // class continue_receiver
} // interfaceX
#if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING
template <typename K, typename T>
K key_from_message( const T &t ) {
return t.key();
}
#endif /* __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING */
using interface11::sender;
using interface11::receiver;
using interface11::continue_receiver;
} // flow
} // tbb
#include "internal/_flow_graph_trace_impl.h"
#include "internal/_tbb_hash_compare_impl.h"
namespace tbb {
namespace flow {
namespace interface11 {
#include "internal/_flow_graph_body_impl.h"
#include "internal/_flow_graph_cache_impl.h"
#include "internal/_flow_graph_types_impl.h"
#if __TBB_PREVIEW_ASYNC_MSG
#include "internal/_flow_graph_async_msg_impl.h"
#endif
using namespace internal::graph_policy_namespace;
template <typename C, typename N>
graph_iterator<C,N>::graph_iterator(C *g, bool begin) : my_graph(g), current_node(NULL)
{
if (begin) current_node = my_graph->my_nodes;
//else it is an end iterator by default
}
template <typename C, typename N>
typename graph_iterator<C,N>::reference graph_iterator<C,N>::operator*() const {
__TBB_ASSERT(current_node, "graph_iterator at end");
return *operator->();
}
template <typename C, typename N>
typename graph_iterator<C,N>::pointer graph_iterator<C,N>::operator->() const {
return current_node;
}
template <typename C, typename N>
void graph_iterator<C,N>::internal_forward() {
if (current_node) current_node = current_node->next;
}
} // namespace interfaceX
namespace interface10 {
inline graph::graph() : my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
prepare_task_arena();
own_context = true;
cancelled = false;
caught_exception = false;
my_context = new task_group_context(tbb::internal::FLOW_TASKS);
my_root_task = (new (task::allocate_root(*my_context)) empty_task);
my_root_task->set_ref_count(1);
tbb::internal::fgt_graph(this);
my_is_active = true;
}
inline graph::graph(task_group_context& use_this_context) :
my_context(&use_this_context), my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
prepare_task_arena();
own_context = false;
cancelled = false;
caught_exception = false;
my_root_task = (new (task::allocate_root(*my_context)) empty_task);
my_root_task->set_ref_count(1);
tbb::internal::fgt_graph(this);
my_is_active = true;
}
inline graph::~graph() {
wait_for_all();
my_root_task->set_ref_count(0);
tbb::task::destroy(*my_root_task);
if (own_context) delete my_context;
delete my_task_arena;
}
inline void graph::reserve_wait() {
if (my_root_task) {
my_root_task->increment_ref_count();
tbb::internal::fgt_reserve_wait(this);
}
}
inline void graph::release_wait() {
if (my_root_task) {
tbb::internal::fgt_release_wait(this);
my_root_task->decrement_ref_count();
}
}
inline void graph::register_node(tbb::flow::interface11::graph_node *n) {
n->next = NULL;
{
spin_mutex::scoped_lock lock(nodelist_mutex);
n->prev = my_nodes_last;
if (my_nodes_last) my_nodes_last->next = n;
my_nodes_last = n;
if (!my_nodes) my_nodes = n;
}
}
inline void graph::remove_node(tbb::flow::interface11::graph_node *n) {
{
spin_mutex::scoped_lock lock(nodelist_mutex);
__TBB_ASSERT(my_nodes && my_nodes_last, "graph::remove_node: Error: no registered nodes");
if (n->prev) n->prev->next = n->next;
if (n->next) n->next->prev = n->prev;
if (my_nodes_last == n) my_nodes_last = n->prev;
if (my_nodes == n) my_nodes = n->next;
}
n->prev = n->next = NULL;
}
inline void graph::reset( tbb::flow::interface11::reset_flags f ) {
// reset context
tbb::flow::interface11::internal::deactivate_graph(*this);
if(my_context) my_context->reset();
cancelled = false;
caught_exception = false;
// reset all the nodes comprising the graph
for(iterator ii = begin(); ii != end(); ++ii) {
tbb::flow::interface11::graph_node *my_p = &(*ii);
my_p->reset_node(f);
}
// Reattach the arena. Might be useful to run the graph in a particular task_arena
// while not limiting graph lifetime to a single task_arena::execute() call.
prepare_task_arena( /*reinit=*/true );
tbb::flow::interface11::internal::activate_graph(*this);
// now spawn the tasks necessary to start the graph
for(task_list_type::iterator rti = my_reset_task_list.begin(); rti != my_reset_task_list.end(); ++rti) {
tbb::flow::interface11::internal::spawn_in_graph_arena(*this, *(*rti));
}
my_reset_task_list.clear();
}
inline graph::iterator graph::begin() { return iterator(this, true); }
inline graph::iterator graph::end() { return iterator(this, false); }
inline graph::const_iterator graph::begin() const { return const_iterator(this, true); }
inline graph::const_iterator graph::end() const { return const_iterator(this, false); }
inline graph::const_iterator graph::cbegin() const { return const_iterator(this, true); }
inline graph::const_iterator graph::cend() const { return const_iterator(this, false); }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
inline void graph::set_name(const char *name) {
tbb::internal::fgt_graph_desc(this, name);
}
#endif
} // namespace interface10
namespace interface11 {
inline graph_node::graph_node(graph& g) : my_graph(g) {
my_graph.register_node(this);
}
inline graph_node::~graph_node() {
my_graph.remove_node(this);
}
#include "internal/_flow_graph_node_impl.h"
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
using internal::node_set;
#endif
template < typename Output >
class source_node : public graph_node, public sender< Output > {
public:
typedef Output output_type;
typedef typename sender<output_type>::successor_type successor_type;
//Source node has no input type
typedef null_type input_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename sender<output_type>::built_successors_type built_successors_type;
typedef typename sender<output_type>::successor_list_type successor_list_type;
#endif
template< typename Body >
__TBB_NOINLINE_SYM source_node( graph &g, Body body, bool is_active = true )
: graph_node(g), my_active(is_active), init_my_active(is_active),
my_body( new internal::source_body_leaf< output_type, Body>(body) ),
my_init_body( new internal::source_body_leaf< output_type, Body>(body) ),
my_reserved(false), my_has_cached_item(false)
{
my_successors.set_owner(this);
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_SOURCE_NODE, &this->my_graph,
static_cast<sender<output_type> *>(this), this->my_body );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body, typename... Successors>
source_node( const node_set<internal::order::preceding, Successors...>& successors, Body body, bool is_active = true )
: source_node(successors.graph_reference(), body, is_active) {
make_edges(*this, successors);
}
#endif
__TBB_NOINLINE_SYM source_node( const source_node& src ) :
graph_node(src.my_graph), sender<Output>(),
my_active(src.init_my_active),
init_my_active(src.init_my_active), my_body( src.my_init_body->clone() ), my_init_body(src.my_init_body->clone() ),
my_reserved(false), my_has_cached_item(false)
{
my_successors.set_owner(this);
tbb::internal::fgt_node_with_body(CODEPTR(), tbb::internal::FLOW_SOURCE_NODE, &this->my_graph,
static_cast<sender<output_type> *>(this), this->my_body );
}
~source_node() { delete my_body; delete my_init_body; }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
bool register_successor( successor_type &r ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.register_successor(r);
if ( my_active )
spawn_put();
return true;
}
bool remove_successor( successor_type &r ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.remove_successor(r);
return true;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
void internal_add_built_successor( successor_type &r) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.internal_add_built_successor(r);
}
void internal_delete_built_successor( successor_type &r) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_successors.internal_delete_built_successor(r);
}
size_t successor_count() __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
return my_successors.successor_count();
}
void copy_successors(successor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l(my_mutex);
my_successors.copy_successors(v);
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
bool try_get( output_type &v ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
if ( my_reserved )
return false;
if ( my_has_cached_item ) {
v = my_cached_item;
my_has_cached_item = false;
return true;
}
// we've been asked to provide an item, but we have none. enqueue a task to
// provide one.
spawn_put();
return false;
}
bool try_reserve( output_type &v ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
if ( my_reserved ) {
return false;
}
if ( my_has_cached_item ) {
v = my_cached_item;
my_reserved = true;
return true;
} else {
return false;
}
}
bool try_release( ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
__TBB_ASSERT( my_reserved && my_has_cached_item, "releasing non-existent reservation" );
my_reserved = false;
if(!my_successors.empty())
spawn_put();
return true;
}
bool try_consume( ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
__TBB_ASSERT( my_reserved && my_has_cached_item, "consuming non-existent reservation" );
my_reserved = false;
my_has_cached_item = false;
if ( !my_successors.empty() ) {
spawn_put();
}
return true;
}
void activate() {
spin_mutex::scoped_lock lock(my_mutex);
my_active = true;
if (!my_successors.empty())
spawn_put();
}
template<typename Body>
Body copy_function_object() {
internal::source_body<output_type> &body_ref = *this->my_body;
return dynamic_cast< internal::source_body_leaf<output_type, Body> & >(body_ref).get_body();
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract( ) __TBB_override {
my_successors.built_successors().sender_extract(*this); // removes "my_owner" == this from each successor
my_active = init_my_active;
my_reserved = false;
if(my_has_cached_item) my_has_cached_item = false;
}
#endif
protected:
void reset_node( reset_flags f) __TBB_override {
my_active = init_my_active;
my_reserved =false;
if(my_has_cached_item) {
my_has_cached_item = false;
}
if(f & rf_clear_edges) my_successors.clear();
if(f & rf_reset_bodies) {
internal::source_body<output_type> *tmp = my_init_body->clone();
delete my_body;
my_body = tmp;
}
if(my_active)
internal::add_task_to_graph_reset_list(this->my_graph, create_put_task());
}
private:
spin_mutex my_mutex;
bool my_active;
bool init_my_active;
internal::source_body<output_type> *my_body;
internal::source_body<output_type> *my_init_body;
internal::broadcast_cache< output_type > my_successors;
bool my_reserved;
bool my_has_cached_item;
output_type my_cached_item;
// used by apply_body_bypass, can invoke body of node.
bool try_reserve_apply_body(output_type &v) {
spin_mutex::scoped_lock lock(my_mutex);
if ( my_reserved ) {
return false;
}
if ( !my_has_cached_item ) {
tbb::internal::fgt_begin_body( my_body );
bool r = (*my_body)(my_cached_item);
tbb::internal::fgt_end_body( my_body );
if (r) {
my_has_cached_item = true;
}
}
if ( my_has_cached_item ) {
v = my_cached_item;
my_reserved = true;
return true;
} else {
return false;
}
}
// when resetting, and if the source_node was created with my_active == true, then
// when we reset the node we must store a task to run the node, and spawn it only
// after the reset is complete and is_active() is again true. This is why we don't
// test for is_active() here.
task* create_put_task() {
return ( new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
internal:: source_task_bypass < source_node< output_type > >( *this ) );
}
void spawn_put( ) {
if(internal::is_graph_active(this->my_graph)) {
internal::spawn_in_graph_arena(this->my_graph, *create_put_task());
}
}
friend class internal::source_task_bypass< source_node< output_type > >;
task * apply_body_bypass( ) {
output_type v;
if ( !try_reserve_apply_body(v) )
return NULL;
task *last_task = my_successors.try_put_task(v);
if ( last_task )
try_consume();
else
try_release();
return last_task;
}
}; // class source_node
template < typename Input, typename Output = continue_msg, typename Policy = queueing, typename Allocator=cache_aligned_allocator<Input> >
class function_node : public graph_node, public internal::function_input<Input,Output,Policy,Allocator>, public internal::function_output<Output> {
public:
typedef Input input_type;
typedef Output output_type;
typedef internal::function_input<input_type,output_type,Policy,Allocator> input_impl_type;
typedef internal::function_input_queue<input_type, Allocator> input_queue_type;
typedef internal::function_output<output_type> fOutput_type;
typedef typename input_impl_type::predecessor_type predecessor_type;
typedef typename fOutput_type::successor_type successor_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename input_impl_type::predecessor_list_type predecessor_list_type;
typedef typename fOutput_type::successor_list_type successor_list_type;
#endif
using input_impl_type::my_predecessors;
// input_queue_type is allocated here, but destroyed in the function_input_base.
// TODO: pass the graph_buffer_policy to the function_input_base so it can all
// be done in one place. This would be an interface-breaking change.
template< typename Body >
__TBB_NOINLINE_SYM function_node( graph &g, size_t concurrency,
#if __TBB_CPP11_PRESENT
Body body, __TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy = Policy(), node_priority_t priority = tbb::flow::internal::no_priority ))
#else
__TBB_FLOW_GRAPH_PRIORITY_ARG1( Body body, node_priority_t priority = tbb::flow::internal::no_priority ))
#endif
: graph_node(g), input_impl_type(g, concurrency, __TBB_FLOW_GRAPH_PRIORITY_ARG1(body, priority)),
fOutput_type(g) {
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this), this->my_body );
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
template <typename Body>
function_node( graph& g, size_t concurrency, Body body, node_priority_t priority )
: function_node(g, concurrency, body, Policy(), priority) {}
#endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body, typename... Args>
function_node( const node_set<Args...>& nodes, size_t concurrency, Body body,
__TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy p = Policy(), node_priority_t priority = tbb::flow::internal::no_priority ))
: function_node(nodes.graph_reference(), concurrency, body, __TBB_FLOW_GRAPH_PRIORITY_ARG1(p, priority)) {
make_edges_in_order(nodes, *this);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
template <typename Body, typename... Args>
function_node( const node_set<Args...>& nodes, size_t concurrency, Body body, node_priority_t priority )
: function_node(nodes, concurrency, body, Policy(), priority) {}
#endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
#endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
__TBB_NOINLINE_SYM function_node( const function_node& src ) :
graph_node(src.my_graph),
input_impl_type(src),
fOutput_type(src.my_graph) {
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this), this->my_body );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract( ) __TBB_override {
my_predecessors.built_predecessors().receiver_extract(*this);
successors().built_successors().sender_extract(*this);
}
#endif
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
using input_impl_type::try_put_task;
internal::broadcast_cache<output_type> &successors () __TBB_override { return fOutput_type::my_successors; }
void reset_node(reset_flags f) __TBB_override {
input_impl_type::reset_function_input(f);
// TODO: use clear() instead.
if(f & rf_clear_edges) {
successors().clear();
my_predecessors.clear();
}
__TBB_ASSERT(!(f & rf_clear_edges) || successors().empty(), "function_node successors not empty");
__TBB_ASSERT(this->my_predecessors.empty(), "function_node predecessors not empty");
}
}; // class function_node
// Output is a tuple of output types.
template < typename Input, typename Output, typename Policy = queueing, typename Allocator=cache_aligned_allocator<Input> >
class multifunction_node :
public graph_node,
public internal::multifunction_input
<
Input,
typename internal::wrap_tuple_elements<
tbb::flow::tuple_size<Output>::value, // #elements in tuple
internal::multifunction_output, // wrap this around each element
Output // the tuple providing the types
>::type,
Policy,
Allocator
> {
protected:
static const int N = tbb::flow::tuple_size<Output>::value;
public:
typedef Input input_type;
typedef null_type output_type;
typedef typename internal::wrap_tuple_elements<N,internal::multifunction_output, Output>::type output_ports_type;
typedef internal::multifunction_input<input_type, output_ports_type, Policy, Allocator> input_impl_type;
typedef internal::function_input_queue<input_type, Allocator> input_queue_type;
private:
typedef typename internal::multifunction_input<input_type, output_ports_type, Policy, Allocator> base_type;
using input_impl_type::my_predecessors;
public:
template<typename Body>
__TBB_NOINLINE_SYM multifunction_node(
graph &g, size_t concurrency,
#if __TBB_CPP11_PRESENT
Body body, __TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy = Policy(), node_priority_t priority = tbb::flow::internal::no_priority )
#else
__TBB_FLOW_GRAPH_PRIORITY_ARG1(Body body, node_priority_t priority = tbb::flow::internal::no_priority)
#endif
) : graph_node(g), base_type(g, concurrency, __TBB_FLOW_GRAPH_PRIORITY_ARG1(body, priority)) {
tbb::internal::fgt_multioutput_node_with_body<N>(
CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
&this->my_graph, static_cast<receiver<input_type> *>(this),
this->output_ports(), this->my_body
);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
template <typename Body>
__TBB_NOINLINE_SYM multifunction_node(graph& g, size_t concurrency, Body body, node_priority_t priority)
: multifunction_node(g, concurrency, body, Policy(), priority) {}
#endif // TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body, typename... Args>
__TBB_NOINLINE_SYM multifunction_node(const node_set<Args...>& nodes, size_t concurrency, Body body,
__TBB_FLOW_GRAPH_PRIORITY_ARG1(Policy p = Policy(), node_priority_t priority = tbb::flow::internal::no_priority))
: multifunction_node(nodes.graph_reference(), concurrency, body, __TBB_FLOW_GRAPH_PRIORITY_ARG1(p, priority)) {
make_edges_in_order(nodes, *this);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
template <typename Body, typename... Args>
__TBB_NOINLINE_SYM multifunction_node(const node_set<Args...>& nodes, size_t concurrency, Body body, node_priority_t priority)
: multifunction_node(nodes, concurrency, body, Policy(), priority) {}
#endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
#endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
__TBB_NOINLINE_SYM multifunction_node( const multifunction_node &other) :
graph_node(other.my_graph), base_type(other) {
tbb::internal::fgt_multioutput_node_with_body<N>( CODEPTR(), tbb::internal::FLOW_MULTIFUNCTION_NODE,
&this->my_graph, static_cast<receiver<input_type> *>(this),
this->output_ports(), this->my_body );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multioutput_node_desc( this, name );
}
#endif
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract( ) __TBB_override {
my_predecessors.built_predecessors().receiver_extract(*this);
base_type::extract();
}
#endif
// all the guts are in multifunction_input...
protected:
void reset_node(reset_flags f) __TBB_override { base_type::reset(f); }
}; // multifunction_node
// successors. The node has unlimited concurrency, so it does not reject inputs.
template<typename TupleType, typename Allocator=cache_aligned_allocator<TupleType> >
class split_node : public graph_node, public receiver<TupleType> {
static const int N = tbb::flow::tuple_size<TupleType>::value;
typedef receiver<TupleType> base_type;
public:
typedef TupleType input_type;
typedef Allocator allocator_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename base_type::predecessor_type predecessor_type;
typedef typename base_type::predecessor_list_type predecessor_list_type;
typedef internal::predecessor_cache<input_type, null_mutex > predecessor_cache_type;
typedef typename predecessor_cache_type::built_predecessors_type built_predecessors_type;
#endif
typedef typename internal::wrap_tuple_elements<
N, // #elements in tuple
internal::multifunction_output, // wrap this around each element
TupleType // the tuple providing the types
>::type output_ports_type;
__TBB_NOINLINE_SYM explicit split_node(graph &g)
: graph_node(g),
my_output_ports(internal::init_output_ports<output_ports_type>::call(g, my_output_ports))
{
tbb::internal::fgt_multioutput_node<N>(CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), this->output_ports());
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
__TBB_NOINLINE_SYM split_node(const node_set<Args...>& nodes) : split_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM split_node(const split_node& other)
: graph_node(other.my_graph), base_type(other),
my_output_ports(internal::init_output_ports<output_ports_type>::call(other.my_graph, my_output_ports))
{
tbb::internal::fgt_multioutput_node<N>(CODEPTR(), tbb::internal::FLOW_SPLIT_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), this->output_ports());
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multioutput_node_desc( this, name );
}
#endif
output_ports_type &output_ports() { return my_output_ports; }
protected:
task *try_put_task(const TupleType& t) __TBB_override {
// Sending split messages in parallel is not justified, as overheads would prevail.
// Also, we do not have successors here. So we just tell the task returned here is successful.
return internal::emit_element<N>::emit_this(this->my_graph, t, output_ports());
}
void reset_node(reset_flags f) __TBB_override {
if (f & rf_clear_edges)
internal::clear_element<N>::clear_this(my_output_ports);
__TBB_ASSERT(!(f & rf_clear_edges) || internal::clear_element<N>::this_empty(my_output_ports), "split_node reset failed");
}
void reset_receiver(reset_flags /*f*/) __TBB_override {}
graph& graph_reference() const __TBB_override {
return my_graph;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
private:
void extract() __TBB_override {}
void internal_add_built_predecessor(predecessor_type&) __TBB_override {}
void internal_delete_built_predecessor(predecessor_type&) __TBB_override {}
size_t predecessor_count() __TBB_override { return 0; }
void copy_predecessors(predecessor_list_type&) __TBB_override {}
built_predecessors_type &built_predecessors() __TBB_override { return my_predessors; }
built_predecessors_type my_predessors;
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
private:
output_ports_type my_output_ports;
};
template <typename Output, typename Policy = internal::Policy<void> >
class continue_node : public graph_node, public internal::continue_input<Output, Policy>,
public internal::function_output<Output> {
public:
typedef continue_msg input_type;
typedef Output output_type;
typedef internal::continue_input<Output, Policy> input_impl_type;
typedef internal::function_output<output_type> fOutput_type;
typedef typename input_impl_type::predecessor_type predecessor_type;
typedef typename fOutput_type::successor_type successor_type;
template <typename Body >
__TBB_NOINLINE_SYM continue_node(
graph &g,
#if __TBB_CPP11_PRESENT
Body body, __TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy = Policy(), node_priority_t priority = tbb::flow::internal::no_priority )
#else
__TBB_FLOW_GRAPH_PRIORITY_ARG1( Body body, node_priority_t priority = tbb::flow::internal::no_priority )
#endif
) : graph_node(g), input_impl_type( g, __TBB_FLOW_GRAPH_PRIORITY_ARG1(body, priority) ),
fOutput_type(g) {
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_CONTINUE_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this), this->my_body );
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
template <typename Body>
continue_node( graph& g, Body body, node_priority_t priority )
: continue_node(g, body, Policy(), priority) {}
#endif
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body, typename... Args>
continue_node( const node_set<Args...>& nodes, Body body,
__TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy p = Policy(), node_priority_t priority = tbb::flow::internal::no_priority))
: continue_node(nodes.graph_reference(), body, __TBB_FLOW_GRAPH_PRIORITY_ARG1(p, priority) ) {
make_edges_in_order(nodes, *this);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
template <typename Body, typename... Args>
continue_node( const node_set<Args...>& nodes, Body body, node_priority_t priority)
: continue_node(nodes, body, Policy(), priority) {}
#endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
#endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body >
__TBB_NOINLINE_SYM continue_node(
graph &g, int number_of_predecessors,
#if __TBB_CPP11_PRESENT
Body body, __TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy = Policy(), node_priority_t priority = tbb::flow::internal::no_priority )
#else
__TBB_FLOW_GRAPH_PRIORITY_ARG1( Body body, node_priority_t priority = tbb::flow::internal::no_priority )
#endif
) : graph_node(g)
, input_impl_type(g, number_of_predecessors, __TBB_FLOW_GRAPH_PRIORITY_ARG1(body, priority)),
fOutput_type(g) {
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_CONTINUE_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this), this->my_body );
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
template <typename Body>
continue_node( graph& g, int number_of_predecessors, Body body, node_priority_t priority)
: continue_node(g, number_of_predecessors, body, Policy(), priority) {}
#endif
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body, typename... Args>
continue_node( const node_set<Args...>& nodes, int number_of_predecessors,
Body body, __TBB_FLOW_GRAPH_PRIORITY_ARG1( Policy p = Policy(), node_priority_t priority = tbb::flow::internal::no_priority ))
: continue_node(nodes.graph_reference(), number_of_predecessors, body, __TBB_FLOW_GRAPH_PRIORITY_ARG1(p, priority)) {
make_edges_in_order(nodes, *this);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
template <typename Body, typename... Args>
continue_node( const node_set<Args...>& nodes, int number_of_predecessors,
Body body, node_priority_t priority )
: continue_node(nodes, number_of_predecessors, body, Policy(), priority) {}
#endif
#endif
__TBB_NOINLINE_SYM continue_node( const continue_node& src ) :
graph_node(src.my_graph), input_impl_type(src),
internal::function_output<Output>(src.my_graph) {
tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_CONTINUE_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this), this->my_body );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract() __TBB_override {
input_impl_type::my_built_predecessors.receiver_extract(*this);
successors().built_successors().sender_extract(*this);
}
#endif
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
using input_impl_type::try_put_task;
internal::broadcast_cache<output_type> &successors () __TBB_override { return fOutput_type::my_successors; }
void reset_node(reset_flags f) __TBB_override {
input_impl_type::reset_receiver(f);
if(f & rf_clear_edges)successors().clear();
__TBB_ASSERT(!(f & rf_clear_edges) || successors().empty(), "continue_node not reset");
}
}; // continue_node
template <typename T>
class broadcast_node : public graph_node, public receiver<T>, public sender<T> {
public:
typedef T input_type;
typedef T output_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename receiver<input_type>::predecessor_list_type predecessor_list_type;
typedef typename sender<output_type>::successor_list_type successor_list_type;
#endif
private:
internal::broadcast_cache<input_type> my_successors;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
internal::edge_container<predecessor_type> my_built_predecessors;
spin_mutex pred_mutex; // serialize accesses on edge_container
#endif
public:
__TBB_NOINLINE_SYM explicit broadcast_node(graph& g) : graph_node(g) {
my_successors.set_owner( this );
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BROADCAST_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
broadcast_node(const node_set<Args...>& nodes) : broadcast_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM broadcast_node( const broadcast_node& src ) :
graph_node(src.my_graph), receiver<T>(), sender<T>()
{
my_successors.set_owner( this );
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BROADCAST_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
bool register_successor( successor_type &r ) __TBB_override {
my_successors.register_successor( r );
return true;
}
bool remove_successor( successor_type &r ) __TBB_override {
my_successors.remove_successor( r );
return true;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename sender<T>::built_successors_type built_successors_type;
built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
void internal_add_built_successor(successor_type &r) __TBB_override {
my_successors.internal_add_built_successor(r);
}
void internal_delete_built_successor(successor_type &r) __TBB_override {
my_successors.internal_delete_built_successor(r);
}
size_t successor_count() __TBB_override {
return my_successors.successor_count();
}
void copy_successors(successor_list_type &v) __TBB_override {
my_successors.copy_successors(v);
}
typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
void internal_add_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
my_built_predecessors.add_edge(p);
}
void internal_delete_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
my_built_predecessors.delete_edge(p);
}
size_t predecessor_count() __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
return my_built_predecessors.edge_count();
}
void copy_predecessors(predecessor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l(pred_mutex);
my_built_predecessors.copy_edges(v);
}
void extract() __TBB_override {
my_built_predecessors.receiver_extract(*this);
my_successors.built_successors().sender_extract(*this);
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
task *try_put_task(const T& t) __TBB_override {
task *new_task = my_successors.try_put_task(t);
if (!new_task) new_task = SUCCESSFULLY_ENQUEUED;
return new_task;
}
graph& graph_reference() const __TBB_override {
return my_graph;
}
void reset_receiver(reset_flags /*f*/) __TBB_override {}
void reset_node(reset_flags f) __TBB_override {
if (f&rf_clear_edges) {
my_successors.clear();
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
my_built_predecessors.clear();
#endif
}
__TBB_ASSERT(!(f & rf_clear_edges) || my_successors.empty(), "Error resetting broadcast_node");
}
}; // broadcast_node
template <typename T, typename A=cache_aligned_allocator<T> >
class buffer_node : public graph_node, public internal::reservable_item_buffer<T, A>, public receiver<T>, public sender<T> {
public:
typedef T input_type;
typedef T output_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
typedef buffer_node<T, A> class_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename receiver<input_type>::predecessor_list_type predecessor_list_type;
typedef typename sender<output_type>::successor_list_type successor_list_type;
#endif
protected:
typedef size_t size_type;
internal::round_robin_cache< T, null_rw_mutex > my_successors;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
internal::edge_container<predecessor_type> my_built_predecessors;
#endif
friend class internal::forward_task_bypass< buffer_node< T, A > >;
enum op_type {reg_succ, rem_succ, req_item, res_item, rel_res, con_res, put_item, try_fwd_task
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
, add_blt_succ, del_blt_succ,
add_blt_pred, del_blt_pred,
blt_succ_cnt, blt_pred_cnt,
blt_succ_cpy, blt_pred_cpy // create vector copies of preds and succs
#endif
};
// implements the aggregator_operation concept
class buffer_operation : public internal::aggregated_operation< buffer_operation > {
public:
char type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
task * ltask;
union {
input_type *elem;
successor_type *r;
predecessor_type *p;
size_t cnt_val;
successor_list_type *svec;
predecessor_list_type *pvec;
};
#else
T *elem;
task * ltask;
successor_type *r;
#endif
buffer_operation(const T& e, op_type t) : type(char(t))
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
, ltask(NULL), elem(const_cast<T*>(&e))
#else
, elem(const_cast<T*>(&e)) , ltask(NULL)
#endif
{}
buffer_operation(op_type t) : type(char(t)), ltask(NULL) {}
};
bool forwarder_busy;
typedef internal::aggregating_functor<class_type, buffer_operation> handler_type;
friend class internal::aggregating_functor<class_type, buffer_operation>;
internal::aggregator< handler_type, buffer_operation> my_aggregator;
virtual void handle_operations(buffer_operation *op_list) {
handle_operations_impl(op_list, this);
}
template<typename derived_type>
void handle_operations_impl(buffer_operation *op_list, derived_type* derived) {
__TBB_ASSERT(static_cast<class_type*>(derived) == this, "'this' is not a base class for derived");
buffer_operation *tmp = NULL;
bool try_forwarding = false;
while (op_list) {
tmp = op_list;
op_list = op_list->next;
switch (tmp->type) {
case reg_succ: internal_reg_succ(tmp); try_forwarding = true; break;
case rem_succ: internal_rem_succ(tmp); break;
case req_item: internal_pop(tmp); break;
case res_item: internal_reserve(tmp); break;
case rel_res: internal_release(tmp); try_forwarding = true; break;
case con_res: internal_consume(tmp); try_forwarding = true; break;
case put_item: try_forwarding = internal_push(tmp); break;
case try_fwd_task: internal_forward_task(tmp); break;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
// edge recording
case add_blt_succ: internal_add_built_succ(tmp); break;
case del_blt_succ: internal_del_built_succ(tmp); break;
case add_blt_pred: internal_add_built_pred(tmp); break;
case del_blt_pred: internal_del_built_pred(tmp); break;
case blt_succ_cnt: internal_succ_cnt(tmp); break;
case blt_pred_cnt: internal_pred_cnt(tmp); break;
case blt_succ_cpy: internal_copy_succs(tmp); break;
case blt_pred_cpy: internal_copy_preds(tmp); break;
#endif
}
}
derived->order();
if (try_forwarding && !forwarder_busy) {
if(internal::is_graph_active(this->my_graph)) {
forwarder_busy = true;
task *new_task = new(task::allocate_additional_child_of(*(this->my_graph.root_task()))) internal::
forward_task_bypass
< buffer_node<input_type, A> >(*this);
// tmp should point to the last item handled by the aggregator. This is the operation
// the handling thread enqueued. So modifying that record will be okay.
// workaround for icc bug
tbb::task *z = tmp->ltask;
graph &g = this->my_graph;
tmp->ltask = combine_tasks(g, z, new_task); // in case the op generated a task
}
}
} // handle_operations
inline task *grab_forwarding_task( buffer_operation &op_data) {
return op_data.ltask;
}
inline bool enqueue_forwarding_task(buffer_operation &op_data) {
task *ft = grab_forwarding_task(op_data);
if(ft) {
internal::spawn_in_graph_arena(graph_reference(), *ft);
return true;
}
return false;
}
virtual task *forward_task() {
buffer_operation op_data(try_fwd_task);
task *last_task = NULL;
do {
op_data.status = internal::WAIT;
op_data.ltask = NULL;
my_aggregator.execute(&op_data);
// workaround for icc bug
tbb::task *xtask = op_data.ltask;
graph& g = this->my_graph;
last_task = combine_tasks(g, last_task, xtask);
} while (op_data.status ==internal::SUCCEEDED);
return last_task;
}
virtual void internal_reg_succ(buffer_operation *op) {
my_successors.register_successor(*(op->r));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_rem_succ(buffer_operation *op) {
my_successors.remove_successor(*(op->r));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename sender<T>::built_successors_type built_successors_type;
built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
virtual void internal_add_built_succ(buffer_operation *op) {
my_successors.internal_add_built_successor(*(op->r));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_del_built_succ(buffer_operation *op) {
my_successors.internal_delete_built_successor(*(op->r));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
typedef typename receiver<T>::built_predecessors_type built_predecessors_type;
built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
virtual void internal_add_built_pred(buffer_operation *op) {
my_built_predecessors.add_edge(*(op->p));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_del_built_pred(buffer_operation *op) {
my_built_predecessors.delete_edge(*(op->p));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_succ_cnt(buffer_operation *op) {
op->cnt_val = my_successors.successor_count();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_pred_cnt(buffer_operation *op) {
op->cnt_val = my_built_predecessors.edge_count();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_copy_succs(buffer_operation *op) {
my_successors.copy_successors(*(op->svec));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_copy_preds(buffer_operation *op) {
my_built_predecessors.copy_edges(*(op->pvec));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
private:
void order() {}
bool is_item_valid() {
return this->my_item_valid(this->my_tail - 1);
}
void try_put_and_add_task(task*& last_task) {
task *new_task = my_successors.try_put_task(this->back());
if (new_task) {
// workaround for icc bug
graph& g = this->my_graph;
last_task = combine_tasks(g, last_task, new_task);
this->destroy_back();
}
}
protected:
virtual void internal_forward_task(buffer_operation *op) {
internal_forward_task_impl(op, this);
}
template<typename derived_type>
void internal_forward_task_impl(buffer_operation *op, derived_type* derived) {
__TBB_ASSERT(static_cast<class_type*>(derived) == this, "'this' is not a base class for derived");
if (this->my_reserved || !derived->is_item_valid()) {
__TBB_store_with_release(op->status, internal::FAILED);
this->forwarder_busy = false;
return;
}
// Try forwarding, giving each successor a chance
task * last_task = NULL;
size_type counter = my_successors.size();
for (; counter > 0 && derived->is_item_valid(); --counter)
derived->try_put_and_add_task(last_task);
op->ltask = last_task; // return task
if (last_task && !counter) {
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
else {
__TBB_store_with_release(op->status, internal::FAILED);
forwarder_busy = false;
}
}
virtual bool internal_push(buffer_operation *op) {
this->push_back(*(op->elem));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
return true;
}
virtual void internal_pop(buffer_operation *op) {
if(this->pop_back(*(op->elem))) {
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
else {
__TBB_store_with_release(op->status, internal::FAILED);
}
}
virtual void internal_reserve(buffer_operation *op) {
if(this->reserve_front(*(op->elem))) {
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
else {
__TBB_store_with_release(op->status, internal::FAILED);
}
}
virtual void internal_consume(buffer_operation *op) {
this->consume_front();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
virtual void internal_release(buffer_operation *op) {
this->release_front();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
public:
__TBB_NOINLINE_SYM explicit buffer_node( graph &g ) : graph_node(g), internal::reservable_item_buffer<T>(),
forwarder_busy(false) {
my_successors.set_owner(this);
my_aggregator.initialize_handler(handler_type(this));
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BUFFER_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
buffer_node(const node_set<Args...>& nodes) : buffer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM buffer_node( const buffer_node& src ) : graph_node(src.my_graph),
internal::reservable_item_buffer<T>(), receiver<T>(), sender<T>() {
forwarder_busy = false;
my_successors.set_owner(this);
my_aggregator.initialize_handler(handler_type(this));
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BUFFER_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
//
// message sender implementation
//
bool register_successor( successor_type &r ) __TBB_override {
buffer_operation op_data(reg_succ);
op_data.r = &r;
my_aggregator.execute(&op_data);
(void)enqueue_forwarding_task(op_data);
return true;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void internal_add_built_successor( successor_type &r) __TBB_override {
buffer_operation op_data(add_blt_succ);
op_data.r = &r;
my_aggregator.execute(&op_data);
}
void internal_delete_built_successor( successor_type &r) __TBB_override {
buffer_operation op_data(del_blt_succ);
op_data.r = &r;
my_aggregator.execute(&op_data);
}
void internal_add_built_predecessor( predecessor_type &p) __TBB_override {
buffer_operation op_data(add_blt_pred);
op_data.p = &p;
my_aggregator.execute(&op_data);
}
void internal_delete_built_predecessor( predecessor_type &p) __TBB_override {
buffer_operation op_data(del_blt_pred);
op_data.p = &p;
my_aggregator.execute(&op_data);
}
size_t predecessor_count() __TBB_override {
buffer_operation op_data(blt_pred_cnt);
my_aggregator.execute(&op_data);
return op_data.cnt_val;
}
size_t successor_count() __TBB_override {
buffer_operation op_data(blt_succ_cnt);
my_aggregator.execute(&op_data);
return op_data.cnt_val;
}
void copy_predecessors( predecessor_list_type &v ) __TBB_override {
buffer_operation op_data(blt_pred_cpy);
op_data.pvec = &v;
my_aggregator.execute(&op_data);
}
void copy_successors( successor_list_type &v ) __TBB_override {
buffer_operation op_data(blt_succ_cpy);
op_data.svec = &v;
my_aggregator.execute(&op_data);
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
bool remove_successor( successor_type &r ) __TBB_override {
r.remove_predecessor(*this);
buffer_operation op_data(rem_succ);
op_data.r = &r;
my_aggregator.execute(&op_data);
// even though this operation does not cause a forward, if we are the handler, and
// a forward is scheduled, we may be the first to reach this point after the aggregator,
// and so should check for the task.
(void)enqueue_forwarding_task(op_data);
return true;
}
bool try_get( T &v ) __TBB_override {
buffer_operation op_data(req_item);
op_data.elem = &v;
my_aggregator.execute(&op_data);
(void)enqueue_forwarding_task(op_data);
return (op_data.status==internal::SUCCEEDED);
}
bool try_reserve( T &v ) __TBB_override {
buffer_operation op_data(res_item);
op_data.elem = &v;
my_aggregator.execute(&op_data);
(void)enqueue_forwarding_task(op_data);
return (op_data.status==internal::SUCCEEDED);
}
bool try_release() __TBB_override {
buffer_operation op_data(rel_res);
my_aggregator.execute(&op_data);
(void)enqueue_forwarding_task(op_data);
return true;
}
bool try_consume() __TBB_override {
buffer_operation op_data(con_res);
my_aggregator.execute(&op_data);
(void)enqueue_forwarding_task(op_data);
return true;
}
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
task *try_put_task(const T &t) __TBB_override {
buffer_operation op_data(t, put_item);
my_aggregator.execute(&op_data);
task *ft = grab_forwarding_task(op_data);
// sequencer_nodes can return failure (if an item has been previously inserted)
// We have to spawn the returned task if our own operation fails.
if(ft && op_data.status ==internal::FAILED) {
// we haven't succeeded queueing the item, but for some reason the
// call returned a task (if another request resulted in a successful
// forward this could happen.) Queue the task and reset the pointer.
internal::spawn_in_graph_arena(graph_reference(), *ft); ft = NULL;
}
else if(!ft && op_data.status ==internal::SUCCEEDED) {
ft = SUCCESSFULLY_ENQUEUED;
}
return ft;
}
graph& graph_reference() const __TBB_override {
return my_graph;
}
void reset_receiver(reset_flags /*f*/) __TBB_override { }
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
public:
void extract() __TBB_override {
my_built_predecessors.receiver_extract(*this);
my_successors.built_successors().sender_extract(*this);
}
#endif
protected:
void reset_node( reset_flags f) __TBB_override {
internal::reservable_item_buffer<T, A>::reset();
// TODO: just clear structures
if (f&rf_clear_edges) {
my_successors.clear();
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
my_built_predecessors.clear();
#endif
}
forwarder_busy = false;
}
}; // buffer_node
template <typename T, typename A=cache_aligned_allocator<T> >
class queue_node : public buffer_node<T, A> {
protected:
typedef buffer_node<T, A> base_type;
typedef typename base_type::size_type size_type;
typedef typename base_type::buffer_operation queue_operation;
typedef queue_node class_type;
private:
template<typename, typename> friend class buffer_node;
bool is_item_valid() {
return this->my_item_valid(this->my_head);
}
void try_put_and_add_task(task*& last_task) {
task *new_task = this->my_successors.try_put_task(this->front());
if (new_task) {
// workaround for icc bug
graph& graph_ref = this->graph_reference();
last_task = combine_tasks(graph_ref, last_task, new_task);
this->destroy_front();
}
}
protected:
void internal_forward_task(queue_operation *op) __TBB_override {
this->internal_forward_task_impl(op, this);
}
void internal_pop(queue_operation *op) __TBB_override {
if ( this->my_reserved || !this->my_item_valid(this->my_head)){
__TBB_store_with_release(op->status, internal::FAILED);
}
else {
this->pop_front(*(op->elem));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
}
void internal_reserve(queue_operation *op) __TBB_override {
if (this->my_reserved || !this->my_item_valid(this->my_head)) {
__TBB_store_with_release(op->status, internal::FAILED);
}
else {
this->reserve_front(*(op->elem));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
}
void internal_consume(queue_operation *op) __TBB_override {
this->consume_front();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
}
public:
typedef T input_type;
typedef T output_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
__TBB_NOINLINE_SYM explicit queue_node( graph &g ) : base_type(g) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_QUEUE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
queue_node( const node_set<Args...>& nodes) : queue_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM queue_node( const queue_node& src) : base_type(src) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_QUEUE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
protected:
void reset_node( reset_flags f) __TBB_override {
base_type::reset_node(f);
}
}; // queue_node
template< typename T, typename A=cache_aligned_allocator<T> >
class sequencer_node : public queue_node<T, A> {
internal::function_body< T, size_t > *my_sequencer;
// my_sequencer should be a benign function and must be callable
// from a parallel context. Does this mean it needn't be reset?
public:
typedef T input_type;
typedef T output_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
template< typename Sequencer >
__TBB_NOINLINE_SYM sequencer_node( graph &g, const Sequencer& s ) : queue_node<T, A>(g),
my_sequencer(new internal::function_body_leaf< T, size_t, Sequencer>(s) ) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_SEQUENCER_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Sequencer, typename... Args>
sequencer_node( const node_set<Args...>& nodes, const Sequencer& s)
: sequencer_node(nodes.graph_reference(), s) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM sequencer_node( const sequencer_node& src ) : queue_node<T, A>(src),
my_sequencer( src.my_sequencer->clone() ) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_SEQUENCER_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
~sequencer_node() { delete my_sequencer; }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
protected:
typedef typename buffer_node<T, A>::size_type size_type;
typedef typename buffer_node<T, A>::buffer_operation sequencer_operation;
private:
bool internal_push(sequencer_operation *op) __TBB_override {
size_type tag = (*my_sequencer)(*(op->elem));
#if !TBB_DEPRECATED_SEQUENCER_DUPLICATES
if (tag < this->my_head) {
// have already emitted a message with this tag
__TBB_store_with_release(op->status, internal::FAILED);
return false;
}
#endif
// cannot modify this->my_tail now; the buffer would be inconsistent.
size_t new_tail = (tag+1 > this->my_tail) ? tag+1 : this->my_tail;
if (this->size(new_tail) > this->capacity()) {
this->grow_my_array(this->size(new_tail));
}
this->my_tail = new_tail;
const internal::op_stat res = this->place_item(tag, *(op->elem)) ? internal::SUCCEEDED : internal::FAILED;
__TBB_store_with_release(op->status, res);
return res ==internal::SUCCEEDED;
}
}; // sequencer_node
template< typename T, typename Compare = std::less<T>, typename A=cache_aligned_allocator<T> >
class priority_queue_node : public buffer_node<T, A> {
public:
typedef T input_type;
typedef T output_type;
typedef buffer_node<T,A> base_type;
typedef priority_queue_node class_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
__TBB_NOINLINE_SYM explicit priority_queue_node( graph &g, const Compare& comp = Compare() )
: buffer_node<T, A>(g), compare(comp), mark(0) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_PRIORITY_QUEUE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
priority_queue_node(const node_set<Args...>& nodes, const Compare& comp = Compare())
: priority_queue_node(nodes.graph_reference(), comp) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM priority_queue_node( const priority_queue_node &src ) : buffer_node<T, A>(src), mark(0) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_PRIORITY_QUEUE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
protected:
void reset_node( reset_flags f) __TBB_override {
mark = 0;
base_type::reset_node(f);
}
typedef typename buffer_node<T, A>::size_type size_type;
typedef typename buffer_node<T, A>::item_type item_type;
typedef typename buffer_node<T, A>::buffer_operation prio_operation;
void internal_forward_task(prio_operation *op) __TBB_override {
this->internal_forward_task_impl(op, this);
}
void handle_operations(prio_operation *op_list) __TBB_override {
this->handle_operations_impl(op_list, this);
}
bool internal_push(prio_operation *op) __TBB_override {
prio_push(*(op->elem));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
return true;
}
void internal_pop(prio_operation *op) __TBB_override {
// if empty or already reserved, don't pop
if ( this->my_reserved == true || this->my_tail == 0 ) {
__TBB_store_with_release(op->status, internal::FAILED);
return;
}
*(op->elem) = prio();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
prio_pop();
}
// pops the highest-priority item, saves copy
void internal_reserve(prio_operation *op) __TBB_override {
if (this->my_reserved == true || this->my_tail == 0) {
__TBB_store_with_release(op->status, internal::FAILED);
return;
}
this->my_reserved = true;
*(op->elem) = prio();
reserved_item = *(op->elem);
__TBB_store_with_release(op->status, internal::SUCCEEDED);
prio_pop();
}
void internal_consume(prio_operation *op) __TBB_override {
__TBB_store_with_release(op->status, internal::SUCCEEDED);
this->my_reserved = false;
reserved_item = input_type();
}
void internal_release(prio_operation *op) __TBB_override {
__TBB_store_with_release(op->status, internal::SUCCEEDED);
prio_push(reserved_item);
this->my_reserved = false;
reserved_item = input_type();
}
private:
template<typename, typename> friend class buffer_node;
void order() {
if (mark < this->my_tail) heapify();
__TBB_ASSERT(mark == this->my_tail, "mark unequal after heapify");
}
bool is_item_valid() {
return this->my_tail > 0;
}
void try_put_and_add_task(task*& last_task) {
task * new_task = this->my_successors.try_put_task(this->prio());
if (new_task) {
// workaround for icc bug
graph& graph_ref = this->graph_reference();
last_task = combine_tasks(graph_ref, last_task, new_task);
prio_pop();
}
}
private:
Compare compare;
size_type mark;
input_type reserved_item;
// in case a reheap has not been done after a push, check if the mark item is higher than the 0'th item
bool prio_use_tail() {
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds before test");
return mark < this->my_tail && compare(this->get_my_item(0), this->get_my_item(this->my_tail - 1));
}
// prio_push: checks that the item will fit, expand array if necessary, put at end
void prio_push(const T &src) {
if ( this->my_tail >= this->my_array_size )
this->grow_my_array( this->my_tail + 1 );
(void) this->place_item(this->my_tail, src);
++(this->my_tail);
__TBB_ASSERT(mark < this->my_tail, "mark outside bounds after push");
}
// prio_pop: deletes highest priority item from the array, and if it is item
// 0, move last item to 0 and reheap. If end of array, just destroy and decrement tail
// and mark. Assumes the array has already been tested for emptiness; no failure.
void prio_pop() {
if (prio_use_tail()) {
// there are newly pushed elements; last one higher than top
// copy the data
this->destroy_item(this->my_tail-1);
--(this->my_tail);
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds after pop");
return;
}
this->destroy_item(0);
if(this->my_tail > 1) {
// push the last element down heap
__TBB_ASSERT(this->my_item_valid(this->my_tail - 1), NULL);
this->move_item(0,this->my_tail - 1);
}
--(this->my_tail);
if(mark > this->my_tail) --mark;
if (this->my_tail > 1) // don't reheap for heap of size 1
reheap();
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds after pop");
}
const T& prio() {
return this->get_my_item(prio_use_tail() ? this->my_tail-1 : 0);
}
// turn array into heap
void heapify() {
if(this->my_tail == 0) {
mark = 0;
return;
}
if (!mark) mark = 1;
for (; mark<this->my_tail; ++mark) { // for each unheaped element
size_type cur_pos = mark;
input_type to_place;
this->fetch_item(mark,to_place);
do { // push to_place up the heap
size_type parent = (cur_pos-1)>>1;
if (!compare(this->get_my_item(parent), to_place))
break;
this->move_item(cur_pos, parent);
cur_pos = parent;
} while( cur_pos );
(void) this->place_item(cur_pos, to_place);
}
}
// otherwise heapified array with new root element; rearrange to heap
void reheap() {
size_type cur_pos=0, child=1;
while (child < mark) {
size_type target = child;
if (child+1<mark &&
compare(this->get_my_item(child),
this->get_my_item(child+1)))
++target;
// target now has the higher priority child
if (compare(this->get_my_item(target),
this->get_my_item(cur_pos)))
break;
// swap
this->swap_items(cur_pos, target);
cur_pos = target;
child = (cur_pos<<1)+1;
}
}
}; // priority_queue_node
} // interfaceX
namespace interface11 {
template< typename T, typename DecrementType=continue_msg >
class limiter_node : public graph_node, public receiver< T >, public sender< T > {
public:
typedef T input_type;
typedef T output_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename receiver<input_type>::built_predecessors_type built_predecessors_type;
typedef typename sender<output_type>::built_successors_type built_successors_type;
typedef typename receiver<input_type>::predecessor_list_type predecessor_list_type;
typedef typename sender<output_type>::successor_list_type successor_list_type;
#endif
//TODO: There is a lack of predefined types for its controlling "decrementer" port. It should be fixed later.
private:
size_t my_threshold;
size_t my_count; //number of successful puts
size_t my_tries; //number of active put attempts
internal::reservable_predecessor_cache< T, spin_mutex > my_predecessors;
spin_mutex my_mutex;
internal::broadcast_cache< T > my_successors;
__TBB_DEPRECATED_LIMITER_EXPR( int init_decrement_predecessors; )
friend class internal::forward_task_bypass< limiter_node<T,DecrementType> >;
// Let decrementer call decrement_counter()
friend class internal::decrementer< limiter_node<T,DecrementType>, DecrementType >;
bool check_conditions() { // always called under lock
return ( my_count + my_tries < my_threshold && !my_predecessors.empty() && !my_successors.empty() );
}
// only returns a valid task pointer or NULL, never SUCCESSFULLY_ENQUEUED
task *forward_task() {
input_type v;
task *rval = NULL;
bool reserved = false;
{
spin_mutex::scoped_lock lock(my_mutex);
if ( check_conditions() )
++my_tries;
else
return NULL;
}
//SUCCESS
// if we can reserve and can put, we consume the reservation
// we increment the count and decrement the tries
if ( (my_predecessors.try_reserve(v)) == true ){
reserved=true;
if ( (rval = my_successors.try_put_task(v)) != NULL ){
{
spin_mutex::scoped_lock lock(my_mutex);
++my_count;
--my_tries;
my_predecessors.try_consume();
if ( check_conditions() ) {
if ( internal::is_graph_active(this->my_graph) ) {
task *rtask = new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
internal::forward_task_bypass< limiter_node<T, DecrementType> >( *this );
internal::spawn_in_graph_arena(graph_reference(), *rtask);
}
}
}
return rval;
}
}
//FAILURE
//if we can't reserve, we decrement the tries
//if we can reserve but can't put, we decrement the tries and release the reservation
{
spin_mutex::scoped_lock lock(my_mutex);
--my_tries;
if (reserved) my_predecessors.try_release();
if ( check_conditions() ) {
if ( internal::is_graph_active(this->my_graph) ) {
task *rtask = new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
internal::forward_task_bypass< limiter_node<T, DecrementType> >( *this );
__TBB_ASSERT(!rval, "Have two tasks to handle");
return rtask;
}
}
return rval;
}
}
void forward() {
__TBB_ASSERT(false, "Should never be called");
return;
}
task* decrement_counter( long long delta ) {
{
spin_mutex::scoped_lock lock(my_mutex);
if( delta > 0 && size_t(delta) > my_count )
my_count = 0;
else if( delta < 0 && size_t(delta) > my_threshold - my_count )
my_count = my_threshold;
else
my_count -= size_t(delta); // absolute value of delta is sufficiently small
}
return forward_task();
}
void initialize() {
my_predecessors.set_owner(this);
my_successors.set_owner(this);
decrement.set_owner(this);
tbb::internal::fgt_node(
CODEPTR(), tbb::internal::FLOW_LIMITER_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<receiver<DecrementType> *>(&decrement),
static_cast<sender<output_type> *>(this)
);
}
public:
internal::decrementer< limiter_node<T, DecrementType>, DecrementType > decrement;
#if TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR
__TBB_STATIC_ASSERT( (tbb::internal::is_same_type<DecrementType, continue_msg>::value),
"Deprecated interface of the limiter node can be used only in conjunction "
"with continue_msg as the type of DecrementType template parameter." );
#endif // Check for incompatible interface
limiter_node(graph &g,
__TBB_DEPRECATED_LIMITER_ARG2(size_t threshold, int num_decrement_predecessors=0))
: graph_node(g), my_threshold(threshold), my_count(0),
__TBB_DEPRECATED_LIMITER_ARG4(
my_tries(0), decrement(),
init_decrement_predecessors(num_decrement_predecessors),
decrement(num_decrement_predecessors)) {
initialize();
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
limiter_node(const node_set<Args...>& nodes, size_t threshold)
: limiter_node(nodes.graph_reference(), threshold) {
make_edges_in_order(nodes, *this);
}
#endif
limiter_node( const limiter_node& src ) :
graph_node(src.my_graph), receiver<T>(), sender<T>(),
my_threshold(src.my_threshold), my_count(0),
__TBB_DEPRECATED_LIMITER_ARG4(
my_tries(0), decrement(),
init_decrement_predecessors(src.init_decrement_predecessors),
decrement(src.init_decrement_predecessors)) {
initialize();
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
bool register_successor( successor_type &r ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
bool was_empty = my_successors.empty();
my_successors.register_successor(r);
//spawn a forward task if this is the only successor
if ( was_empty && !my_predecessors.empty() && my_count + my_tries < my_threshold ) {
if ( internal::is_graph_active(this->my_graph) ) {
task* task = new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
internal::forward_task_bypass < limiter_node<T, DecrementType> >( *this );
internal::spawn_in_graph_arena(graph_reference(), *task);
}
}
return true;
}
bool remove_successor( successor_type &r ) __TBB_override {
r.remove_predecessor(*this);
my_successors.remove_successor(r);
return true;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
built_predecessors_type &built_predecessors() __TBB_override { return my_predecessors.built_predecessors(); }
void internal_add_built_successor(successor_type &src) __TBB_override {
my_successors.internal_add_built_successor(src);
}
void internal_delete_built_successor(successor_type &src) __TBB_override {
my_successors.internal_delete_built_successor(src);
}
size_t successor_count() __TBB_override { return my_successors.successor_count(); }
void copy_successors(successor_list_type &v) __TBB_override {
my_successors.copy_successors(v);
}
void internal_add_built_predecessor(predecessor_type &src) __TBB_override {
my_predecessors.internal_add_built_predecessor(src);
}
void internal_delete_built_predecessor(predecessor_type &src) __TBB_override {
my_predecessors.internal_delete_built_predecessor(src);
}
size_t predecessor_count() __TBB_override { return my_predecessors.predecessor_count(); }
void copy_predecessors(predecessor_list_type &v) __TBB_override {
my_predecessors.copy_predecessors(v);
}
void extract() __TBB_override {
my_count = 0;
my_successors.built_successors().sender_extract(*this);
my_predecessors.built_predecessors().receiver_extract(*this);
decrement.built_predecessors().receiver_extract(decrement);
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
bool register_predecessor( predecessor_type &src ) __TBB_override {
spin_mutex::scoped_lock lock(my_mutex);
my_predecessors.add( src );
if ( my_count + my_tries < my_threshold && !my_successors.empty() && internal::is_graph_active(this->my_graph) ) {
task* task = new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
internal::forward_task_bypass < limiter_node<T, DecrementType> >( *this );
internal::spawn_in_graph_arena(graph_reference(), *task);
}
return true;
}
bool remove_predecessor( predecessor_type &src ) __TBB_override {
my_predecessors.remove( src );
return true;
}
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
task *try_put_task( const T &t ) __TBB_override {
{
spin_mutex::scoped_lock lock(my_mutex);
if ( my_count + my_tries >= my_threshold )
return NULL;
else
++my_tries;
}
task * rtask = my_successors.try_put_task(t);
if ( !rtask ) { // try_put_task failed.
spin_mutex::scoped_lock lock(my_mutex);
--my_tries;
if (check_conditions() && internal::is_graph_active(this->my_graph)) {
rtask = new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
internal::forward_task_bypass< limiter_node<T, DecrementType> >( *this );
}
}
else {
spin_mutex::scoped_lock lock(my_mutex);
++my_count;
--my_tries;
}
return rtask;
}
graph& graph_reference() const __TBB_override { return my_graph; }
void reset_receiver(reset_flags /*f*/) __TBB_override {
__TBB_ASSERT(false,NULL); // should never be called
}
void reset_node( reset_flags f) __TBB_override {
my_count = 0;
if(f & rf_clear_edges) {
my_predecessors.clear();
my_successors.clear();
}
else
{
my_predecessors.reset( );
}
decrement.reset_receiver(f);
}
}; // limiter_node
#include "internal/_flow_graph_join_impl.h"
using internal::reserving_port;
using internal::queueing_port;
using internal::key_matching_port;
using internal::input_port;
using internal::tag_value;
template<typename OutputTuple, typename JP=queueing> class join_node;
template<typename OutputTuple>
class join_node<OutputTuple,reserving>: public internal::unfolded_join_node<tbb::flow::tuple_size<OutputTuple>::value, reserving_port, OutputTuple, reserving> {
private:
static const int N = tbb::flow::tuple_size<OutputTuple>::value;
typedef typename internal::unfolded_join_node<N, reserving_port, OutputTuple, reserving> unfolded_type;
public:
typedef OutputTuple output_type;
typedef typename unfolded_type::input_ports_type input_ports_type;
__TBB_NOINLINE_SYM explicit join_node(graph &g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
__TBB_NOINLINE_SYM join_node(const node_set<Args...>& nodes, reserving = reserving()) : join_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM join_node(const join_node &other) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_RESERVING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
template<typename OutputTuple>
class join_node<OutputTuple,queueing>: public internal::unfolded_join_node<tbb::flow::tuple_size<OutputTuple>::value, queueing_port, OutputTuple, queueing> {
private:
static const int N = tbb::flow::tuple_size<OutputTuple>::value;
typedef typename internal::unfolded_join_node<N, queueing_port, OutputTuple, queueing> unfolded_type;
public:
typedef OutputTuple output_type;
typedef typename unfolded_type::input_ports_type input_ports_type;
__TBB_NOINLINE_SYM explicit join_node(graph &g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
__TBB_NOINLINE_SYM join_node(const node_set<Args...>& nodes, queueing = queueing()) : join_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM join_node(const join_node &other) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_QUEUEING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
// template for key_matching join_node
// tag_matching join_node is a specialization of key_matching, and is source-compatible.
template<typename OutputTuple, typename K, typename KHash>
class join_node<OutputTuple, key_matching<K, KHash> > : public internal::unfolded_join_node<tbb::flow::tuple_size<OutputTuple>::value,
key_matching_port, OutputTuple, key_matching<K,KHash> > {
private:
static const int N = tbb::flow::tuple_size<OutputTuple>::value;
typedef typename internal::unfolded_join_node<N, key_matching_port, OutputTuple, key_matching<K,KHash> > unfolded_type;
public:
typedef OutputTuple output_type;
typedef typename unfolded_type::input_ports_type input_ports_type;
#if __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING
join_node(graph &g) : unfolded_type(g) {}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
join_node(const node_set<Args...>& nodes, key_matching<K, KHash> = key_matching<K, KHash>())
: join_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
#endif /* __TBB_PREVIEW_MESSAGE_BASED_KEY_MATCHING */
template<typename __TBB_B0, typename __TBB_B1>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1) : unfolded_type(g, b0, b1) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2) : unfolded_type(g, b0, b1, b2) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3) : unfolded_type(g, b0, b1, b2, b3) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3, typename __TBB_B4>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4) :
unfolded_type(g, b0, b1, b2, b3, b4) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_VARIADIC_MAX >= 6
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3, typename __TBB_B4,
typename __TBB_B5>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5) :
unfolded_type(g, b0, b1, b2, b3, b4, b5) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#endif
#if __TBB_VARIADIC_MAX >= 7
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3, typename __TBB_B4,
typename __TBB_B5, typename __TBB_B6>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6) :
unfolded_type(g, b0, b1, b2, b3, b4, b5, b6) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#endif
#if __TBB_VARIADIC_MAX >= 8
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3, typename __TBB_B4,
typename __TBB_B5, typename __TBB_B6, typename __TBB_B7>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6,
__TBB_B7 b7) : unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#endif
#if __TBB_VARIADIC_MAX >= 9
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3, typename __TBB_B4,
typename __TBB_B5, typename __TBB_B6, typename __TBB_B7, typename __TBB_B8>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6,
__TBB_B7 b7, __TBB_B8 b8) : unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#endif
#if __TBB_VARIADIC_MAX >= 10
template<typename __TBB_B0, typename __TBB_B1, typename __TBB_B2, typename __TBB_B3, typename __TBB_B4,
typename __TBB_B5, typename __TBB_B6, typename __TBB_B7, typename __TBB_B8, typename __TBB_B9>
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6,
__TBB_B7 b7, __TBB_B8 b8, __TBB_B9 b9) : unfolded_type(g, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#endif
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args, typename... Bodies>
__TBB_NOINLINE_SYM join_node(const node_set<Args...>& nodes, Bodies... bodies)
: join_node(nodes.graph_reference(), bodies...) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM join_node(const join_node &other) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_JOIN_NODE_TAG_MATCHING, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
// indexer node
#include "internal/_flow_graph_indexer_impl.h"
// TODO: Implement interface with variadic template or tuple
template<typename T0, typename T1=null_type, typename T2=null_type, typename T3=null_type,
typename T4=null_type, typename T5=null_type, typename T6=null_type,
typename T7=null_type, typename T8=null_type, typename T9=null_type> class indexer_node;
//indexer node specializations
template<typename T0>
class indexer_node<T0> : public internal::unfolded_indexer_node<tuple<T0> > {
private:
static const int N = 1;
public:
typedef tuple<T0> InputTuple;
typedef typename internal::tagged_msg<size_t, T0> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
template<typename T0, typename T1>
class indexer_node<T0, T1> : public internal::unfolded_indexer_node<tuple<T0, T1> > {
private:
static const int N = 2;
public:
typedef tuple<T0, T1> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
template<typename T0, typename T1, typename T2>
class indexer_node<T0, T1, T2> : public internal::unfolded_indexer_node<tuple<T0, T1, T2> > {
private:
static const int N = 3;
public:
typedef tuple<T0, T1, T2> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
template<typename T0, typename T1, typename T2, typename T3>
class indexer_node<T0, T1, T2, T3> : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3> > {
private:
static const int N = 4;
public:
typedef tuple<T0, T1, T2, T3> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
template<typename T0, typename T1, typename T2, typename T3, typename T4>
class indexer_node<T0, T1, T2, T3, T4> : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4> > {
private:
static const int N = 5;
public:
typedef tuple<T0, T1, T2, T3, T4> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
#if __TBB_VARIADIC_MAX >= 6
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5>
class indexer_node<T0, T1, T2, T3, T4, T5> : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5> > {
private:
static const int N = 6;
public:
typedef tuple<T0, T1, T2, T3, T4, T5> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
#endif //variadic max 6
#if __TBB_VARIADIC_MAX >= 7
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
class indexer_node<T0, T1, T2, T3, T4, T5, T6> : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6> > {
private:
static const int N = 7;
public:
typedef tuple<T0, T1, T2, T3, T4, T5, T6> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
#endif //variadic max 7
#if __TBB_VARIADIC_MAX >= 8
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
class indexer_node<T0, T1, T2, T3, T4, T5, T6, T7> : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6, T7> > {
private:
static const int N = 8;
public:
typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6, T7> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
#endif //variadic max 8
#if __TBB_VARIADIC_MAX >= 9
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
class indexer_node<T0, T1, T2, T3, T4, T5, T6, T7, T8> : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> > {
private:
static const int N = 9;
public:
typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
#endif //variadic max 9
#if __TBB_VARIADIC_MAX >= 10
template<typename T0, typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
class indexer_node/*default*/ : public internal::unfolded_indexer_node<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> > {
private:
static const int N = 10;
public:
typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> InputTuple;
typedef typename internal::tagged_msg<size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> output_type;
typedef typename internal::unfolded_indexer_node<InputTuple> unfolded_type;
__TBB_NOINLINE_SYM indexer_node(graph& g) : unfolded_type(g) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
indexer_node(const node_set<Args...>& nodes) : indexer_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
// Copy constructor
__TBB_NOINLINE_SYM indexer_node( const indexer_node& other ) : unfolded_type(other) {
tbb::internal::fgt_multiinput_node<N>( CODEPTR(), tbb::internal::FLOW_INDEXER_NODE, &this->my_graph,
this->input_ports(), static_cast< sender< output_type > *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
};
#endif //variadic max 10
#if __TBB_PREVIEW_ASYNC_MSG
inline void internal_make_edge( internal::untyped_sender &p, internal::untyped_receiver &s ) {
#else
template< typename T >
inline void internal_make_edge( sender<T> &p, receiver<T> &s ) {
#endif
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
s.internal_add_built_predecessor(p);
p.internal_add_built_successor(s);
#endif
p.register_successor( s );
tbb::internal::fgt_make_edge( &p, &s );
}
template< typename T >
inline void make_edge( sender<T> &p, receiver<T> &s ) {
internal_make_edge( p, s );
}
#if __TBB_PREVIEW_ASYNC_MSG
template< typename TS, typename TR,
typename = typename tbb::internal::enable_if<tbb::internal::is_same_type<TS, internal::untyped_sender>::value
|| tbb::internal::is_same_type<TR, internal::untyped_receiver>::value>::type>
inline void make_edge( TS &p, TR &s ) {
internal_make_edge( p, s );
}
template< typename T >
inline void make_edge( sender<T> &p, receiver<typename T::async_msg_data_type> &s ) {
internal_make_edge( p, s );
}
template< typename T >
inline void make_edge( sender<typename T::async_msg_data_type> &p, receiver<T> &s ) {
internal_make_edge( p, s );
}
#endif // __TBB_PREVIEW_ASYNC_MSG
#if __TBB_FLOW_GRAPH_CPP11_FEATURES
//Makes an edge from port 0 of a multi-output predecessor to port 0 of a multi-input successor.
template< typename T, typename V,
typename = typename T::output_ports_type, typename = typename V::input_ports_type >
inline void make_edge( T& output, V& input) {
make_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
}
//Makes an edge from port 0 of a multi-output predecessor to a receiver.
template< typename T, typename R,
typename = typename T::output_ports_type >
inline void make_edge( T& output, receiver<R>& input) {
make_edge(get<0>(output.output_ports()), input);
}
//Makes an edge from a sender to port 0 of a multi-input successor.
template< typename S, typename V,
typename = typename V::input_ports_type >
inline void make_edge( sender<S>& output, V& input) {
make_edge(output, get<0>(input.input_ports()));
}
#endif
#if __TBB_PREVIEW_ASYNC_MSG
inline void internal_remove_edge( internal::untyped_sender &p, internal::untyped_receiver &s ) {
#else
template< typename T >
inline void internal_remove_edge( sender<T> &p, receiver<T> &s ) {
#endif
p.remove_successor( s );
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
// TODO: should we try to remove p from the predecessor list of s, in case the edge is reversed?
p.internal_delete_built_successor(s);
s.internal_delete_built_predecessor(p);
#endif
tbb::internal::fgt_remove_edge( &p, &s );
}
template< typename T >
inline void remove_edge( sender<T> &p, receiver<T> &s ) {
internal_remove_edge( p, s );
}
#if __TBB_PREVIEW_ASYNC_MSG
template< typename TS, typename TR,
typename = typename tbb::internal::enable_if<tbb::internal::is_same_type<TS, internal::untyped_sender>::value
|| tbb::internal::is_same_type<TR, internal::untyped_receiver>::value>::type>
inline void remove_edge( TS &p, TR &s ) {
internal_remove_edge( p, s );
}
template< typename T >
inline void remove_edge( sender<T> &p, receiver<typename T::async_msg_data_type> &s ) {
internal_remove_edge( p, s );
}
template< typename T >
inline void remove_edge( sender<typename T::async_msg_data_type> &p, receiver<T> &s ) {
internal_remove_edge( p, s );
}
#endif // __TBB_PREVIEW_ASYNC_MSG
#if __TBB_FLOW_GRAPH_CPP11_FEATURES
//Removes an edge between port 0 of a multi-output predecessor and port 0 of a multi-input successor.
template< typename T, typename V,
typename = typename T::output_ports_type, typename = typename V::input_ports_type >
inline void remove_edge( T& output, V& input) {
remove_edge(get<0>(output.output_ports()), get<0>(input.input_ports()));
}
//Removes an edge between port 0 of a multi-output predecessor and a receiver.
template< typename T, typename R,
typename = typename T::output_ports_type >
inline void remove_edge( T& output, receiver<R>& input) {
remove_edge(get<0>(output.output_ports()), input);
}
//Removes an edge between a sender and port 0 of a multi-input successor.
template< typename S, typename V,
typename = typename V::input_ports_type >
inline void remove_edge( sender<S>& output, V& input) {
remove_edge(output, get<0>(input.input_ports()));
}
#endif
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
template<typename C >
template< typename S >
void internal::edge_container<C>::sender_extract( S &s ) {
edge_list_type e = built_edges;
for ( typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
remove_edge(s, **i);
}
}
template<typename C >
template< typename R >
void internal::edge_container<C>::receiver_extract( R &r ) {
edge_list_type e = built_edges;
for ( typename edge_list_type::iterator i = e.begin(); i != e.end(); ++i ) {
remove_edge(**i, r);
}
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
template< typename Body, typename Node >
Body copy_body( Node &n ) {
return n.template copy_function_object<Body>();
}
#if __TBB_FLOW_GRAPH_CPP11_FEATURES
//composite_node
template< typename InputTuple, typename OutputTuple > class composite_node;
template< typename... InputTypes, typename... OutputTypes>
class composite_node <tbb::flow::tuple<InputTypes...>, tbb::flow::tuple<OutputTypes...> > : public graph_node{
public:
typedef tbb::flow::tuple< receiver<InputTypes>&... > input_ports_type;
typedef tbb::flow::tuple< sender<OutputTypes>&... > output_ports_type;
private:
std::unique_ptr<input_ports_type> my_input_ports;
std::unique_ptr<output_ports_type> my_output_ports;
static const size_t NUM_INPUTS = sizeof...(InputTypes);
static const size_t NUM_OUTPUTS = sizeof...(OutputTypes);
protected:
void reset_node(reset_flags) __TBB_override {}
public:
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
composite_node( graph &g, const char *type_name = "composite_node" ) : graph_node(g) {
tbb::internal::fgt_multiinput_multioutput_node( CODEPTR(), tbb::internal::FLOW_COMPOSITE_NODE, this, &this->my_graph );
tbb::internal::fgt_multiinput_multioutput_node_desc( this, type_name );
}
#else
composite_node( graph &g ) : graph_node(g) {
tbb::internal::fgt_multiinput_multioutput_node( CODEPTR(), tbb::internal::FLOW_COMPOSITE_NODE, this, &this->my_graph );
}
#endif
template<typename T1, typename T2>
void set_external_ports(T1&& input_ports_tuple, T2&& output_ports_tuple) {
__TBB_STATIC_ASSERT(NUM_INPUTS == tbb::flow::tuple_size<input_ports_type>::value, "number of arguments does not match number of input ports");
__TBB_STATIC_ASSERT(NUM_OUTPUTS == tbb::flow::tuple_size<output_ports_type>::value, "number of arguments does not match number of output ports");
my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T1>(input_ports_tuple));
my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T2>(output_ports_tuple));
tbb::internal::fgt_internal_input_alias_helper<T1, NUM_INPUTS>::alias_port( this, input_ports_tuple);
tbb::internal::fgt_internal_output_alias_helper<T2, NUM_OUTPUTS>::alias_port( this, output_ports_tuple);
}
template< typename... NodeTypes >
void add_visible_nodes(const NodeTypes&... n) { internal::add_nodes_impl(this, true, n...); }
template< typename... NodeTypes >
void add_nodes(const NodeTypes&... n) { internal::add_nodes_impl(this, false, n...); }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multiinput_multioutput_node_desc( this, name );
}
#endif
input_ports_type& input_ports() {
__TBB_ASSERT(my_input_ports, "input ports not set, call set_external_ports to set input ports");
return *my_input_ports;
}
output_ports_type& output_ports() {
__TBB_ASSERT(my_output_ports, "output ports not set, call set_external_ports to set output ports");
return *my_output_ports;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract() __TBB_override {
__TBB_ASSERT(false, "Current composite_node implementation does not support extract");
}
#endif
}; // class composite_node
//composite_node with only input ports
template< typename... InputTypes>
class composite_node <tbb::flow::tuple<InputTypes...>, tbb::flow::tuple<> > : public graph_node {
public:
typedef tbb::flow::tuple< receiver<InputTypes>&... > input_ports_type;
private:
std::unique_ptr<input_ports_type> my_input_ports;
static const size_t NUM_INPUTS = sizeof...(InputTypes);
protected:
void reset_node(reset_flags) __TBB_override {}
public:
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
composite_node( graph &g, const char *type_name = "composite_node") : graph_node(g) {
tbb::internal::fgt_composite( CODEPTR(), this, &g );
tbb::internal::fgt_multiinput_multioutput_node_desc( this, type_name );
}
#else
composite_node( graph &g ) : graph_node(g) {
tbb::internal::fgt_composite( CODEPTR(), this, &g );
}
#endif
template<typename T>
void set_external_ports(T&& input_ports_tuple) {
__TBB_STATIC_ASSERT(NUM_INPUTS == tbb::flow::tuple_size<input_ports_type>::value, "number of arguments does not match number of input ports");
my_input_ports = tbb::internal::make_unique<input_ports_type>(std::forward<T>(input_ports_tuple));
tbb::internal::fgt_internal_input_alias_helper<T, NUM_INPUTS>::alias_port( this, std::forward<T>(input_ports_tuple));
}
template< typename... NodeTypes >
void add_visible_nodes(const NodeTypes&... n) { internal::add_nodes_impl(this, true, n...); }
template< typename... NodeTypes >
void add_nodes( const NodeTypes&... n) { internal::add_nodes_impl(this, false, n...); }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multiinput_multioutput_node_desc( this, name );
}
#endif
input_ports_type& input_ports() {
__TBB_ASSERT(my_input_ports, "input ports not set, call set_external_ports to set input ports");
return *my_input_ports;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract() __TBB_override {
__TBB_ASSERT(false, "Current composite_node implementation does not support extract");
}
#endif
}; // class composite_node
//composite_nodes with only output_ports
template<typename... OutputTypes>
class composite_node <tbb::flow::tuple<>, tbb::flow::tuple<OutputTypes...> > : public graph_node {
public:
typedef tbb::flow::tuple< sender<OutputTypes>&... > output_ports_type;
private:
std::unique_ptr<output_ports_type> my_output_ports;
static const size_t NUM_OUTPUTS = sizeof...(OutputTypes);
protected:
void reset_node(reset_flags) __TBB_override {}
public:
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
__TBB_NOINLINE_SYM composite_node( graph &g, const char *type_name = "composite_node") : graph_node(g) {
tbb::internal::fgt_composite( CODEPTR(), this, &g );
tbb::internal::fgt_multiinput_multioutput_node_desc( this, type_name );
}
#else
__TBB_NOINLINE_SYM composite_node( graph &g ) : graph_node(g) {
tbb::internal::fgt_composite( CODEPTR(), this, &g );
}
#endif
template<typename T>
void set_external_ports(T&& output_ports_tuple) {
__TBB_STATIC_ASSERT(NUM_OUTPUTS == tbb::flow::tuple_size<output_ports_type>::value, "number of arguments does not match number of output ports");
my_output_ports = tbb::internal::make_unique<output_ports_type>(std::forward<T>(output_ports_tuple));
tbb::internal::fgt_internal_output_alias_helper<T, NUM_OUTPUTS>::alias_port( this, std::forward<T>(output_ports_tuple));
}
template<typename... NodeTypes >
void add_visible_nodes(const NodeTypes&... n) { internal::add_nodes_impl(this, true, n...); }
template<typename... NodeTypes >
void add_nodes(const NodeTypes&... n) { internal::add_nodes_impl(this, false, n...); }
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multiinput_multioutput_node_desc( this, name );
}
#endif
output_ports_type& output_ports() {
__TBB_ASSERT(my_output_ports, "output ports not set, call set_external_ports to set output ports");
return *my_output_ports;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
void extract() __TBB_override {
__TBB_ASSERT(false, "Current composite_node implementation does not support extract");
}
#endif
}; // class composite_node
#endif // __TBB_FLOW_GRAPH_CPP11_FEATURES
namespace internal {
template<typename Gateway>
class async_body_base: tbb::internal::no_assign {
public:
typedef Gateway gateway_type;
async_body_base(gateway_type *gateway): my_gateway(gateway) { }
void set_gateway(gateway_type *gateway) {
my_gateway = gateway;
}
protected:
gateway_type *my_gateway;
};
template<typename Input, typename Ports, typename Gateway, typename Body>
class async_body: public async_body_base<Gateway> {
public:
typedef async_body_base<Gateway> base_type;
typedef Gateway gateway_type;
async_body(const Body &body, gateway_type *gateway)
: base_type(gateway), my_body(body) { }
void operator()( const Input &v, Ports & ) {
my_body(v, *this->my_gateway);
}
Body get_body() { return my_body; }
private:
Body my_body;
};
} // namespace internal
} // namespace interfaceX
namespace interface11 {
template < typename Input, typename Output,
typename Policy = queueing_lightweight,
typename Allocator=cache_aligned_allocator<Input> >
class async_node : public multifunction_node< Input, tuple< Output >, Policy, Allocator >, public sender< Output > {
typedef multifunction_node< Input, tuple< Output >, Policy, Allocator > base_type;
typedef typename internal::multifunction_input<Input, typename base_type::output_ports_type, Policy, Allocator> mfn_input_type;
public:
typedef Input input_type;
typedef Output output_type;
typedef receiver<input_type> receiver_type;
typedef typename receiver_type::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
typedef receiver_gateway<output_type> gateway_type;
typedef internal::async_body_base<gateway_type> async_body_base_type;
typedef typename base_type::output_ports_type output_ports_type;
private:
struct try_put_functor {
typedef internal::multifunction_output<Output> output_port_type;
output_port_type *port;
// TODO: pass value by copy since we do not want to block asynchronous thread.
const Output *value;
bool result;
try_put_functor(output_port_type &p, const Output &v) : port(&p), value(&v), result(false) { }
void operator()() {
result = port->try_put(*value);
}
};
class receiver_gateway_impl: public receiver_gateway<Output> {
public:
receiver_gateway_impl(async_node* node): my_node(node) {}
void reserve_wait() __TBB_override {
tbb::internal::fgt_async_reserve(static_cast<typename async_node::receiver_type *>(my_node), &my_node->my_graph);
my_node->my_graph.reserve_wait();
}
void release_wait() __TBB_override {
my_node->my_graph.release_wait();
tbb::internal::fgt_async_commit(static_cast<typename async_node::receiver_type *>(my_node), &my_node->my_graph);
}
bool try_put(const Output &i) __TBB_override {
return my_node->try_put_impl(i);
}
private:
async_node* my_node;
} my_gateway;
//The substitute of 'this' for member construction, to prevent compiler warnings
async_node* self() { return this; }
bool try_put_impl(const Output &i) {
internal::multifunction_output<Output> &port_0 = internal::output_port<0>(*this);
internal::broadcast_cache<output_type>& port_successors = port_0.successors();
tbb::internal::fgt_async_try_put_begin(this, &port_0);
task_list tasks;
bool is_at_least_one_put_successful = port_successors.gather_successful_try_puts(i, tasks);
__TBB_ASSERT( is_at_least_one_put_successful || tasks.empty(),
"Return status is inconsistent with the method operation." );
while( !tasks.empty() ) {
internal::enqueue_in_graph_arena(this->my_graph, tasks.pop_front());
}
tbb::internal::fgt_async_try_put_end(this, &port_0);
return is_at_least_one_put_successful;
}
public:
template<typename Body>
__TBB_NOINLINE_SYM async_node(
graph &g, size_t concurrency,
#if __TBB_CPP11_PRESENT
Body body, __TBB_FLOW_GRAPH_PRIORITY_ARG1(Policy = Policy(), node_priority_t priority = tbb::flow::internal::no_priority)
#else
__TBB_FLOW_GRAPH_PRIORITY_ARG1(Body body, node_priority_t priority = tbb::flow::internal::no_priority)
#endif
) : base_type(
g, concurrency,
internal::async_body<Input, typename base_type::output_ports_type, gateway_type, Body>
(body, &my_gateway) __TBB_FLOW_GRAPH_PRIORITY_ARG0(priority) ), my_gateway(self()) {
tbb::internal::fgt_multioutput_node_with_body<1>(
CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
&this->my_graph, static_cast<receiver<input_type> *>(this),
this->output_ports(), this->my_body
);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES && __TBB_CPP11_PRESENT
template <typename Body, typename... Args>
__TBB_NOINLINE_SYM async_node(graph& g, size_t concurrency, Body body, node_priority_t priority)
: async_node(g, concurrency, body, Policy(), priority) {}
#endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename Body, typename... Args>
__TBB_NOINLINE_SYM async_node(
const node_set<Args...>& nodes, size_t concurrency, Body body,
__TBB_FLOW_GRAPH_PRIORITY_ARG1(Policy = Policy(), node_priority_t priority = tbb::flow::internal::no_priority)
) : async_node(nodes.graph_reference(), concurrency, __TBB_FLOW_GRAPH_PRIORITY_ARG1(body, priority)) {
make_edges_in_order(nodes, *this);
}
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
template <typename Body, typename... Args>
__TBB_NOINLINE_SYM async_node(const node_set<Args...>& nodes, size_t concurrency, Body body, node_priority_t priority)
: async_node(nodes, concurrency, body, Policy(), priority) {}
#endif // __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
#endif // __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
__TBB_NOINLINE_SYM async_node( const async_node &other ) : base_type(other), sender<Output>(), my_gateway(self()) {
static_cast<async_body_base_type*>(this->my_body->get_body_ptr())->set_gateway(&my_gateway);
static_cast<async_body_base_type*>(this->my_init_body->get_body_ptr())->set_gateway(&my_gateway);
tbb::internal::fgt_multioutput_node_with_body<1>( CODEPTR(), tbb::internal::FLOW_ASYNC_NODE,
&this->my_graph, static_cast<receiver<input_type> *>(this),
this->output_ports(), this->my_body );
}
gateway_type& gateway() {
return my_gateway;
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_multioutput_node_desc( this, name );
}
#endif
// Define sender< Output >
bool register_successor( successor_type &r ) __TBB_override {
return internal::output_port<0>(*this).register_successor(r);
}
bool remove_successor( successor_type &r ) __TBB_override {
return internal::output_port<0>(*this).remove_successor(r);
}
template<typename Body>
Body copy_function_object() {
typedef internal::multifunction_body<input_type, typename base_type::output_ports_type> mfn_body_type;
typedef internal::async_body<Input, typename base_type::output_ports_type, gateway_type, Body> async_body_type;
mfn_body_type &body_ref = *this->my_body;
async_body_type ab = *static_cast<async_body_type*>(dynamic_cast< internal::multifunction_body_leaf<input_type, typename base_type::output_ports_type, async_body_type> & >(body_ref).get_body_ptr());
return ab.get_body();
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename internal::edge_container<successor_type> built_successors_type;
typedef typename built_successors_type::edge_list_type successor_list_type;
built_successors_type &built_successors() __TBB_override {
return internal::output_port<0>(*this).built_successors();
}
void internal_add_built_successor( successor_type &r ) __TBB_override {
internal::output_port<0>(*this).internal_add_built_successor(r);
}
void internal_delete_built_successor( successor_type &r ) __TBB_override {
internal::output_port<0>(*this).internal_delete_built_successor(r);
}
void copy_successors( successor_list_type &l ) __TBB_override {
internal::output_port<0>(*this).copy_successors(l);
}
size_t successor_count() __TBB_override {
return internal::output_port<0>(*this).successor_count();
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
protected:
void reset_node( reset_flags f) __TBB_override {
base_type::reset_node(f);
}
};
#if __TBB_PREVIEW_STREAMING_NODE
#include "internal/_flow_graph_streaming_node.h"
#endif // __TBB_PREVIEW_STREAMING_NODE
#include "internal/_flow_graph_node_set_impl.h"
template< typename T >
class overwrite_node : public graph_node, public receiver<T>, public sender<T> {
public:
typedef T input_type;
typedef T output_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
typedef typename receiver<input_type>::built_predecessors_type built_predecessors_type;
typedef typename sender<output_type>::built_successors_type built_successors_type;
typedef typename receiver<input_type>::predecessor_list_type predecessor_list_type;
typedef typename sender<output_type>::successor_list_type successor_list_type;
#endif
__TBB_NOINLINE_SYM explicit overwrite_node(graph &g) : graph_node(g), my_buffer_is_valid(false) {
my_successors.set_owner( this );
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_OVERWRITE_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
overwrite_node(const node_set<Args...>& nodes) : overwrite_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM overwrite_node( const overwrite_node& src ) :
graph_node(src.my_graph), receiver<T>(), sender<T>(), my_buffer_is_valid(false)
{
my_successors.set_owner( this );
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_OVERWRITE_NODE, &this->my_graph,
static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
}
~overwrite_node() {}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
bool register_successor( successor_type &s ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
if (my_buffer_is_valid && internal::is_graph_active( my_graph )) {
// We have a valid value that must be forwarded immediately.
bool ret = s.try_put( my_buffer );
if ( ret ) {
// We add the successor that accepted our put
my_successors.register_successor( s );
} else {
// In case of reservation a race between the moment of reservation and register_successor can appear,
// because failed reserve does not mean that register_successor is not ready to put a message immediately.
// We have some sort of infinite loop: reserving node tries to set pull state for the edge,
// but overwrite_node tries to return push state back. That is why we have to break this loop with task creation.
task *rtask = new ( task::allocate_additional_child_of( *( my_graph.root_task() ) ) )
register_predecessor_task( *this, s );
internal::spawn_in_graph_arena( my_graph, *rtask );
}
} else {
// No valid value yet, just add as successor
my_successors.register_successor( s );
}
return true;
}
bool remove_successor( successor_type &s ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.remove_successor(s);
return true;
}
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
built_predecessors_type &built_predecessors() __TBB_override { return my_built_predecessors; }
built_successors_type &built_successors() __TBB_override { return my_successors.built_successors(); }
void internal_add_built_successor( successor_type &s) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.internal_add_built_successor(s);
}
void internal_delete_built_successor( successor_type &s) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.internal_delete_built_successor(s);
}
size_t successor_count() __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
return my_successors.successor_count();
}
void copy_successors(successor_list_type &v) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_successors.copy_successors(v);
}
void internal_add_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_built_predecessors.add_edge(p);
}
void internal_delete_built_predecessor( predecessor_type &p) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_built_predecessors.delete_edge(p);
}
size_t predecessor_count() __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
return my_built_predecessors.edge_count();
}
void copy_predecessors( predecessor_list_type &v ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
my_built_predecessors.copy_edges(v);
}
void extract() __TBB_override {
my_buffer_is_valid = false;
built_successors().sender_extract(*this);
built_predecessors().receiver_extract(*this);
}
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
bool try_get( input_type &v ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
if ( my_buffer_is_valid ) {
v = my_buffer;
return true;
}
return false;
}
bool try_reserve( T &v ) __TBB_override {
return try_get(v);
}
bool try_release() __TBB_override { return true; }
bool try_consume() __TBB_override { return true; }
bool is_valid() {
spin_mutex::scoped_lock l( my_mutex );
return my_buffer_is_valid;
}
void clear() {
spin_mutex::scoped_lock l( my_mutex );
my_buffer_is_valid = false;
}
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
task * try_put_task( const input_type &v ) __TBB_override {
spin_mutex::scoped_lock l( my_mutex );
return try_put_task_impl(v);
}
task * try_put_task_impl(const input_type &v) {
my_buffer = v;
my_buffer_is_valid = true;
task * rtask = my_successors.try_put_task(v);
if (!rtask) rtask = SUCCESSFULLY_ENQUEUED;
return rtask;
}
graph& graph_reference() const __TBB_override {
return my_graph;
}
struct register_predecessor_task : public graph_task {
register_predecessor_task(predecessor_type& owner, successor_type& succ) :
o(owner), s(succ) {};
tbb::task* execute() __TBB_override {
if (!s.register_predecessor(o)) {
o.register_successor(s);
}
return NULL;
}
predecessor_type& o;
successor_type& s;
};
spin_mutex my_mutex;
internal::broadcast_cache< input_type, null_rw_mutex > my_successors;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
internal::edge_container<predecessor_type> my_built_predecessors;
#endif
input_type my_buffer;
bool my_buffer_is_valid;
void reset_receiver(reset_flags /*f*/) __TBB_override {}
void reset_node( reset_flags f) __TBB_override {
my_buffer_is_valid = false;
if (f&rf_clear_edges) {
my_successors.clear();
}
}
}; // overwrite_node
template< typename T >
class write_once_node : public overwrite_node<T> {
public:
typedef T input_type;
typedef T output_type;
typedef overwrite_node<T> base_type;
typedef typename receiver<input_type>::predecessor_type predecessor_type;
typedef typename sender<output_type>::successor_type successor_type;
__TBB_NOINLINE_SYM explicit write_once_node(graph& g) : base_type(g) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_WRITE_ONCE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
template <typename... Args>
write_once_node(const node_set<Args...>& nodes) : write_once_node(nodes.graph_reference()) {
make_edges_in_order(nodes, *this);
}
#endif
__TBB_NOINLINE_SYM write_once_node( const write_once_node& src ) : base_type(src) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_WRITE_ONCE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}
#if TBB_PREVIEW_FLOW_GRAPH_TRACE
void set_name( const char *name ) __TBB_override {
tbb::internal::fgt_node_desc( this, name );
}
#endif
protected:
template< typename R, typename B > friend class run_and_put_task;
template<typename X, typename Y> friend class internal::broadcast_cache;
template<typename X, typename Y> friend class internal::round_robin_cache;
task *try_put_task( const T &v ) __TBB_override {
spin_mutex::scoped_lock l( this->my_mutex );
return this->my_buffer_is_valid ? NULL : this->try_put_task_impl(v);
}
};
} // interfaceX
using interface11::reset_flags;
using interface11::rf_reset_protocol;
using interface11::rf_reset_bodies;
using interface11::rf_clear_edges;
using interface11::graph;
using interface11::graph_node;
using interface11::continue_msg;
using interface11::source_node;
using interface11::function_node;
using interface11::multifunction_node;
using interface11::split_node;
using interface11::internal::output_port;
using interface11::indexer_node;
using interface11::internal::tagged_msg;
using interface11::internal::cast_to;
using interface11::internal::is_a;
using interface11::continue_node;
using interface11::overwrite_node;
using interface11::write_once_node;
using interface11::broadcast_node;
using interface11::buffer_node;
using interface11::queue_node;
using interface11::sequencer_node;
using interface11::priority_queue_node;
using interface11::limiter_node;
using namespace interface11::internal::graph_policy_namespace;
using interface11::join_node;
using interface11::input_port;
using interface11::copy_body;
using interface11::make_edge;
using interface11::remove_edge;
using interface11::internal::tag_value;
#if __TBB_FLOW_GRAPH_CPP11_FEATURES
using interface11::composite_node;
#endif
using interface11::async_node;
#if __TBB_PREVIEW_ASYNC_MSG
using interface11::async_msg;
#endif
#if __TBB_PREVIEW_STREAMING_NODE
using interface11::port_ref;
using interface11::streaming_node;
#endif // __TBB_PREVIEW_STREAMING_NODE
#if __TBB_PREVIEW_FLOW_GRAPH_PRIORITIES
using internal::node_priority_t;
using internal::no_priority;
#endif
#if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
using interface11::internal::follows;
using interface11::internal::precedes;
using interface11::internal::make_node_set;
using interface11::internal::make_edges;
#endif
} // flow
} // tbb
// Include deduction guides for node classes
#include "internal/_flow_graph_nodes_deduction.h"
#undef __TBB_PFG_RESET_ARG
#undef __TBB_COMMA
#include "internal/_warning_suppress_disable_notice.h"
#undef __TBB_flow_graph_H_include_area
#if TBB_USE_THREADING_TOOLS && TBB_PREVIEW_FLOW_GRAPH_TRACE && ( __linux__ || __APPLE__ )
#undef __TBB_NOINLINE_SYM
#endif
#endif // __TBB_flow_graph_H
tbb::flow::interface11::graph_iterator::reference
GraphNodeType & reference
Definition: _flow_graph_impl.h:98
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::composite_node
composite_node(graph &g)
Definition: flow_graph.h:3617
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::filtered_type
T::async_msg_data_type filtered_type
Definition: flow_graph.h:258
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7, T8 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3375
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6, __TBB_B7 b7, __TBB_B8 b8)
Definition: flow_graph.h:3047
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::set_external_ports
void set_external_ports(T &&output_ports_tuple)
Definition: flow_graph.h:3747
tbb::flow::interface11::broadcast_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1691
tbb::flow::interface11::priority_queue_node::internal_pop
void internal_pop(prio_operation *op) __TBB_override
Definition: flow_graph.h:2437
internal::reservable_item_buffer::reservable_item_buffer
reservable_item_buffer()
Definition: _flow_graph_item_buffer_impl.h:254
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::add_nodes
void add_nodes(const NodeTypes &... n)
Definition: flow_graph.h:3759
internal::item_buffer::swap_items
void swap_items(size_t i, size_t j)
Definition: _flow_graph_item_buffer_impl.h:116
tbb::flow::interface11::limiter_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2881
tbb::flow::interface11::indexer_node::N
static const int N
Definition: flow_graph.h:3406
tbb::flow::interface11::limiter_node::my_tries
size_t my_tries
Definition: flow_graph.h:2617
_flow_graph_indexer_impl.h
tbb::flow::interface11::async_node::receiver_gateway_impl::try_put
bool try_put(const Output &i) __TBB_override
Implements gateway_type::try_put for an external activity to submit a message to FG.
Definition: flow_graph.h:3867
__TBB_DEPRECATED
#define __TBB_DEPRECATED
Definition: tbb_config.h:637
tbb::flow::interface11::source_node::my_body
internal::source_body< output_type > * my_body
Definition: flow_graph.h:1097
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::reset_node
void reset_node(reset_flags) __TBB_override
Definition: flow_graph.h:3732
tbb::flow::interface11::priority_queue_node::internal_forward_task
void internal_forward_task(prio_operation *op) __TBB_override
Tries to forward valid items to successors.
Definition: flow_graph.h:2423
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::composite_node
__TBB_NOINLINE_SYM composite_node(graph &g)
Definition: flow_graph.h:3741
tbb::flow::interface11::priority_queue_node::reserved_item
input_type reserved_item
Definition: flow_graph.h:2502
tbb::flow::interface11::async_node::register_successor
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
Definition: flow_graph.h:3959
tbb::flow::interface11::multifunction_node::multifunction_node
__TBB_NOINLINE_SYM multifunction_node(graph &g, size_t concurrency,)
Definition: flow_graph.h:1286
tbb::flow::interface11::overwrite_node::register_predecessor_task::execute
tbb::task * execute() __TBB_override
Should be overridden by derived classes.
Definition: flow_graph.h:4199
tbb::flow::interface11::buffer_node::output_type
T output_type
Definition: flow_graph.h:1707
_aggregator_impl.h
tbb::flow::interface11::buffer_node::size_type
size_t size_type
Definition: flow_graph.h:1716
tbb::flow::interface11::internal::untyped_sender::try_reserve_wrapper
virtual bool try_reserve_wrapper(void *p, bool is_async)=0
tbb::flow::interface11::buffer_node::internal_forward_task_impl
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
Definition: flow_graph.h:1940
tbb::flow::interface10::graph::begin
iterator begin()
start iterator
Definition: flow_graph.h:858
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::input_ports_type
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
Definition: flow_graph.h:3666
tbb::task::set_ref_count
void set_ref_count(int count)
Set reference count.
Definition: task.h:750
tbb::flow::interface11::priority_queue_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:2380
internal::item_buffer::capacity
size_type capacity()
Definition: _flow_graph_item_buffer_impl.h:153
tbb::spin_mutex
A lock that occupies a single byte.
Definition: spin_mutex.h:39
tbb::flow::interface11::priority_queue_node::priority_queue_node
__TBB_NOINLINE_SYM priority_queue_node(const priority_queue_node &src)
Copy constructor.
Definition: flow_graph.h:2399
tbb::flow::interface11::internal::async_body::my_body
Body my_body
Definition: flow_graph.h:3814
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::unfolded_type
internal::unfolded_join_node< N, key_matching_port, OutputTuple, key_matching< K, KHash > > unfolded_type
Definition: flow_graph.h:2978
tbb::flow::interface11::internal::untyped_receiver::predecessor_type
untyped_sender predecessor_type
The predecessor type for this node.
Definition: flow_graph.h:362
spin_mutex.h
tbb::flow::interface11::limiter_node::remove_successor
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
Definition: flow_graph.h:2778
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::async_type
T async_type
Definition: flow_graph.h:257
tbb::flow::interface11::split_node::my_output_ports
output_ports_type my_output_ports
Definition: flow_graph.h:1436
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7, T8 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3374
internal::SUCCEEDED
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::join_node< OutputTuple, queueing >::unfolded_type
internal::unfolded_join_node< N, queueing_port, OutputTuple, queueing > unfolded_type
Definition: flow_graph.h:2942
tbb::flow::interface10::graph::remove_node
void remove_node(tbb::flow::interface11::graph_node *n)
Definition: flow_graph.h:823
tbb::flow::interface11::limiter_node::forward
void forward()
Definition: flow_graph.h:2686
internal
Definition: _flow_graph_async_msg_impl.h:24
tbb::flow::interface11::overwrite_node::try_consume
bool try_consume() __TBB_override
Consumes the reserved item.
Definition: flow_graph.h:4159
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::my_input_ports
std::unique_ptr< input_ports_type > my_input_ports
Definition: flow_graph.h:3669
tbb::flow::interface11::join_node< OutputTuple, reserving >::unfolded_type
internal::unfolded_join_node< N, reserving_port, OutputTuple, reserving > unfolded_type
Definition: flow_graph.h:2909
tbb::flow::interface11::priority_queue_node::prio_pop
void prio_pop()
Definition: flow_graph.h:2522
tbb::flow::interface11::sequencer_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:2307
internal::item_buffer::item_type
T item_type
Definition: _flow_graph_item_buffer_impl.h:42
tbb::flow::interface11::function_node
Implements a function node that supports Input -> Output.
Definition: flow_graph.h:1161
void
void
Definition: ittnotify_static.h:91
tbb::flow::interface11::buffer_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:1708
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3302
tbb::flow::interface11::internal::untyped_sender::register_successor
virtual bool register_successor(successor_type &r)=0
Add a new successor to this node.
tbb::flow::interface11::broadcast_node::input_type
T input_type
Definition: flow_graph.h:1567
tbb::flow::interface11::broadcast_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:1570
tbb::flow::interface11::continue_receiver::remove_predecessor
__TBB_DEPRECATED bool remove_predecessor(predecessor_type &) __TBB_override
Decrements the trigger threshold.
Definition: flow_graph.h:626
tbb::internal::fgt_remove_edge
static void fgt_remove_edge(void *, void *)
Definition: _flow_graph_trace_impl.h:334
tbb::internal::fgt_async_try_put_end
static void fgt_async_try_put_end(void *, void *)
Definition: _flow_graph_trace_impl.h:340
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3246
tbb::flow::interface11::limiter_node::my_predecessors
internal::reservable_predecessor_cache< T, spin_mutex > my_predecessors
Definition: flow_graph.h:2618
tbb::flow::interface11::sender::try_reserve_wrapper
virtual bool try_reserve_wrapper(void *p, bool is_async) __TBB_override
Definition: flow_graph.h:441
tbb::flow::interface11::async_node::copy_function_object
Body copy_function_object()
Definition: flow_graph.h:3969
tbb::flow::interface11::continue_receiver::predecessor_type
__TBB_DEPRECATED typedef receiver< input_type >::predecessor_type predecessor_type
The predecessor type for this node.
Definition: flow_graph.h:598
internal::successor_cache::my_mutex
mutex_type my_mutex
Definition: _flow_graph_cache_impl.h:277
tbb::flow::interface11::buffer_node::buffer_node
__TBB_NOINLINE_SYM buffer_node(const buffer_node &src)
Copy constructor.
Definition: flow_graph.h:2016
tbb::flow::interface11::internal::is_graph_active
bool is_graph_active(tbb::flow::interface10::graph &g)
Definition: _flow_graph_impl.h:494
tbb::flow::interface11::function_node::successors
internal::broadcast_cache< output_type > & successors() __TBB_override
Definition: flow_graph.h:1242
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5)
Definition: flow_graph.h:3020
tbb::flow::interface11::internal::spawn_in_graph_arena
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
Definition: _flow_graph_impl.h:521
tbb::flow::interface11::write_once_node::write_once_node
__TBB_NOINLINE_SYM write_once_node(graph &g)
Constructor.
Definition: flow_graph.h:4237
tbb::internal::fgt_multioutput_node_desc
static void fgt_multioutput_node_desc(const NodeType *, const char *)
Definition: _flow_graph_trace_impl.h:306
tbb::flow::interface11::source_node::output_type
Output output_type
The type of the output message, which is complete.
Definition: flow_graph.h:899
tbb::flow::interface11::priority_queue_node::prio
const T & prio()
Definition: flow_graph.h:2544
task_arena.h
tbb::flow::interface11::function_node::predecessor_type
input_impl_type::predecessor_type predecessor_type
Definition: flow_graph.h:1168
tbb::internal::fgt_composite
static void fgt_composite(void *, void *, void *)
Definition: _flow_graph_trace_impl.h:301
tbb::flow::interface11::queue_node::internal_forward_task
void internal_forward_task(queue_operation *op) __TBB_override
Tries to forward valid items to successors.
Definition: flow_graph.h:2231
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3338
CODEPTR
#define CODEPTR()
Definition: _flow_graph_trace_impl.h:297
tbb::interface6::internal::aggregated_operation::status
uintptr_t status
Zero value means "wait" status, all other values are "user" specified values and are defined into the...
Definition: _aggregator_impl.h:36
internal::item_buffer::get_my_item
const item_type & get_my_item(size_t i) const
Definition: _flow_graph_item_buffer_impl.h:73
tbb::flow::interface11::join_node< OutputTuple, queueing >::join_node
__TBB_NOINLINE_SYM join_node(graph &g)
Definition: flow_graph.h:2946
tbb::flow::interface11::internal::async_body
Definition: flow_graph.h:3799
tbb::flow::interface11::broadcast_node
Forwards messages of type T to all successors.
Definition: flow_graph.h:1565
tbb::internal::fgt_multiinput_multioutput_node
static void fgt_multiinput_multioutput_node(void *, string_index, void *, void *)
Definition: _flow_graph_trace_impl.h:324
tbb::flow::interface11::multifunction_node::input_queue_type
internal::function_input_queue< input_type, Allocator > input_queue_type
Definition: flow_graph.h:1280
tbb::flow::interface11::source_node::my_active
bool my_active
Definition: flow_graph.h:1095
tbb::flow::interface11::limiter_node::try_put_task
task * try_put_task(const T &t) __TBB_override
Puts an item to this receiver.
Definition: flow_graph.h:2848
tbb::flow::interface11::multifunction_node::input_impl_type
internal::multifunction_input< input_type, output_ports_type, Policy, Allocator > input_impl_type
Definition: flow_graph.h:1279
tbb::flow::interface11::graph_node::graph_node
graph_node(graph &g)
Definition: flow_graph.h:880
tbb::flow::interface11::priority_queue_node::prio_use_tail
bool prio_use_tail()
Definition: flow_graph.h:2505
tbb::internal::fgt_make_edge
static void fgt_make_edge(void *, void *)
Definition: _flow_graph_trace_impl.h:333
tbb::flow::interface11::queue_node::internal_consume
void internal_consume(queue_operation *op) __TBB_override
Definition: flow_graph.h:2253
tbb::flow::interface11::async_node::base_type
multifunction_node< Input, tuple< Output >, Policy, Allocator > base_type
Definition: flow_graph.h:3827
internal::source_body::clone
virtual source_body * clone()=0
tbb::flow::interface11::continue_node::predecessor_type
input_impl_type::predecessor_type predecessor_type
Definition: flow_graph.h:1448
tbb::flow::interface11::queue_node::class_type
queue_node class_type
Definition: flow_graph.h:2211
tbb::flow::interface10::graph::~graph
~graph()
Destroys the graph.
Definition: flow_graph.h:790
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::input_ports_type
tbb::flow::tuple< receiver< InputTypes > &... > input_ports_type
Definition: flow_graph.h:3597
tbb::flow::interface10::graph::iterator
tbb::flow::interface11::graph_iterator< graph, tbb::flow::interface11::graph_node > iterator
Definition: _flow_graph_impl.h:383
internal::item_buffer::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:69
tbb::flow::interface11::internal::async_helpers::to_void_ptr
static void * to_void_ptr(T &t)
Definition: flow_graph.h:225
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::flow::interface11::reset_flags
reset_flags
Definition: _flow_graph_impl.h:158
tbb::flow::interface11::internal::add_task_to_graph_reset_list
void add_task_to_graph_reset_list(tbb::flow::interface10::graph &g, tbb::task *tp)
Definition: _flow_graph_impl.h:537
tbb::flow::interface11::buffer_node::internal_release
virtual void internal_release(buffer_operation *op)
Definition: flow_graph.h:1993
tbb::flow::interface10::graph::my_context
tbb::task_group_context * my_context
Definition: _flow_graph_impl.h:410
tbb::flow::unlimited
Definition: flow_graph.h:98
tbb::flow::interface11::overwrite_node::my_buffer_is_valid
bool my_buffer_is_valid
Definition: flow_graph.h:4216
tbb::flow::interface11::buffer_node::forwarder_busy
bool forwarder_busy
Definition: flow_graph.h:1764
tbb::flow::interface11::limiter_node::output_type
T output_type
Definition: flow_graph.h:2603
tbb::flow::interface11::buffer_node::internal_push
virtual bool internal_push(buffer_operation *op)
Definition: flow_graph.h:1964
tbb::flow::interface11::async_node::receiver_gateway_impl::release_wait
void release_wait() __TBB_override
Inform a graph that a previous call to reserve_wait is no longer in effect.
Definition: flow_graph.h:3861
tbb::flow::interface10::graph::my_task_arena
tbb::task_arena * my_task_arena
Definition: _flow_graph_impl.h:424
internal::function_output::successor_type
sender< output_type >::successor_type successor_type
Definition: _flow_graph_node_impl.h:859
tbb::flow::interface11::continue_receiver::continue_receiver
__TBB_DEPRECATED continue_receiver(const continue_receiver &src)
Copy constructor.
Definition: flow_graph.h:609
tbb::internal::fgt_multiinput_multioutput_node_desc
void fgt_multiinput_multioutput_node_desc(const NodeType *, const char *)
Definition: _flow_graph_trace_impl.h:347
tbb::flow::interface11::source_node::my_mutex
spin_mutex my_mutex
Definition: flow_graph.h:1094
tbb::task_list
A list of children.
Definition: task.h:1063
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::to_void_ptr
static void * to_void_ptr(T &t)
Definition: flow_graph.h:267
tbb::internal::fgt_node_with_body
static void fgt_node_with_body(void *, string_index, void *, void *, void *)
Definition: _flow_graph_trace_impl.h:330
tbb::flow::interface11::indexer_node< T0 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3101
internal::function_output::function_output
function_output(graph &g)
Definition: _flow_graph_node_impl.h:866
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7 >::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7 > output_type
Definition: flow_graph.h:3337
tbb::flow::interface11::priority_queue_node::reheap
void reheap()
Definition: flow_graph.h:2571
_flow_graph_join_impl.h
tbb::flow::interface11::internal::async_body::base_type
async_body_base< Gateway > base_type
Definition: flow_graph.h:3801
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3233
tbb::flow::interface11::async_node::try_put_functor::output_port_type
internal::multifunction_output< Output > output_port_type
Definition: flow_graph.h:3842
tbb::flow::interface11::overwrite_node::try_release
bool try_release() __TBB_override
Releases the reserved item.
Definition: flow_graph.h:4156
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::try_put_task_wrapper_impl
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
Definition: flow_graph.h:281
internal::item_buffer::my_tail
size_type my_tail
Definition: _flow_graph_item_buffer_impl.h:53
internal::source_body< output_type >
__TBB_FLOW_GRAPH_PRIORITY_EXPR
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)
Definition: _flow_graph_impl.h:38
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7 >::indexer_node
indexer_node(const indexer_node &other)
Definition: flow_graph.h:3352
internal::emit_element::emit_this
static task * emit_this(graph &g, const T &t, P &p)
Definition: _flow_graph_node_impl.h:733
tbb::flow::interface11::priority_queue_node::base_type
buffer_node< T, A > base_type
Definition: flow_graph.h:2377
internal::multifunction_output
Definition: _flow_graph_node_impl.h:925
_flow_graph_cache_impl.h
internal::broadcast_cache
A cache of successors that are broadcast to.
Definition: _flow_graph_cache_impl.h:465
tbb::flow::interface11::priority_queue_node::size_type
buffer_node< T, A >::size_type size_type
Definition: flow_graph.h:2418
tbb::flow::interface11::split_node
split_node: accepts a tuple as input, forwards each element of the tuple to its
Definition: flow_graph.h:1349
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::output_ports_type
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
Definition: flow_graph.h:3725
tbb::flow::interface11::split_node::split_node
__TBB_NOINLINE_SYM split_node(graph &g)
Definition: flow_graph.h:1368
tbb::flow::interface11::graph_node::next
graph_node * next
Definition: _flow_graph_impl.h:465
tbb::flow::interface11::internal::untyped_receiver::run_and_put_task
friend class run_and_put_task
Definition: flow_graph.h:351
internal::multifunction_body
function_body that takes an Input and a set of output ports
Definition: _flow_graph_body_impl.h:192
tbb::interface6::internal::aggregator
Definition: _aggregator_impl.h:144
tbb::flow::interface11::write_once_node::write_once_node
__TBB_NOINLINE_SYM write_once_node(const write_once_node &src)
Copy constructor: call base class copy constructor.
Definition: flow_graph.h:4251
__TBB_FLOW_GRAPH_PRIORITY_ARG1
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
Definition: _flow_graph_impl.h:40
tbb::flow::interface11::limiter_node::decrement
internal::decrementer< limiter_node< T, DecrementType >, DecrementType > decrement
The internal receiver< DecrementType > that decrements the count.
Definition: flow_graph.h:2716
tbb::flow::interface11::internal::reservable_predecessor_cache
Definition: flow_graph.h:123
internal::unfolded_join_node
unfolded_join_node : passes input_ports_type to join_node_base. We build the input port type
Definition: _flow_graph_join_impl.h:1508
tbb::flow::interface11::composite_node
Definition: flow_graph.h:3591
tbb::flow::interface11::internal::untyped_sender::try_get
bool try_get(X &t)
Request an item from the sender.
Definition: flow_graph.h:336
tbb::internal::fgt_async_reserve
static void fgt_async_reserve(void *, void *)
Definition: _flow_graph_trace_impl.h:341
tbb::flow::interface11::source_node::spawn_put
void spawn_put()
Spawns a task that applies the body.
Definition: flow_graph.h:1137
tbb::flow::interface11::broadcast_node::register_successor
bool register_successor(successor_type &r) __TBB_override
Adds a successor.
Definition: flow_graph.h:1612
tbb::flow::interface11::source_node
An executable node that acts as a source, i.e. it has no predecessors.
Definition: flow_graph.h:896
internal::graph_policy_namespace::reserving
Definition: _flow_graph_body_impl.h:69
tbb::flow::interface11::receiver::try_put
bool try_put(const typename internal::async_helpers< T >::filtered_type &t)
Put an item to the receiver.
Definition: flow_graph.h:464
cache_aligned_allocator.h
tbb::flow::interface11::indexer_node< T0, T1 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3133
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4 >::InputTuple
tuple< T0, T1, T2, T3, T4 > InputTuple
Definition: flow_graph.h:3230
tbb::flow::interface11::buffer_node::order
void order()
Definition: flow_graph.h:1917
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7 >::InputTuple
tuple< T0, T1, T2, T3, T4, T5, T6, T7 > InputTuple
Definition: flow_graph.h:3336
tbb::flow::interface11::internal::async_body::async_body
async_body(const Body &body, gateway_type *gateway)
Definition: flow_graph.h:3804
tbb::flow::interface11::source_node::activate
void activate()
Activates a node that was created in the inactive state.
Definition: flow_graph.h:1052
tbb::flow::interface11::join_node< OutputTuple, queueing >::join_node
__TBB_NOINLINE_SYM join_node(const join_node &other)
Definition: flow_graph.h:2958
tbb
The graph class.
Definition: serial/tbb/parallel_for.h:46
tbb::flow::interface11::internal::broadcast_cache
Definition: flow_graph.h:120
tbb::flow::interface11::queue_node::input_type
T input_type
Definition: flow_graph.h:2259
tbb::flow::interface11::overwrite_node::try_reserve
bool try_reserve(T &v) __TBB_override
Reserves an item.
Definition: flow_graph.h:4151
tbb::flow::interface11::overwrite_node::~overwrite_node
~overwrite_node()
Definition: flow_graph.h:4051
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::output_ports
output_ports_type & output_ports()
Definition: flow_graph.h:3767
tbb::flow::interface11::receiver::input_type
__TBB_DEPRECATED typedef T input_type
The input type of this receiver.
Definition: flow_graph.h:459
tbb::flow::interface11::combine_tasks
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:191
internal::item_buffer::push_back
bool push_back(item_type &v)
Definition: _flow_graph_item_buffer_impl.h:186
tbb::task_list::pop_front
task & pop_front()
Pop the front task from the list.
Definition: task.h:1098
tbb::empty_task
task that does nothing. Useful for synchronization.
Definition: task.h:1031
tbb::flow::interface11::internal::async_helpers::async_type
async_msg< T > async_type
Definition: flow_graph.h:216
tbb::flow::interface11::sender::output_type
__TBB_DEPRECATED typedef T output_type
The output type of this sender.
Definition: flow_graph.h:420
_flow_graph_async_msg_impl.h
__TBB_CPP11_PRESENT
#define __TBB_CPP11_PRESENT
Definition: tbb_config.h:149
tbb::flow::interface11::indexer_node< T0 >::InputTuple
tuple< T0 > InputTuple
Definition: flow_graph.h:3098
tbb::flow::interface11::split_node::input_type
TupleType input_type
Definition: flow_graph.h:1353
tbb::flow::interface11::async_node::try_put_functor::port
output_port_type * port
Definition: flow_graph.h:3843
tbb::flow::interface10::graph::wait_for_all
void wait_for_all()
Wait until graph is idle and decrement_wait_count calls equals increment_wait_count calls.
Definition: _flow_graph_impl.h:338
tbb::flow::interface11::split_node::try_put_task
task * try_put_task(const TupleType &t) __TBB_override
Put item to successor; return task to run the successor if possible.
Definition: flow_graph.h:1400
tbb::flow::interface11::graph_node::reset_node
virtual void reset_node(reset_flags f=rf_reset_protocol)=0
internal::indexer_node_FE::input_ports
input_type & input_ports()
Definition: _flow_graph_indexer_impl.h:162
tbb::task_group_context
Used to form groups of tasks.
Definition: task.h:347
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::reset_node
void reset_node(reset_flags) __TBB_override
Definition: flow_graph.h:3673
spin_rw_mutex.h
tbb::flow::interface11::limiter_node::forward_task
task * forward_task()
Definition: flow_graph.h:2633
tbb::flow::interface11::priority_queue_node::compare
Compare compare
Definition: flow_graph.h:2499
tbb::flow::interface10::graph::my_nodes_last
tbb::flow::interface11::graph_node * my_nodes_last
Definition: _flow_graph_impl.h:418
internal::multifunction_input::reset
void reset(reset_flags f)
Definition: _flow_graph_node_impl.h:700
__TBB_DEPRECATED_LIMITER_ARG4
#define __TBB_DEPRECATED_LIMITER_ARG4(arg1, arg2, arg3, arg4)
Definition: _flow_graph_impl.h:54
tbb::flow::interface10::graph::prepare_task_arena
void prepare_task_arena(bool reinit=false)
Definition: _flow_graph_impl.h:265
tbb::flow::interface11::async_node::async_node
__TBB_NOINLINE_SYM async_node(const async_node &other)
Definition: flow_graph.h:3937
internal::multifunction_output::try_put
bool try_put(const output_type &i)
Definition: _flow_graph_node_impl.h:934
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6 >::InputTuple
tuple< T0, T1, T2, T3, T4, T5, T6 > InputTuple
Definition: flow_graph.h:3300
tbb::flow::interface11::source_node::my_has_cached_item
bool my_has_cached_item
Definition: flow_graph.h:1101
tbb::cache_aligned_allocator
Meets "allocator" requirements of ISO C++ Standard, Section 20.1.5.
Definition: cache_aligned_allocator.h:60
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1)
Definition: flow_graph.h:2997
internal::item_buffer::pop_back
bool pop_back(item_type &v)
Definition: _flow_graph_item_buffer_impl.h:195
tbb::flow::interface11::receiver::try_put_task
virtual task * try_put_task(const T &t)=0
Put item to successor; return task to run the successor if possible.
tbb::flow::interface11::write_once_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:4234
tbb::flow::interface11::continue_node::input_type
continue_msg input_type
Definition: flow_graph.h:1444
tbb::flow::interface11::indexer_node::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3411
tbb::flow::interface11::internal::untyped_receiver
Definition: flow_graph.h:350
begin
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp begin
Definition: ittnotify_static.h:182
tbb::flow::interface11::function_node::input_queue_type
internal::function_input_queue< input_type, Allocator > input_queue_type
Definition: flow_graph.h:1166
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3267
internal::input_port
tbb::flow::tuple_element< N, typename JNT::input_ports_type >::type & input_port(JNT &jn)
templated function to refer to input ports of the join node
Definition: _flow_graph_join_impl.h:1996
internal::function_body< T, size_t >
tbb::flow::interface11::priority_queue_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:2379
internal::clear_element::clear_this
static void clear_this(P &p)
Definition: _flow_graph_node_impl.h:526
tbb::task::decrement_ref_count
int decrement_ref_count()
Atomically decrement reference count and returns its new value.
Definition: task.h:777
tbb::flow::interface11::run_and_put_task
Definition: flow_graph.h:115
tbb::flow::interface11::async_node::output_ports_type
base_type::output_ports_type output_ports_type
Definition: flow_graph.h:3838
tbb::flow::interface11::broadcast_node::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:1685
tbb::flow::interface11::queue_node::queue_node
__TBB_NOINLINE_SYM queue_node(const queue_node &src)
Copy constructor.
Definition: flow_graph.h:2279
_flow_graph_nodes_deduction.h
tbb::flow::interface11::graph_task
Base class for tasks generated by graph nodes.
Definition: _flow_graph_impl.h:80
tbb::flow::interface11::internal::async_helpers
Definition: flow_graph.h:215
tbb::flow::interface11::function_node::input_type
Input input_type
Definition: flow_graph.h:1163
tbb::flow::interface11::buffer_node::buffer_operation::elem
T * elem
Definition: flow_graph.h:1749
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3266
internal::function_input
Implements methods for a function node that takes a type Input as input and sends.
Definition: _flow_graph_node_impl.h:421
tbb::flow::interface10::graph::cend
const_iterator cend() const
end const iterator
Definition: flow_graph.h:868
internal::graph_policy_namespace::key_matching
field of type K being used for matching.
Definition: _flow_graph_body_impl.h:77
internal::queueing_port
queueing join_port
Definition: _flow_graph_join_impl.h:430
tbb::flow::interface11::buffer_node::buffer_operation::type
char type
Definition: flow_graph.h:1737
tbb::flow::interface11::buffer_node::buffer_operation::buffer_operation
buffer_operation(const T &e, op_type t)
Definition: flow_graph.h:1753
tbb::flow::interface11::overwrite_node
Definition: flow_graph.h:4016
tbb::flow::interface11::sequencer_node
Forwards messages in sequence order.
Definition: flow_graph.h:2299
tbb::flow::interface11::sender
Forward declaration section.
Definition: flow_graph.h:109
internal::function_input_base< Input, Policy, A, function_input< Input, Output, Policy, A > >::try_put_task
task * try_put_task(const input_type &t) __TBB_override
Definition: _flow_graph_node_impl.h:117
__TBB_FLOW_GRAPH_PRIORITY_ARG0
#define __TBB_FLOW_GRAPH_PRIORITY_ARG0(priority)
Definition: _flow_graph_impl.h:39
internal::function_output
Implements methods for both executable and function nodes that puts Output to its successors.
Definition: _flow_graph_node_impl.h:854
tbb::flow::interface11::priority_queue_node::output_type
T output_type
Definition: flow_graph.h:2376
tbb::flow::interface11::indexer_node< T0, T1, T2, T3 >::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3 > output_type
Definition: flow_graph.h:3198
tbb::flow::interface11::split_node::allocator_type
Allocator allocator_type
Definition: flow_graph.h:1354
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::add_visible_nodes
void add_visible_nodes(const NodeTypes &... n)
Definition: flow_graph.h:3634
internal::op_stat
op_stat
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface10::graph::nodelist_mutex
tbb::spin_mutex nodelist_mutex
Definition: _flow_graph_impl.h:420
tbb::flow::internal::SUCCESSFULLY_ENQUEUED
static tbb::task *const SUCCESSFULLY_ENQUEUED
Definition: _flow_graph_impl.h:61
tbb::flow::interface11::priority_queue_node::prio_push
void prio_push(const T &src)
Definition: flow_graph.h:2511
tbb::flow::interface11::buffer_node::try_put_task
task * try_put_task(const T &t) __TBB_override
receive an item, return a task *if possible
Definition: flow_graph.h:2157
tbb::flow::interface11::source_node::successor_type
sender< output_type >::successor_type successor_type
The type of successors of this node.
Definition: flow_graph.h:902
internal::reserving_port
The two-phase join port.
Definition: _flow_graph_join_impl.h:209
internal::item_buffer::fetch_item
void fetch_item(size_t i, item_type &o)
Definition: _flow_graph_item_buffer_impl.h:89
tbb::flow::interface11::write_once_node::output_type
T output_type
Definition: flow_graph.h:4231
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7, T8 >::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8 > output_type
Definition: flow_graph.h:3373
internal::forward_task_bypass
A task that calls a node's forward_task function.
Definition: _flow_graph_body_impl.h:270
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::set_external_ports
void set_external_ports(T &&input_ports_tuple)
Definition: flow_graph.h:3688
tbb::flow::interface11::internal::async_body_base::set_gateway
void set_gateway(gateway_type *gateway)
Definition: flow_graph.h:3790
tbb::flow::interface10::graph::end
iterator end()
end iterator
Definition: flow_graph.h:860
tbb::flow::interface11::internal::untyped_sender::try_get_wrapper
virtual bool try_get_wrapper(void *p, bool is_async)=0
tbb::flow::interface11::internal::async_body::operator()
void operator()(const Input &v, Ports &)
Definition: flow_graph.h:3807
internal::item_buffer::destroy_back
void destroy_back()
Definition: _flow_graph_item_buffer_impl.h:148
internal::multifunction_input< Input, internal::wrap_tuple_elements< tbb::flow::tuple_size< Output >::value, internal::multifunction_output, Output >::type, Policy, Allocator >::output_ports
output_ports_type & output_ports()
Definition: _flow_graph_node_impl.h:691
tbb::flow::interface11::source_node::try_reserve_apply_body
bool try_reserve_apply_body(output_type &v)
Definition: flow_graph.h:1105
tbb::flow::interface11::graph_node::prev
graph_node * prev
Definition: _flow_graph_impl.h:465
tbb::flow::interface11::buffer_node::internal_pop
virtual void internal_pop(buffer_operation *op)
Definition: flow_graph.h:1970
tbb::flow::interface11::continue_receiver::execute
virtual task * execute()=0
Does whatever should happen when the threshold is reached.
tbb::spin_mutex::scoped_lock
friend class scoped_lock
Definition: spin_mutex.h:179
tbb::flow::interface11::sequencer_node::sequencer_node
__TBB_NOINLINE_SYM sequencer_node(const sequencer_node &src)
Copy constructor.
Definition: flow_graph.h:2327
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7 >::indexer_node
indexer_node(graph &g)
Definition: flow_graph.h:3339
_flow_graph_node_impl.h
tbb_profiling.h
tbb::flow::interface11::async_node::receiver_gateway_impl::my_node
async_node * my_node
Definition: flow_graph.h:3872
tbb::flow::interface11::priority_queue_node::internal_release
void internal_release(prio_operation *op) __TBB_override
Definition: flow_graph.h:2469
tbb::internal::fgt_begin_body
static void fgt_begin_body(void *)
Definition: _flow_graph_trace_impl.h:336
tbb::flow::interface11::indexer_node::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > output_type
Definition: flow_graph.h:3409
tbb::internal::fgt_internal_output_alias_helper::alias_port
static void alias_port(void *, PortsTuple &)
Definition: _flow_graph_trace_impl.h:356
tbb::flow::interface11::indexer_node< T0 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3100
_template_helpers.h
tbb::flow::interface11::queue_node::is_item_valid
bool is_item_valid()
Definition: flow_graph.h:2216
tbb::flow::interface11::join_node< OutputTuple, reserving >::input_ports_type
unfolded_type::input_ports_type input_ports_type
Definition: flow_graph.h:2912
tbb::flow::interface11::overwrite_node::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:4189
tbb::flow::interface11::sequencer_node::output_type
T output_type
Definition: flow_graph.h:2305
tbb::flow::interface11::graph_node::my_graph
graph & my_graph
Definition: _flow_graph_impl.h:464
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::from_void_ptr
static const T & from_void_ptr(const void *p)
Definition: flow_graph.h:272
tbb::flow::interface10::graph::cancelled
bool cancelled
Definition: _flow_graph_impl.h:413
tbb::flow::interface11::buffer_node::rel_res
Definition: flow_graph.h:1725
tbb::flow::interface11::internal::async_body_base::async_body_base
async_body_base(gateway_type *gateway)
Definition: flow_graph.h:3789
tbb::flow::interface11::sender::try_get
virtual bool try_get(T &)
Request an item from the sender.
Definition: flow_graph.h:425
_flow_graph_impl.h
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::output_ports_type
tbb::flow::tuple< sender< OutputTypes > &... > output_ports_type
Definition: flow_graph.h:3598
internal::item_buffer::my_array_size
size_type my_array_size
Definition: _flow_graph_item_buffer_impl.h:50
tbb::flow::interface11::continue_node::continue_node
__TBB_NOINLINE_SYM continue_node(graph &g,)
Constructor for executable node with continue_msg -> Output.
Definition: flow_graph.h:1453
_tbb_hash_compare_impl.h
tbb::flow::interface11::limiter_node::my_successors
internal::broadcast_cache< T > my_successors
Definition: flow_graph.h:2620
tbb::flow::interface11::async_node::try_put_functor
Definition: flow_graph.h:3841
tbb::flow::interface11::buffer_node::buffer_operation
Definition: flow_graph.h:1735
tbb::flow::interface11::null_type
A generic null type.
Definition: flow_graph.h:103
tbb::task::increment_ref_count
void increment_ref_count()
Atomically increment reference count.
Definition: task.h:760
tbb::flow::interface11::internal::untyped_receiver::try_put
bool try_put(const X &t)
Put an item to the receiver.
Definition: flow_graph.h:369
tbb::flow::interface11::multifunction_node::N
static const int N
Definition: flow_graph.h:1274
tbb::flow::interface11::priority_queue_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2413
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::input_ports_type
unfolded_type::input_ports_type input_ports_type
Definition: flow_graph.h:2981
tbb::flow::interface11::broadcast_node::my_successors
internal::broadcast_cache< input_type > my_successors
Definition: flow_graph.h:1576
tbb::flow::interface11::join_node< OutputTuple, reserving >::join_node
__TBB_NOINLINE_SYM join_node(const join_node &other)
Definition: flow_graph.h:2925
tbb::flow::interface11::async_node::async_node
__TBB_NOINLINE_SYM async_node(graph &g, size_t concurrency,)
Definition: flow_graph.h:3897
tbb::flow::interface11::internal_make_edge
void internal_make_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
Definition: flow_graph.h:3438
tbb::flow::interface11::async_node::try_put_functor::try_put_functor
try_put_functor(output_port_type &p, const Output &v)
Definition: flow_graph.h:3847
tbb::flow::interface11::buffer_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:1709
tbb::flow::interface11::source_node::init_my_active
bool init_my_active
Definition: flow_graph.h:1096
internal::continue_input::graph_reference
graph & graph_reference() const __TBB_override
Definition: _flow_graph_node_impl.h:847
tbb::flow::interface11::indexer_node< T0, T1, T2, T3 >::InputTuple
tuple< T0, T1, T2, T3 > InputTuple
Definition: flow_graph.h:3197
tbb::flow::interface11::graph_node
The base of all graph nodes.
Definition: _flow_graph_impl.h:454
internal::tagged_msg
Definition: _flow_graph_types_impl.h:612
tbb::flow::interface10::graph::graph
graph()
Constructs a graph with isolated task_group_context.
Definition: flow_graph.h:766
tbb::flow::interface11::buffer_node::try_reserve
bool try_reserve(T &v) __TBB_override
Reserves an item.
Definition: flow_graph.h:2125
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::reset_node
void reset_node(reset_flags) __TBB_override
Definition: flow_graph.h:3608
tbb::flow::interface11::source_node::create_put_task
task * create_put_task()
Definition: flow_graph.h:1131
tbb::flow::interface11::buffer_node::register_successor
bool register_successor(successor_type &r) __TBB_override
Adds a new successor.
Definition: flow_graph.h:2037
tbb::flow::interface11::buffer_node::internal_reg_succ
virtual void internal_reg_succ(buffer_operation *op)
Register successor.
Definition: flow_graph.h:1854
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
join_node(graph &g)
Definition: flow_graph.h:2984
tbb::flow::interface11::source_node::my_reserved
bool my_reserved
Definition: flow_graph.h:1100
tbb::flow::interface11::indexer_node< T0, T1 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3147
tbb::flow::interface11::priority_queue_node::internal_push
bool internal_push(prio_operation *op) __TBB_override
Definition: flow_graph.h:2431
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3280
tbb::flow::interface11::indexer_node::InputTuple
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 > InputTuple
Definition: flow_graph.h:3408
tbb::flow::interface11::priority_queue_node::priority_queue_node
__TBB_NOINLINE_SYM priority_queue_node(graph &g, const Compare &comp=Compare())
Constructor.
Definition: flow_graph.h:2383
tbb::flow::interface11::copy_body
Body copy_body(Node &n)
Returns a copy of the body from a function or continue node.
Definition: flow_graph.h:3584
tbb::flow::interface11::async_node::try_put_functor::value
const Output * value
Definition: flow_graph.h:3845
tbb::flow::interface11::indexer_node< T0, T1 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3134
tbb::flow::interface11::priority_queue_node::class_type
priority_queue_node class_type
Definition: flow_graph.h:2378
tbb::flow::interface11::buffer_node::put_item
Definition: flow_graph.h:1725
tbb::flow::interface11::limiter_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:2605
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::add_visible_nodes
void add_visible_nodes(const NodeTypes &... n)
Definition: flow_graph.h:3756
internal::item_buffer::my_head
size_type my_head
Definition: _flow_graph_item_buffer_impl.h:52
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::input_ports
input_ports_type & input_ports()
Definition: flow_graph.h:3708
task.h
tbb::flow::interface11::split_node::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:1412
tbb::flow::interface11::internal::untyped_sender::try_release
virtual bool try_release()
Releases the reserved item.
Definition: flow_graph.h:318
tbb::flow::interface11::broadcast_node::output_type
T output_type
Definition: flow_graph.h:1568
tbb::flow::interface11::join_node< OutputTuple, queueing >::input_ports_type
unfolded_type::input_ports_type input_ports_type
Definition: flow_graph.h:2945
tbb::flow::interface11::limiter_node::register_successor
bool register_successor(successor_type &r) __TBB_override
Replace the current successor with this new successor.
Definition: flow_graph.h:2761
tbb::flow::interface11::limiter_node::my_count
size_t my_count
Definition: flow_graph.h:2616
tbb::flow::interface11::queue_node::queue_operation
base_type::buffer_operation queue_operation
Definition: flow_graph.h:2210
tbb::flow::interface11::buffer_node::req_item
Definition: flow_graph.h:1725
tbb::flow::interface11::async_node::gateway_type
receiver_gateway< output_type > gateway_type
Definition: flow_graph.h:3836
tbb::flow::interface11::function_node::fOutput_type
internal::function_output< output_type > fOutput_type
Definition: flow_graph.h:1167
tbb::flow::interface11::queue_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:2262
tbb::flow::interface11::limiter_node::remove_predecessor
bool remove_predecessor(predecessor_type &src) __TBB_override
Removes src from the list of cached predecessors.
Definition: flow_graph.h:2837
internal::continue_input::reset_receiver
void reset_receiver(reset_flags f) __TBB_override
Definition: _flow_graph_node_impl.h:797
tbb::flow::key_from_message
K key_from_message(const T &t)
Definition: flow_graph.h:713
tbb::flow::interface11::overwrite_node::register_successor
bool register_successor(successor_type &s) __TBB_override
Add a new successor to this node.
Definition: flow_graph.h:4059
tbb::internal::fgt_node_desc
static void fgt_node_desc(const NodeType *, const char *)
Definition: _flow_graph_trace_impl.h:309
tbb::flow::interface11::buffer_node::res_item
Definition: flow_graph.h:1725
tbb::flow::interface11::limiter_node::my_threshold
size_t my_threshold
Definition: flow_graph.h:2615
tbb::flow::interface11::buffer_node::class_type
buffer_node< T, A > class_type
Definition: flow_graph.h:1710
tbb::flow::interface11::graph_iterator::graph_iterator
graph_iterator()
Default constructor.
Definition: _flow_graph_impl.h:103
tbb::flow::interface11::internal::predecessor_cache
Definition: flow_graph.h:122
tbb::flow::interface11::broadcast_node::broadcast_node
__TBB_NOINLINE_SYM broadcast_node(graph &g)
Definition: flow_graph.h:1583
tbb::flow::interface11::internal::async_helpers::filtered_type
T filtered_type
Definition: flow_graph.h:217
_flow_graph_streaming_node.h
tbb::flow::interface11::internal::async_body::gateway_type
Gateway gateway_type
Definition: flow_graph.h:3802
internal::node_cache::clear
void clear()
Definition: _flow_graph_cache_impl.h:54
tbb::flow::interface11::write_once_node::base_type
overwrite_node< T > base_type
Definition: flow_graph.h:4232
tbb::flow::interface11::receiver::filtered_type
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
Definition: flow_graph.h:461
tbb::flow::interface11::overwrite_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:4219
tbb::flow::interface10::graph::my_nodes
tbb::flow::interface11::graph_node * my_nodes
Definition: _flow_graph_impl.h:418
tbb::task_group_context::reset
void __TBB_EXPORTED_METHOD reset()
Forcefully reinitializes the context after the task tree it was associated with is completed.
tbb::flow::interface11::continue_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1556
tbb::flow::interface11::multifunction_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1343
__TBB_STATIC_ASSERT
#define __TBB_STATIC_ASSERT(condition, msg)
Definition: tbb_stddef.h:553
tbb::flow::interface11::queue_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:2261
internal::multifunction_input
Implements methods for a function node that takes a type Input as input.
Definition: _flow_graph_node_impl.h:638
internal::key_matching_port
Definition: _flow_graph_join_impl.h:658
internal::graph_policy_namespace::queueing_lightweight
interface11::internal::Policy< queueing, lightweight > queueing_lightweight
Definition: _flow_graph_body_impl.h:87
tbb::flow::interface11::overwrite_node::input_type
T input_type
Definition: flow_graph.h:4018
tbb::flow::interface11::continue_node::successor_type
fOutput_type::successor_type successor_type
Definition: flow_graph.h:1449
tbb::flow::internal::no_priority
static const node_priority_t no_priority
Definition: _flow_graph_impl.h:64
tbb_exception.h
internal::wrap_tuple_elements
Definition: _flow_graph_types_impl.h:49
internal::item_buffer::pop_front
bool pop_front(item_type &v)
Definition: _flow_graph_item_buffer_impl.h:204
tbb::flow::interface11::indexer_node< T0, T1, T2, T3 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3199
tbb::internal::fgt_reserve_wait
static void fgt_reserve_wait(void *)
Definition: _flow_graph_trace_impl.h:343
tbb::flow::interface11::continue_receiver::register_predecessor
__TBB_DEPRECATED bool register_predecessor(predecessor_type &) __TBB_override
Increments the trigger threshold.
Definition: flow_graph.h:616
tbb::flow::interface11::limiter_node::reset_receiver
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:2877
tbb::flow::interface11::sequencer_node::~sequencer_node
~sequencer_node()
Destructor.
Definition: flow_graph.h:2335
tbb::flow::interface11::indexer_node< T0, T1, T2 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3166
tbb::internal::__TBB_store_with_release
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:716
internal::item_buffer::move_item
void move_item(size_t to, size_t from)
Definition: _flow_graph_item_buffer_impl.h:98
tbb::flow::interface11::async_node::output_type
Output output_type
Definition: flow_graph.h:3832
tbb::flow::interface11::async_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:3835
tbb::flow::interface11::continue_receiver::continue_receiver
__TBB_DEPRECATED continue_receiver(__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority))
Constructor.
Definition: flow_graph.h:601
tbb::flow::interface11::remove_edge
void remove_edge(sender< T > &p, receiver< T > &s)
Removes an edge between a single predecessor and a single successor.
Definition: flow_graph.h:3517
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::from_void_ptr
static T & from_void_ptr(void *p)
Definition: flow_graph.h:276
tbb::flow::interface11::function_node::input_impl_type
internal::function_input< input_type, output_type, Policy, Allocator > input_impl_type
Definition: flow_graph.h:1165
tbb::flow::interface11::internal::untyped_sender::successor_type
untyped_receiver successor_type
The successor type for this node.
Definition: flow_graph.h:303
tbb::flow::concurrency
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
Definition: flow_graph.h:98
internal::function_input::reset_function_input
void reset_function_input(reset_flags f)
Definition: _flow_graph_node_impl.h:508
tbb::flow::interface11::buffer_node::buffer_node
__TBB_NOINLINE_SYM buffer_node(graph &g)
Constructor.
Definition: flow_graph.h:2000
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6)
Definition: flow_graph.h:3029
tbb::flow::interface11::indexer_node< T0, T1, T2 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3167
tbb::internal::fgt_graph_desc
static void fgt_graph_desc(void *, const char *)
Definition: _flow_graph_trace_impl.h:311
tbb::flow::interface11::receiver::try_put
bool try_put(const typename internal::async_helpers< T >::async_type &t)
Definition: flow_graph.h:468
tbb::flow::interface11::rf_reset_protocol
Definition: _flow_graph_impl.h:159
internal::add_nodes_impl
void add_nodes_impl(CompositeType *, bool)
Definition: _flow_graph_node_impl.h:958
tbb::flow::interface11::async_node::receiver_gateway_impl::receiver_gateway_impl
receiver_gateway_impl(async_node *node)
Definition: flow_graph.h:3855
tbb::flow::interface11::overwrite_node::try_get
bool try_get(input_type &v) __TBB_override
Request an item from the sender.
Definition: flow_graph.h:4141
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::input_ports
input_ports_type & input_ports()
Definition: flow_graph.h:3645
lock
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void * lock
Definition: ittnotify_static.h:121
atomic.h
tbb::flow::interface11::indexer_node< T0, T1 >::InputTuple
tuple< T0, T1 > InputTuple
Definition: flow_graph.h:3131
tbb::flow::interface11::buffer_node::internal_rem_succ
virtual void internal_rem_succ(buffer_operation *op)
Remove successor.
Definition: flow_graph.h:1860
tbb::flow::interface11::graph_iterator::pointer
GraphNodeType * pointer
Definition: _flow_graph_impl.h:97
tbb::flow::interface11::continue_node::successors
internal::broadcast_cache< output_type > & successors() __TBB_override
Definition: flow_graph.h:1554
tbb::flow::interface11::write_once_node
Definition: flow_graph.h:4228
tbb::flow::interface11::broadcast_node::reset_receiver
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:1689
tbb::flow::interface11::join_node
Definition: flow_graph.h:2903
tbb::internal::fgt_release_wait
static void fgt_release_wait(void *)
Definition: _flow_graph_trace_impl.h:344
tbb::flow::interface11::buffer_node::try_consume
bool try_consume() __TBB_override
Consumes a reserved item.
Definition: flow_graph.h:2144
tbb::flow::interface11::limiter_node
Forwards messages only if the threshold has not been reached.
Definition: flow_graph.h:113
internal::function_output::successors
broadcast_cache_type & successors()
Definition: _flow_graph_node_impl.h:916
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4 >::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3232
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::my_input_ports
std::unique_ptr< input_ports_type > my_input_ports
Definition: flow_graph.h:3601
tbb::flow::interface11::overwrite_node::remove_successor
bool remove_successor(successor_type &s) __TBB_override
Removes a successor from this node.
Definition: flow_graph.h:4083
internal::continue_input::my_body
function_body_type * my_body
Definition: _flow_graph_node_impl.h:809
tbb::flow::interface11::continue_node::input_impl_type
internal::continue_input< Output, Policy > input_impl_type
Definition: flow_graph.h:1446
tbb::flow::interface11::internal::untyped_receiver::try_put_task_wrapper
virtual task * try_put_task_wrapper(const void *p, bool is_async)=0
internal::WAIT
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::buffer_node::buffer_operation::buffer_operation
buffer_operation(op_type t)
Definition: flow_graph.h:1761
tbb::internal::fgt_internal_input_alias_helper::alias_port
static void alias_port(void *, PortsTuple &)
Definition: _flow_graph_trace_impl.h:351
tbb::flow::interface11::buffer_node::remove_successor
bool remove_successor(successor_type &r) __TBB_override
Removes a successor.
Definition: flow_graph.h:2099
tbb::interface6::internal::aggregating_functor
Definition: _aggregator_impl.h:160
tbb::flow::interface11::multifunction_node::output_type
null_type output_type
Definition: flow_graph.h:1277
tbb::flow::interface11::indexer_node< T0, T1 >::output_type
internal::tagged_msg< size_t, T0, T1 > output_type
Definition: flow_graph.h:3132
internal::node_cache::empty
bool empty()
Definition: _flow_graph_cache_impl.h:35
tbb::flow::interface11::buffer_node::try_put_and_add_task
void try_put_and_add_task(task *&last_task)
Definition: flow_graph.h:1923
tbb::flow::interface10::graph::my_reset_task_list
task_list_type my_reset_task_list
Definition: _flow_graph_impl.h:416
internal::source_task_bypass
A task that calls a node's apply_body_bypass function with no input.
Definition: _flow_graph_body_impl.h:320
tbb::flow::interface11::broadcast_node::broadcast_node
__TBB_NOINLINE_SYM broadcast_node(const broadcast_node &src)
Definition: flow_graph.h:1597
internal::function_input_base< Input, Policy, Allocator, multifunction_input< Input, internal::wrap_tuple_elements< tbb::flow::tuple_size< Output >::value, internal::multifunction_output, Output >::type, Policy, Allocator > >::graph_reference
graph & graph_reference() const __TBB_override
Definition: _flow_graph_node_impl.h:194
tbb::flow::interface11::priority_queue_node::order
void order()
Definition: flow_graph.h:2479
tbb::flow::interface11::async_msg
Definition: flow_graph.h:208
tbb::flow::interface11::overwrite_node::register_predecessor_task::o
predecessor_type & o
Definition: flow_graph.h:4206
tbb::flow::interface11::indexer_node< T0 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3114
tbb::flow::interface11::sequencer_node::my_sequencer
internal::function_body< T, size_t > * my_sequencer
Definition: flow_graph.h:2300
tbb::flow::interface11::continue_receiver::my_initial_predecessor_count
int my_initial_predecessor_count
Definition: flow_graph.h:684
tbb::flow::interface11::buffer_node::try_get
bool try_get(T &v) __TBB_override
Request an item from the buffer_node.
Definition: flow_graph.h:2114
tbb::flow::interface11::queue_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2292
internal::item_buffer::destroy_item
void destroy_item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:123
tbb::flow::interface11::make_edge
void make_edge(sender< T > &p, receiver< T > &s)
Makes an edge between a single predecessor and a single successor.
Definition: flow_graph.h:3453
tbb::flow::interface11::queue_node::internal_reserve
void internal_reserve(queue_operation *op) __TBB_override
Definition: flow_graph.h:2244
internal::graph_policy_namespace::queueing
Definition: _flow_graph_body_impl.h:70
tbb::flow::interface11::source_node::remove_successor
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
Definition: flow_graph.h:964
tbb::flow::interface11::internal_remove_edge
void internal_remove_edge(internal::untyped_sender &p, internal::untyped_receiver &s)
Definition: flow_graph.h:3501
internal::item_buffer::grow_my_array
void grow_my_array(size_t minimum_size)
Grows the internal array.
Definition: _flow_graph_item_buffer_impl.h:159
tbb::flow::interface11::buffer_node::buffer_operation::r
successor_type * r
Definition: flow_graph.h:1751
tbb::flow::interface11::source_node::apply_body_bypass
task * apply_body_bypass()
Applies the body. Returning SUCCESSFULLY_ENQUEUED okay; forward_task_bypass will handle it.
Definition: flow_graph.h:1145
tbb::flow::internal::node_priority_t
unsigned int node_priority_t
Definition: _flow_graph_impl.h:63
tbb::flow::interface11::queue_node::output_type
T output_type
Definition: flow_graph.h:2260
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::add_nodes
void add_nodes(const NodeTypes &... n)
Definition: flow_graph.h:3700
tbb::flow::interface11::function_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1244
tbb::interface6::internal::aggregated_operation
aggregated_operation base class
Definition: _aggregator_impl.h:33
tbb::flow::interface11::limiter_node::my_mutex
spin_mutex my_mutex
Definition: flow_graph.h:2619
tbb::flow::interface11::limiter_node::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2875
tbb::flow::interface11::indexer_node
Definition: flow_graph.h:3090
tbb::flow::interface11::internal::round_robin_cache
Definition: flow_graph.h:121
tbb::flow::interface11::source_node::register_successor
bool register_successor(successor_type &r) __TBB_override
Add a new successor to this node.
Definition: flow_graph.h:955
_flow_graph_trace_impl.h
tbb::flow::interface11::continue_node::continue_node
__TBB_NOINLINE_SYM continue_node(const continue_node &src)
Copy constructor.
Definition: flow_graph.h:1528
tbb::flow::interface11::split_node::output_ports_type
internal::wrap_tuple_elements< N, internal::multifunction_output, TupleType >::type output_ports_type
Definition: flow_graph.h:1366
tbb::flow::interface11::overwrite_node::try_put_task_impl
task * try_put_task_impl(const input_type &v)
Definition: flow_graph.h:4181
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::my_output_ports
std::unique_ptr< output_ports_type > my_output_ports
Definition: flow_graph.h:3602
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4 >::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4 > output_type
Definition: flow_graph.h:3231
parent
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id parent
Definition: ittnotify_static.h:176
internal::function_input_base< Input, Policy, A, function_input< Input, Output, Policy, A > >::my_predecessors
predecessor_cache< input_type, null_mutex > my_predecessors
Definition: _flow_graph_node_impl.h:185
tbb::flow::interface11::buffer_node::input_type
T input_type
Definition: flow_graph.h:1706
tbb::flow::interface11::priority_queue_node::internal_reserve
void internal_reserve(prio_operation *op) __TBB_override
Definition: flow_graph.h:2451
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::composite_node
composite_node(graph &g)
Definition: flow_graph.h:3682
tbb::flow::interface11::multifunction_node::output_ports_type
internal::wrap_tuple_elements< N, internal::multifunction_output, Output >::type output_ports_type
Definition: flow_graph.h:1278
tbb::flow::interface11::buffer_node::internal_reserve
virtual void internal_reserve(buffer_operation *op)
Definition: flow_graph.h:1979
__TBB_DEPRECATED_LIMITER_EXPR
#define __TBB_DEPRECATED_LIMITER_EXPR(expr)
Definition: _flow_graph_impl.h:52
tbb::flow::interface11::sender::try_reserve
virtual bool try_reserve(T &)
Reserves an item in the sender.
Definition: flow_graph.h:428
tbb::flow::interface11::buffer_node::reg_succ
Definition: flow_graph.h:1725
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5 >::InputTuple
tuple< T0, T1, T2, T3, T4, T5 > InputTuple
Definition: flow_graph.h:3264
tbb::flow::interface11::internal::async_helpers::to_void_ptr
static const void * to_void_ptr(const T &t)
Definition: flow_graph.h:221
tbb::flow::interface11::priority_queue_node::mark
size_type mark
Definition: flow_graph.h:2500
_warning_suppress_disable_notice.h
tbb::flow::interface11::buffer_node::con_res
Definition: flow_graph.h:1725
internal::reservable_item_buffer::release_front
void release_front()
Definition: _flow_graph_item_buffer_impl.h:273
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple<> >::add_visible_nodes
void add_visible_nodes(const NodeTypes &... n)
Definition: flow_graph.h:3697
tbb::flow::interface11::receiver::try_put_task_wrapper
virtual task * try_put_task_wrapper(const void *p, bool is_async) __TBB_override
Definition: flow_graph.h:473
tbb::flow::interface11::continue_receiver::is_continue_receiver
bool is_continue_receiver() __TBB_override
Definition: flow_graph.h:705
tbb::flow::interface11::join_node< OutputTuple, reserving >::output_type
OutputTuple output_type
Definition: flow_graph.h:2911
tbb::flow::interface11::async_node::try_put_impl
bool try_put_impl(const Output &i)
Implements gateway_type::try_put for an external activity to submit a message to FG.
Definition: flow_graph.h:3879
__TBB_override
#define __TBB_override
Definition: tbb_stddef.h:240
tbb::flow::interface11::split_node::base_type
receiver< TupleType > base_type
Definition: flow_graph.h:1351
tbb::flow::interface11::buffer_node::handle_operations
virtual void handle_operations(buffer_operation *op_list)
Definition: flow_graph.h:1769
tbb::flow::interface11::overwrite_node::output_type
T output_type
Definition: flow_graph.h:4019
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3)
Definition: flow_graph.h:3007
tbb::flow::interface11::join_node< OutputTuple, reserving >::join_node
__TBB_NOINLINE_SYM join_node(graph &g)
Definition: flow_graph.h:2913
tbb::flow::interface11::priority_queue_node::try_put_and_add_task
void try_put_and_add_task(task *&last_task)
Definition: flow_graph.h:2488
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::set_external_ports
void set_external_ports(T1 &&input_ports_tuple, T2 &&output_ports_tuple)
Definition: flow_graph.h:3623
tbb::flow::interface11::buffer_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2191
tbb::flow::interface11::continue_receiver::my_current_count
int my_current_count
Definition: flow_graph.h:683
internal::unfolded_join_node::input_ports_type
wrap_tuple_elements< N, PT, OutputTuple >::type input_ports_type
Definition: _flow_graph_join_impl.h:1510
tbb::flow::interface11::internal::untyped_receiver::try_put_task
task * try_put_task(const X &t)
Definition: flow_graph.h:397
tbb::flow::interface11::buffer_node::enqueue_forwarding_task
bool enqueue_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:1827
tbb::flow::interface11::limiter_node::initialize
void initialize()
Definition: flow_graph.h:2704
s
void const char const char int ITT_FORMAT __itt_group_sync s
Definition: ittnotify_static.h:91
internal::reservable_item_buffer::consume_front
void consume_front()
Definition: _flow_graph_item_buffer_impl.h:267
tbb::flow::interface11::limiter_node::limiter_node
limiter_node(graph &g, __TBB_DEPRECATED_LIMITER_ARG2(size_t threshold, int num_decrement_predecessors=0))
Constructor.
Definition: flow_graph.h:2725
tbb::flow::interface11::indexer_node< T0, T1, T2, T3 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3200
tbb::internal::fgt_async_commit
static void fgt_async_commit(void *, void *)
Definition: _flow_graph_trace_impl.h:342
tbb::flow::interface11::internal::async_body_base
Definition: flow_graph.h:3785
tbb::flow::interface11::buffer_node::buffer_operation::ltask
task * ltask
Definition: flow_graph.h:1750
tbb::flow::interface11::priority_queue_node::prio_operation
buffer_node< T, A >::buffer_operation prio_operation
Definition: flow_graph.h:2420
tbb::flow::interface11::continue_node
Implements an executable node that supports continue_msg -> Output.
Definition: flow_graph.h:1441
tbb::flow::interface11::indexer_node< T0, T1, T2, T3 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3213
tbb::flow::interface11::internal::async_helpers::from_void_ptr
static const T & from_void_ptr(const void *p)
Definition: flow_graph.h:229
tbb::flow::interface11::broadcast_node::remove_successor
bool remove_successor(successor_type &r) __TBB_override
Removes s as a successor.
Definition: flow_graph.h:1618
tbb::flow::interface11::receiver_gateway
Definition: flow_graph_abstractions.h:37
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7, T8 >::InputTuple
tuple< T0, T1, T2, T3, T4, T5, T6, T7, T8 > InputTuple
Definition: flow_graph.h:3372
tbb::flow::interface11::async_node::try_put_functor::operator()
void operator()()
Definition: flow_graph.h:3848
tbb::flow::interface11::internal::successor_cache
Definition: flow_graph.h:119
tbb::flow::interface11::sequencer_node::sequencer_operation
buffer_node< T, A >::buffer_operation sequencer_operation
Definition: flow_graph.h:2345
internal::multifunction_body_leaf
leaf for multifunction. OutputSet can be a std::tuple or a vector.
Definition: _flow_graph_body_impl.h:202
tbb::flow::interface11::limiter_node::register_predecessor
bool register_predecessor(predecessor_type &src) __TBB_override
Adds src to the list of cached predecessors.
Definition: flow_graph.h:2825
tbb::flow::interface11::sequencer_node::sequencer_node
__TBB_NOINLINE_SYM sequencer_node(graph &g, const Sequencer &s)
Constructor.
Definition: flow_graph.h:2311
tbb::flow::interface11::continue_receiver::reset_receiver
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:690
internal::reservable_item_buffer
item_buffer with reservable front-end. NOTE: if reserving, do not
Definition: _flow_graph_item_buffer_impl.h:248
internal::multifunction_input< Input, internal::wrap_tuple_elements< tbb::flow::tuple_size< Output >::value, internal::multifunction_output, Output >::type, Policy, Allocator >::my_body
multifunction_body_type * my_body
Definition: _flow_graph_node_impl.h:711
tbb::flow::interface11::sequencer_node::input_type
T input_type
Definition: flow_graph.h:2304
internal::clear_element
Definition: _flow_graph_node_impl.h:525
tbb::internal::no_assign
Base class for types that should not be assigned.
Definition: tbb_stddef.h:322
task
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task
Definition: ittnotify_static.h:119
tbb::flow::interface11::overwrite_node::register_predecessor_task
Breaks an infinite loop between the node reservation and register_successor call.
Definition: flow_graph.h:4194
tbb::flow::interface11::queue_node::queue_node
__TBB_NOINLINE_SYM queue_node(graph &g)
Constructor.
Definition: flow_graph.h:2265
tbb::flow::interface10::graph::const_iterator
tbb::flow::interface11::graph_iterator< const graph, const tbb::flow::interface11::graph_node > const_iterator
Definition: _flow_graph_impl.h:384
tbb::flow::interface11::split_node::output_ports
output_ports_type & output_ports()
Definition: flow_graph.h:1397
tbb::flow::interface11::priority_queue_node
Forwards messages in priority order.
Definition: flow_graph.h:2373
internal::decrementer
Definition: _flow_graph_body_impl.h:344
tbb::flow::interface11::multifunction_node::multifunction_node
__TBB_NOINLINE_SYM multifunction_node(const multifunction_node &other)
Definition: flow_graph.h:1322
tbb::flow::interface11::receiver
Pure virtual template class that defines a receiver of messages of type T.
Definition: flow_graph.h:110
tbb::flow::interface11::continue_receiver::try_put_task
task * try_put_task(const input_type &) __TBB_override
Definition: flow_graph.h:664
tbb::flow::interface11::source_node::copy_function_object
Body copy_function_object()
Definition: flow_graph.h:1060
tbb::flow::interface11::async_node::gateway
gateway_type & gateway()
Definition: flow_graph.h:3946
tbb::flow::interface11::sequencer_node::internal_push
bool internal_push(sequencer_operation *op) __TBB_override
Definition: flow_graph.h:2348
tbb::flow::interface11::source_node::my_successors
internal::broadcast_cache< output_type > my_successors
Definition: flow_graph.h:1099
tbb::flow::interface11::buffer_node::is_item_valid
bool is_item_valid()
Definition: flow_graph.h:1919
tbb::flow::interface10::graph::reset
void reset(tbb::flow::interface11::reset_flags f=tbb::flow::interface11::rf_reset_protocol)
Definition: flow_graph.h:835
internal::reservable_item_buffer::reset
void reset()
Definition: _flow_graph_item_buffer_impl.h:255
tbb::internal::is_same_type
Detects whether two given types are the same.
Definition: _template_helpers.h:61
tbb::flow::interface11::internal::async_body::get_body
Body get_body()
Definition: flow_graph.h:3811
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6, T7, T8 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3388
tbb::flow::interface11::queue_node::try_put_and_add_task
void try_put_and_add_task(task *&last_task)
Definition: flow_graph.h:2220
tbb::flow::interface11::overwrite_node::my_successors
internal::broadcast_cache< input_type, null_rw_mutex > my_successors
Definition: flow_graph.h:4211
internal::function_output::my_successors
broadcast_cache_type my_successors
Definition: _flow_graph_node_impl.h:920
tbb::flow::interface11::async_node::input_type
Input input_type
Definition: flow_graph.h:3831
tbb::flow::interface11::source_node::try_release
bool try_release() __TBB_override
Release a reserved item.
Definition: flow_graph.h:1030
tbb::flow::interface11::write_once_node::try_put_task
task * try_put_task(const T &v) __TBB_override
Put item to successor; return task to run the successor if possible.
Definition: flow_graph.h:4267
tbb::flow::interface11::internal::untyped_sender::try_consume
virtual bool try_consume()
Consumes the reserved item.
Definition: flow_graph.h:321
tbb::flow::interface11::overwrite_node::successor_type
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:4021
tbb::flow::interface11::continue_receiver::my_predecessor_count
int my_predecessor_count
Definition: flow_graph.h:682
tbb::flow::interface11::async_node::remove_successor
bool remove_successor(successor_type &r) __TBB_override
Removes a successor from this node.
Definition: flow_graph.h:3964
internal::reservable_item_buffer::my_reserved
bool my_reserved
Definition: _flow_graph_item_buffer_impl.h:279
tbb::flow::interface11::overwrite_node::my_buffer
input_type my_buffer
Definition: flow_graph.h:4215
tbb::flow::interface11::rf_clear_edges
Definition: _flow_graph_impl.h:161
internal::item_buffer::size
size_type size(size_t new_tail=0)
Definition: _flow_graph_item_buffer_impl.h:152
tbb::flow::interface11::overwrite_node::clear
void clear()
Definition: flow_graph.h:4166
tbb::flow::interface11::indexer_node::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3424
tbb::flow::interface11::priority_queue_node::handle_operations
void handle_operations(prio_operation *op_list) __TBB_override
Definition: flow_graph.h:2427
tbb::flow::interface11::sequencer_node::size_type
buffer_node< T, A >::size_type size_type
Definition: flow_graph.h:2344
tbb::flow::interface11::buffer_node::try_release
bool try_release() __TBB_override
Release a reserved item.
Definition: flow_graph.h:2135
tbb::task::allocate_root
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
Definition: task.h:652
tbb::flow::interface11::internal::untyped_receiver::~untyped_receiver
virtual ~untyped_receiver()
Destructor.
Definition: flow_graph.h:365
tbb::flow::interface11::internal::async_helpers::from_void_ptr
static T & from_void_ptr(void *p)
Definition: flow_graph.h:233
tbb::flow::interface11::split_node::reset_receiver
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:1411
__TBB_NOINLINE_SYM
#define __TBB_NOINLINE_SYM
Definition: flow_graph.h:45
tbb::flow::interface11::multifunction_node
implements a function node that supports Input -> (set of outputs)
Definition: flow_graph.h:1260
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5 >::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5 > output_type
Definition: flow_graph.h:3265
tbb::flow::interface11::internal::untyped_receiver::proxy_dependency_receiver
friend class proxy_dependency_receiver
Definition: flow_graph.h:358
internal::FAILED
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::source_node::reset_node
void reset_node(reset_flags f) __TBB_override
resets the source_node to its initial state
Definition: flow_graph.h:1077
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3316
tbb::flow::interface11::buffer_node::my_successors
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:1717
tbb::flow::interface11::write_once_node::input_type
T input_type
Definition: flow_graph.h:4230
tbb::flow::interface11::buffer_node::reset_receiver
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:2180
tbb::flow::interface11::overwrite_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:4020
internal::unfolded_indexer_node
Definition: _flow_graph_indexer_impl.h:466
tbb::flow::interface10::graph
The graph class.
Definition: _flow_graph_impl.h:211
tbb::flow::interface10::graph::reserve_wait
void reserve_wait() __TBB_override
Used to register that an external entity may still interact with the graph.
Definition: flow_graph.h:798
tbb::flow::interface11::buffer_node::internal_forward_task
virtual void internal_forward_task(buffer_operation *op)
Tries to forward valid items to successors.
Definition: flow_graph.h:1935
tbb::flow::interface11::continue_receiver
Base class for receivers of completion messages.
Definition: flow_graph.h:591
tbb::flow::interface11::async_node::receiver_gateway_impl
Definition: flow_graph.h:3853
tbb::flow::interface11::internal::async_helpers::try_put_task_wrapper_impl
static task * try_put_task_wrapper_impl(receiver< T > *const this_recv, const void *p, bool is_async)
Definition: flow_graph.h:237
tbb::flow::interface11::queue_node
Forwards messages in FIFO order.
Definition: flow_graph.h:2206
tbb::flow::interface11::graph_node::~graph_node
virtual ~graph_node()
Definition: flow_graph.h:884
tbb::flow::interface10::graph::register_node
void register_node(tbb::flow::interface11::graph_node *n)
Definition: flow_graph.h:812
tbb::flow::interface11::continue_msg
An empty class used for messages that mean "I'm done".
Definition: flow_graph.h:106
tbb::flow::interface11::composite_node< tbb::flow::tuple<>, tbb::flow::tuple< OutputTypes... > >::my_output_ports
std::unique_ptr< output_ports_type > my_output_ports
Definition: flow_graph.h:3728
tbb::internal::fgt_node
static void fgt_node(void *, string_index, void *, void *)
Definition: _flow_graph_trace_impl.h:326
tbb::flow::interface11::priority_queue_node::input_type
T input_type
Definition: flow_graph.h:2375
tbb::flow::interface11::internal::untyped_receiver::graph_reference
virtual graph & graph_reference() const =0
tbb::flow::interface11::overwrite_node::register_predecessor_task::s
successor_type & s
Definition: flow_graph.h:4207
tbb::flow::interface11::buffer_node::grab_forwarding_task
task * grab_forwarding_task(buffer_operation &op_data)
Definition: flow_graph.h:1823
tbb::flow::interface11::overwrite_node::try_put_task
task * try_put_task(const input_type &v) __TBB_override
Put item to successor; return task to run the successor if possible.
Definition: flow_graph.h:4176
value
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
Definition: ittnotify_static.h:192
tbb::flow::interface11::internal::untyped_receiver::register_predecessor
virtual bool register_predecessor(predecessor_type &)
Add a predecessor to the node.
Definition: flow_graph.h:381
tbb::flow::interface11::internal::untyped_receiver::reset_receiver
virtual void reset_receiver(reset_flags f=rf_reset_protocol)=0
put receiver back in initial state
tbb::flow::interface11::internal::untyped_receiver::remove_predecessor
virtual bool remove_predecessor(predecessor_type &)
Remove a predecessor from the node.
Definition: flow_graph.h:384
tbb::flow::interface11::internal::async_helpers< T, typename std::enable_if< std::is_base_of< async_msg< typename T::async_msg_data_type >, T >::value >::type >::to_void_ptr
static const void * to_void_ptr(const T &t)
Definition: flow_graph.h:263
tbb::flow::interface11::async_node::async_body_base_type
internal::async_body_base< gateway_type > async_body_base_type
Definition: flow_graph.h:3837
tbb::flow::interface11::graph_iterator
Definition: _flow_graph_impl.h:91
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6 >::output_type
internal::tagged_msg< size_t, T0, T1, T2, T3, T4, T5, T6 > output_type
Definition: flow_graph.h:3301
tbb::flow::interface11::internal::async_body_base::my_gateway
gateway_type * my_gateway
Definition: flow_graph.h:3795
internal::function_input_queue
Definition: _flow_graph_node_impl.h:34
tbb::flow::interface11::internal::deactivate_graph
void deactivate_graph(tbb::flow::interface10::graph &g)
Definition: _flow_graph_impl.h:490
port_ref
internal::port_ref_impl< N1, N2 > port_ref()
Definition: _flow_graph_streaming_node.h:41
tbb::task_list::empty
bool empty() const
True if list is empty; false otherwise.
Definition: task.h:1077
tbb::task
Base class for user-defined tasks.
Definition: task.h:604
tbb::internal::fgt_async_try_put_begin
static void fgt_async_try_put_begin(void *, void *)
Definition: _flow_graph_trace_impl.h:339
tbb::flow::interface11::buffer_node::try_fwd_task
Definition: flow_graph.h:1725
tbb::flow::interface11::continue_receiver::input_type
__TBB_DEPRECATED typedef continue_msg input_type
The input type.
Definition: flow_graph.h:595
tbb::flow::interface11::source_node::my_init_body
internal::source_body< output_type > * my_init_body
Definition: flow_graph.h:1098
tbb::flow::interface11::queue_node::size_type
base_type::size_type size_type
Definition: flow_graph.h:2209
tbb::flow::interface11::source_node::source_node
__TBB_NOINLINE_SYM source_node(const source_node &src)
Copy constructor.
Definition: flow_graph.h:934
tbb::flow::interface11::broadcast_node::try_put_task
task * try_put_task(const T &t) __TBB_override
build a task to run the successor if possible. Default is old behavior.
Definition: flow_graph.h:1679
_flow_graph_types_impl.h
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6, __TBB_B7 b7)
Definition: flow_graph.h:3038
internal::graph_policy_namespace
Definition: _flow_graph_body_impl.h:66
tbb::flow::interface11::priority_queue_node::heapify
void heapify()
Definition: flow_graph.h:2549
tbb::flow::interface11::continue_node::output_type
Output output_type
Definition: flow_graph.h:1445
tbb::flow::interface11::source_node::try_reserve
bool try_reserve(output_type &v) __TBB_override
Reserves an item.
Definition: flow_graph.h:1013
name
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name
Definition: ittnotify_static.h:93
tbb::flow::interface11::internal::async_body_base::gateway_type
Gateway gateway_type
Definition: flow_graph.h:3787
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::output_type
OutputTuple output_type
Definition: flow_graph.h:2980
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(const join_node &other)
Definition: flow_graph.h:3071
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::output_ports
output_ports_type & output_ports()
Definition: flow_graph.h:3650
tbb::internal::fgt_end_body
static void fgt_end_body(void *)
Definition: _flow_graph_trace_impl.h:337
tbb::flow::interface11::overwrite_node::my_mutex
spin_mutex my_mutex
Definition: flow_graph.h:4210
tbb::flow::interface11::internal::activate_graph
void activate_graph(tbb::flow::interface10::graph &g)
Definition: _flow_graph_impl.h:486
tbb::flow::interface11::multifunction_node::input_type
Input input_type
Definition: flow_graph.h:1276
tbb_stddef.h
tbb::flow::interface11::priority_queue_node::internal_consume
void internal_consume(prio_operation *op) __TBB_override
Definition: flow_graph.h:2463
tbb::flow::interface11::indexer_node::unfolded_type
internal::unfolded_indexer_node< InputTuple > unfolded_type
Definition: flow_graph.h:3410
tbb::flow::serial
Definition: flow_graph.h:98
internal::item_buffer::front
const item_type & front() const
Definition: _flow_graph_item_buffer_impl.h:130
_warning_suppress_enable_notice.h
tbb::flow::interface10::graph::my_is_active
bool my_is_active
Definition: _flow_graph_impl.h:415
tbb::flow::interface11::limiter_node::decrement_counter
task * decrement_counter(long long delta)
Definition: flow_graph.h:2691
tbb::flow::interface11::sender::try_get_wrapper
virtual bool try_get_wrapper(void *p, bool is_async) __TBB_override
Definition: flow_graph.h:431
tbb::flow::interface11::split_node::N
static const int N
Definition: flow_graph.h:1350
p
void const char const char int ITT_FORMAT __itt_group_sync p
Definition: ittnotify_static.h:91
tbb::flow::interface11::split_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1405
tbb::internal::fgt_graph
static void fgt_graph(void *)
Definition: _flow_graph_trace_impl.h:303
tbb::flow::interface11::continue_node::continue_node
__TBB_NOINLINE_SYM continue_node(graph &g, int number_of_predecessors,)
Constructor for executable node with continue_msg -> Output.
Definition: flow_graph.h:1490
tbb::flow::interface11::sequencer_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:2306
tbb::flow::interface11::rf_reset_bodies
Definition: _flow_graph_impl.h:160
internal::successor_cache::empty
bool empty()
Definition: _flow_graph_cache_impl.h:346
internal::item_buffer::destroy_front
void destroy_front()
Definition: _flow_graph_item_buffer_impl.h:147
tbb::flow::interface11::async_node::mfn_input_type
internal::multifunction_input< Input, typename base_type::output_ports_type, Policy, Allocator > mfn_input_type
Definition: flow_graph.h:3828
tbb::flow::interface11::internal::untyped_sender
Definition: flow_graph.h:298
tbb::flow::interface11::internal::enqueue_in_graph_arena
void enqueue_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Enqueues a task inside graph arena.
Definition: _flow_graph_impl.h:530
tbb::flow::interface11::buffer_node::my_aggregator
internal::aggregator< handler_type, buffer_operation > my_aggregator
Definition: flow_graph.h:1767
tbb::flow::interface11::function_node::function_node
__TBB_NOINLINE_SYM function_node(const function_node &src)
Copy constructor.
Definition: flow_graph.h:1215
internal::item_buffer::back
const item_type & back() const
Definition: _flow_graph_item_buffer_impl.h:137
internal::source_body_leaf
The leaf for source_body.
Definition: _flow_graph_body_impl.h:105
tbb::flow::interface11::source_node::try_get
bool try_get(output_type &v) __TBB_override
Request an item from the node.
Definition: flow_graph.h:996
internal::cast_to
const V & cast_to(T const &t)
Definition: _flow_graph_types_impl.h:714
_flow_graph_body_impl.h
tbb::flow::interface11::buffer_node::rem_succ
Definition: flow_graph.h:1725
internal::round_robin_cache
A cache of successors that are put in a round-robin fashion.
Definition: _flow_graph_cache_impl.h:546
tbb::flow::interface11::internal::async_storage
Definition: flow_graph.h:212
tbb::flow::interface11::async_node::try_put_functor::result
bool result
Definition: flow_graph.h:3846
tbb::flow::interface11::sender::filtered_type
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
Definition: flow_graph.h:422
tbb::flow::interface11::source_node::source_node
__TBB_NOINLINE_SYM source_node(graph &g, Body body, bool is_active=true)
Constructor for a node with a successor.
Definition: flow_graph.h:914
null_mutex.h
internal::continue_input
Implements methods for an executable node that takes continue_msg as input.
Definition: _flow_graph_node_impl.h:753
tbb::flow::interface11::buffer_node::internal_consume
virtual void internal_consume(buffer_operation *op)
Definition: flow_graph.h:1988
tbb::flow::interface11::source_node::my_cached_item
output_type my_cached_item
Definition: flow_graph.h:1102
tbb::flow::interface10::graph::my_root_task
tbb::task * my_root_task
Definition: _flow_graph_impl.h:408
tbb::flow::interface11::async_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:4004
internal::successor_cache
An abstract cache of successors.
Definition: _flow_graph_cache_impl.h:273
tbb::spin_mutex::scoped_lock
Represents acquisition of a mutex.
Definition: spin_mutex.h:53
tbb::flow::interface11::write_once_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:4233
tbb::internal::enable_if
Enables one or the other code branches.
Definition: _template_helpers.h:34
tbb::flow::interface11::overwrite_node::is_valid
bool is_valid()
Definition: flow_graph.h:4161
tbb::flow::interface11::buffer_node::op_type
op_type
Definition: flow_graph.h:1725
tbb::flow::interface10::graph::cbegin
const_iterator cbegin() const
start const iterator
Definition: flow_graph.h:866
internal::output_port
tbb::flow::tuple_element< N, typename MOP::output_ports_type >::type & output_port(MOP &op)
Definition: _flow_graph_node_impl.h:719
tbb::flow::interface11::split_node::split_node
__TBB_NOINLINE_SYM split_node(const split_node &other)
Definition: flow_graph.h:1383
S
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark S
Definition: ittnotify_static.h:212
tbb::flow::interface11::indexer_node< T0 >::output_type
internal::tagged_msg< size_t, T0 > output_type
Definition: flow_graph.h:3099
tbb::flow::interface11::function_node::successor_type
fOutput_type::successor_type successor_type
Definition: flow_graph.h:1169
tbb::flow::interface11::limiter_node::limiter_node
limiter_node(const limiter_node &src)
Copy constructor.
Definition: flow_graph.h:2744
tbb::flow::interface11::overwrite_node::overwrite_node
__TBB_NOINLINE_SYM overwrite_node(graph &g)
Definition: flow_graph.h:4029
tbb::flow::interface10::graph::root_task
tbb::task * root_task()
Returns the root task of the graph.
Definition: _flow_graph_impl.h:374
tbb::flow::interface11::buffer_node::forward_task
virtual task * forward_task()
This is executed by an enqueued task, the "forwarder".
Definition: flow_graph.h:1837
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2)
Definition: flow_graph.h:3002
tbb::flow::interface11::buffer_node::handler_type
internal::aggregating_functor< class_type, buffer_operation > handler_type
Definition: flow_graph.h:1765
tbb::flow::interface11::priority_queue_node::is_item_valid
bool is_item_valid()
Definition: flow_graph.h:2484
tbb::flow::interface11::buffer_node::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2176
tbb::flow::interface11::join_node< OutputTuple, queueing >::output_type
OutputTuple output_type
Definition: flow_graph.h:2944
internal::function_input< Input, Output, Policy, Allocator >::my_body
function_body_type * my_body
Definition: _flow_graph_node_impl.h:517
tbb::flow::interface10::graph::release_wait
void release_wait() __TBB_override
Deregisters an external entity that may have interacted with the graph.
Definition: flow_graph.h:805
__TBB_DEPRECATED_LIMITER_ARG2
#define __TBB_DEPRECATED_LIMITER_ARG2(arg1, arg2)
Definition: _flow_graph_impl.h:53
tbb::flow::interface11::queue_node::internal_pop
void internal_pop(queue_operation *op) __TBB_override
Definition: flow_graph.h:2235
tbb::flow::interface11::buffer_node::handle_operations_impl
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
Definition: flow_graph.h:1774
tbb::flow::interface11::internal::async_helpers::is_async_type
static const bool is_async_type
Definition: flow_graph.h:219
tbb::flow::interface11::indexer_node< T0, T1, T2 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(const indexer_node &other)
Definition: flow_graph.h:3180
internal::is_a
bool is_a(T const &t)
Definition: _flow_graph_types_impl.h:717
tbb::flow::interface10::graph::own_context
bool own_context
Definition: _flow_graph_impl.h:412
tbb::flow::interface11::overwrite_node::reset_receiver
void reset_receiver(reset_flags) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:4217
tbb::flow::interface11::multifunction_node::base_type
internal::multifunction_input< input_type, output_ports_type, Policy, Allocator > base_type
Definition: flow_graph.h:1282
tbb::flow::interface11::function_node::function_node
__TBB_NOINLINE_SYM function_node(graph &g, size_t concurrency, __TBB_FLOW_GRAPH_PRIORITY_ARG1(Body body, node_priority_t priority=tbb::flow::internal::no_priority))
Constructor.
Definition: flow_graph.h:1181
tbb::flow::interface11::limiter_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:2604
tbb::flow::interface11::source_node::input_type
null_type input_type
Definition: flow_graph.h:905
type
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
Definition: ittnotify_static.h:198
tbb::flow::interface11::continue_receiver::my_mutex
spin_mutex my_mutex
Definition: flow_graph.h:681
internal::item_buffer::place_item
bool place_item(size_t here, const item_type &me)
Definition: _flow_graph_item_buffer_impl.h:107
tbb::flow::interface10::graph::caught_exception
bool caught_exception
Definition: _flow_graph_impl.h:414
tbb::flow::interface11::overwrite_node::overwrite_node
__TBB_NOINLINE_SYM overwrite_node(const overwrite_node &src)
Copy constructor; doesn't take anything from src; default won't work.
Definition: flow_graph.h:4043
tbb::interface6::internal::aggregated_operation::next
Derived * next
Definition: _aggregator_impl.h:38
tbb::flow::interface11::continue_node::fOutput_type
internal::function_output< output_type > fOutput_type
Definition: flow_graph.h:1447
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4)
Definition: flow_graph.h:3012
tbb::flow::interface11::queue_node::base_type
buffer_node< T, A > base_type
Definition: flow_graph.h:2208
tbb::internal::call
void call(F &&f, Pack &&p)
Calls the given function with arguments taken from a stored_pack.
Definition: _template_helpers.h:175
tbb::flow::interface11::async_node::receiver_type
receiver< input_type > receiver_type
Definition: flow_graph.h:3833
tbb::flow::interface11::internal::untyped_receiver::is_continue_receiver
virtual bool is_continue_receiver()
Definition: flow_graph.h:410
internal::tag_value
tbb::internal::uint64_t tag_value
Definition: _flow_graph_body_impl.h:28
internal::function_output::graph_reference
graph & graph_reference() const
Definition: _flow_graph_node_impl.h:918
tbb::flow::interface11::indexer_node< T0, T1, T2, T3, T4, T5, T6 >::indexer_node
__TBB_NOINLINE_SYM indexer_node(graph &g)
Definition: flow_graph.h:3303
tbb::flow::interface11::broadcast_node::predecessor_type
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:1569
tbb::flow::interface11::indexer_node< T0, T1, T2 >::output_type
internal::tagged_msg< size_t, T0, T1, T2 > output_type
Definition: flow_graph.h:3165
tbb::flow::interface11::async_node::receiver_gateway_impl::reserve_wait
void reserve_wait() __TBB_override
Inform a graph that messages may come from outside, to prevent premature graph completion.
Definition: flow_graph.h:3856
tbb::flow::interface11::limiter_node::check_conditions
bool check_conditions()
Definition: flow_graph.h:2628
null_rw_mutex.h
tbb::flow::interface11::async_node
Implements async node.
Definition: flow_graph.h:3826
tbb::flow::interface11::overwrite_node::register_predecessor_task::register_predecessor_task
register_predecessor_task(predecessor_type &owner, successor_type &succ)
Definition: flow_graph.h:4196
tbb::flow::interface11::buffer_node
Forwards messages in arbitrary order.
Definition: flow_graph.h:1704
tbb::flow::interface11::source_node::~source_node
~source_node()
The destructor.
Definition: flow_graph.h:946
internal::successor_cache::my_successors
successors_type my_successors
Definition: _flow_graph_cache_impl.h:292
tbb::flow::interface11::internal::untyped_sender::~untyped_sender
virtual ~untyped_sender()
Definition: flow_graph.h:305
tbb::flow::interface11::join_node< OutputTuple, key_matching< K, KHash > >::join_node
__TBB_NOINLINE_SYM join_node(graph &g, __TBB_B0 b0, __TBB_B1 b1, __TBB_B2 b2, __TBB_B3 b3, __TBB_B4 b4, __TBB_B5 b5, __TBB_B6 b6, __TBB_B7 b7, __TBB_B8 b8, __TBB_B9 b9)
Definition: flow_graph.h:3056
internal::reservable_item_buffer::reserve_front
bool reserve_front(T &v)
Definition: _flow_graph_item_buffer_impl.h:258
tbb::flow::interface11::function_node::output_type
Output output_type
Definition: flow_graph.h:1164
tbb::flow::interface11::async_node::predecessor_type
receiver_type::predecessor_type predecessor_type
Definition: flow_graph.h:3834
tbb::flow::interface11::composite_node< tbb::flow::tuple< InputTypes... >, tbb::flow::tuple< OutputTypes... > >::add_nodes
void add_nodes(const NodeTypes &... n)
Definition: flow_graph.h:3637
tbb::flow::interface11::indexer_node< T0, T1, T2 >::InputTuple
tuple< T0, T1, T2 > InputTuple
Definition: flow_graph.h:3164
tbb::flow::interface11::internal::untyped_sender::try_reserve
bool try_reserve(X &t)
Reserves an item in the sender.
Definition: flow_graph.h:342
tbb::flow::interface11::limiter_node::input_type
T input_type
Definition: flow_graph.h:2602
tbb::flow::interface11::priority_queue_node::item_type
buffer_node< T, A >::item_type item_type
Definition: flow_graph.h:2419
tbb::flow::interface11::internal::untyped_sender::remove_successor
virtual bool remove_successor(successor_type &r)=0
Removes a successor from this node.
tbb::flow::interface11::source_node::try_consume
bool try_consume() __TBB_override
Consumes a reserved item.
Definition: flow_graph.h:1040
_flow_graph_node_set_impl.h

Copyright © 2005-2020 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.