Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface10::function_node< Input, Output, Policy, Allocator > Class Template Reference

Implements a function node that supports Input -> Output. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >:
Collaboration diagram for tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >:

Public Types

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_typefOutput_type
 
typedef input_impl_type::predecessor_type predecessor_type
 
typedef fOutput_type::successor_type successor_type
 
- Public Types inherited from tbb::flow::interface10::internal::function_input< Input, Output, Policy, Allocator >
typedef Input input_type
 
typedef Output output_type
 
typedef function_body< input_type, output_typefunction_body_type
 
typedef function_input< Input, Output, Policy, Allocator > my_class
 
typedef function_input_base< Input, Policy, Allocator, my_classbase_type
 
typedef function_input_queue< input_type, Allocator > input_queue_type
 
- Public Types inherited from tbb::flow::interface10::internal::function_input_base< Input, Policy, Allocator, function_input< Input, Output, Policy, Allocator > >
typedef Input input_type
 The input type of this receiver. More...
 
typedef receiver< input_type >::predecessor_type predecessor_type
 
typedef predecessor_cache< input_type, null_mutexpredecessor_cache_type
 
typedef function_input_queue< input_type, Allocator > input_queue_type
 
typedef Allocator ::template rebind< input_queue_type >::other queue_allocator_type
 
- Public Types inherited from tbb::flow::interface10::receiver< Input >
typedef Input input_type
 The input type of this receiver. More...
 
typedef internal::async_helpers< Input >::filtered_type filtered_type
 
- Public Types inherited from tbb::flow::interface10::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 
- Public Types inherited from tbb::flow::interface10::internal::function_output< Output >
typedef Output output_type
 
typedef sender< output_type >::successor_type successor_type
 
typedef broadcast_cache< output_typebroadcast_cache_type
 
- Public Types inherited from tbb::flow::interface10::sender< Output >
typedef Output output_type
 The output type of this sender. More...
 
typedef internal::async_helpers< Output >::filtered_type filtered_type
 
- Public Types inherited from tbb::flow::interface10::internal::untyped_sender
typedef untyped_receiver successor_type
 The successor type for this node. More...
 

Public Member Functions

template<typename Body >
 function_node (graph &g, size_t concurrency,)
 Constructor. More...
 
 function_node (const function_node &src)
 Copy constructor. More...
 
- Public Member Functions inherited from tbb::flow::interface10::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface10::internal::function_input< Input, Output, Policy, Allocator >
 function_input (graph &g, size_t max_concurrency,)
 
 function_input (const function_input &src)
 Copy constructor. More...
 
 ~function_input ()
 
Body copy_function_object ()
 
output_type apply_body_impl (const input_type &i)
 
taskapply_body_impl_bypass (const input_type &i)
 
- Public Member Functions inherited from tbb::flow::interface10::internal::function_input_base< Input, Policy, Allocator, function_input< Input, Output, Policy, Allocator > >
 __TBB_STATIC_ASSERT (!((internal::has_policy< queueing, Policy >::value) &&(internal::has_policy< rejecting, Policy >::value)), "queueing and rejecting policies can't be specified simultaneously")
 
 function_input_base (graph &g, __TBB_FLOW_GRAPH_PRIORITY_ARG1(size_t max_concurrency, node_priority_t priority))
 Constructor for function_input_base. More...
 
 function_input_base (const function_input_base &src)
 Copy constructor. More...
 
virtual ~function_input_base ()
 Destructor. More...
 
tasktry_put_task (const input_type &t) __TBB_override
 Put item to successor; return task to run the successor if possible. More...
 
bool register_predecessor (predecessor_type &src) __TBB_override
 Adds src to the list of cached predecessors. More...
 
bool remove_predecessor (predecessor_type &src) __TBB_override
 Removes src from the list of cached predecessors. More...
 
- Public Member Functions inherited from tbb::flow::interface10::receiver< Input >
bool try_put (const typename internal::async_helpers< Input >::filtered_type &t)
 Put an item to the receiver. More...
 
bool try_put (const typename internal::async_helpers< Input >::async_type &t)
 
- Public Member Functions inherited from tbb::flow::interface10::internal::untyped_receiver
virtual ~untyped_receiver ()
 Destructor. More...
 
template<typename X >
bool try_put (const X &t)
 Put an item to the receiver. More...
 
- Public Member Functions inherited from tbb::flow::interface10::internal::function_output< Output >
 function_output ()
 
 function_output (const function_output &)
 
bool register_successor (successor_type &r) __TBB_override
 Adds a new successor to this node. More...
 
bool remove_successor (successor_type &r) __TBB_override
 Removes a successor from this node. More...
 
tasktry_put_task (const output_type &i)
 
broadcast_cache_typesuccessors ()
 
- Public Member Functions inherited from tbb::flow::interface10::sender< Output >
virtual bool try_get (Output &)
 Request an item from the sender. More...
 
virtual bool try_reserve (Output &)
 Reserves an item in the sender. More...
 
- Public Member Functions inherited from tbb::flow::interface10::internal::untyped_sender
virtual ~untyped_sender ()
 
virtual bool try_release ()
 Releases the reserved item. More...
 
virtual bool try_consume ()
 Consumes the reserved item. More...
 

Protected Member Functions

internal::broadcast_cache< output_type > & successors () __TBB_override
 
void reset_node (reset_flags f) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::function_input< Input, Output, Policy, Allocator >
void reset_function_input (reset_flags f)
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::function_input_base< Input, Policy, Allocator, function_input< Input, Output, Policy, Allocator > >
void reset_function_input_base (reset_flags f)
 
void reset_receiver (reset_flags f) __TBB_override
 put receiver back in initial state More...
 
graphgraph_reference () __TBB_override
 
tasktry_get_postponed_task (const input_type &i)
 
- Protected Member Functions inherited from tbb::flow::interface10::receiver< Input >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual bool is_continue_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface10::sender< Output >
virtual bool try_get_wrapper (void *p, bool is_async) __TBB_override
 
virtual bool try_reserve_wrapper (void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::untyped_sender
template<typename X >
bool try_get (X &t)
 Request an item from the sender. More...
 
template<typename X >
bool try_reserve (X &t)
 Reserves an item in the sender. More...
 

Friends

template<typename R , typename B >
class run_and_put_task
 
template<typename X , typename Y >
class internal::broadcast_cache
 
template<typename X , typename Y >
class internal::round_robin_cache
 

Additional Inherited Members

- Protected Attributes inherited from tbb::flow::interface10::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 
- Protected Attributes inherited from tbb::flow::interface10::internal::function_input< Input, Output, Policy, Allocator >
function_body_typemy_body
 
function_body_typemy_init_body
 
- Protected Attributes inherited from tbb::flow::interface10::internal::function_input_base< Input, Policy, Allocator, function_input< Input, Output, Policy, Allocator > >
graphmy_graph_ref
 
const size_t my_max_concurrency
 
size_t my_concurrency
 
input_queue_typemy_queue
 
predecessor_cache< input_type, null_mutexmy_predecessors
 
- Protected Attributes inherited from tbb::flow::interface10::internal::function_output< Output >
broadcast_cache_type my_successors
 

Detailed Description

template<typename Input, typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
class tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >

Implements a function node that supports Input -> Output.

Definition at line 1118 of file flow_graph.h.

Member Typedef Documentation

◆ fOutput_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef internal::function_output<output_type> tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::fOutput_type

Definition at line 1124 of file flow_graph.h.

◆ input_impl_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef internal::function_input<input_type,output_type,Policy,Allocator> tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::input_impl_type

Definition at line 1122 of file flow_graph.h.

◆ input_queue_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef internal::function_input_queue<input_type, Allocator> tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::input_queue_type

Definition at line 1123 of file flow_graph.h.

◆ input_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef Input tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::input_type

Definition at line 1120 of file flow_graph.h.

◆ output_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef Output tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::output_type

Definition at line 1121 of file flow_graph.h.

◆ predecessor_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef input_impl_type::predecessor_type tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::predecessor_type

Definition at line 1125 of file flow_graph.h.

◆ successor_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
typedef fOutput_type::successor_type tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::successor_type

Definition at line 1126 of file flow_graph.h.

Constructor & Destructor Documentation

◆ function_node() [1/2]

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
template<typename Body >
tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::function_node ( graph g,
size_t  concurrency 
)
inline

Constructor.

Definition at line 1138 of file flow_graph.h.

1142  tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
1143  static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this), this->my_body );
1144  }
static void fgt_node_with_body(string_index, void *, void *, void *)
internal::function_input< input_type, output_type, Policy, Allocator > input_impl_type
Definition: flow_graph.h:1122
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
Definition: flow_graph.h:84
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)

References tbb::internal::fgt_node_with_body(), and tbb::flow::interface10::graph_node::my_graph.

Here is the call graph for this function:

◆ function_node() [2/2]

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::function_node ( const function_node< Input, Output, Policy, Allocator > &  src)
inline

Copy constructor.

Definition at line 1147 of file flow_graph.h.

1147  :
1148  graph_node(src.my_graph),
1149  input_impl_type(src),
1150  fOutput_type() {
1151  tbb::internal::fgt_node_with_body( tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
1152  static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this), this->my_body );
1153  }
static void fgt_node_with_body(string_index, void *, void *, void *)
internal::function_output< output_type > fOutput_type
Definition: flow_graph.h:1124
internal::function_input< input_type, output_type, Policy, Allocator > input_impl_type
Definition: flow_graph.h:1122

References tbb::internal::fgt_node_with_body(), and tbb::flow::interface10::graph_node::my_graph.

Here is the call graph for this function:

Member Function Documentation

◆ reset_node()

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
void tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::reset_node ( reset_flags  f)
inlineprotectedvirtual

Implements tbb::flow::interface10::graph_node.

Definition at line 1176 of file flow_graph.h.

1176  {
1178  // TODO: use clear() instead.
1179  if(f & rf_clear_edges) {
1180  successors().clear();
1182  }
1183  __TBB_ASSERT(!(f & rf_clear_edges) || successors().empty(), "function_node successors not empty");
1184  __TBB_ASSERT(this->my_predecessors.empty(), "function_node predecessors not empty");
1185  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
internal::broadcast_cache< output_type > & successors() __TBB_override
Definition: flow_graph.h:1174

References tbb::flow::interface10::internal::function_input< Input, Output, Policy, A >::reset_function_input().

Here is the call graph for this function:

◆ successors()

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
internal::broadcast_cache<output_type>& tbb::flow::interface10::function_node< Input, Output, Policy, Allocator >::successors ( )
inlineprotectedvirtual

Friends And Related Function Documentation

◆ internal::broadcast_cache

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
template<typename X , typename Y >
friend class internal::broadcast_cache
friend

Definition at line 1170 of file flow_graph.h.

◆ internal::round_robin_cache

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
template<typename X , typename Y >
friend class internal::round_robin_cache
friend

Definition at line 1171 of file flow_graph.h.

◆ run_and_put_task

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = cache_aligned_allocator<Input>>
template<typename R , typename B >
friend class run_and_put_task
friend

Definition at line 1169 of file flow_graph.h.


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

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