Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::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::interface11::function_node< Input, Output, Policy, Allocator >:
Collaboration diagram for tbb::flow::interface11::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, internals_allocatorinput_impl_type
 
typedef internal::function_input_queue< input_type, internals_allocatorinput_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::interface11::internal::function_input< Input, Output, Policy, cache_aligned_allocator< Input > >
typedef Input input_type
 
typedef Output output_type
 
typedef function_body< input_type, output_typefunction_body_type
 
typedef function_input< Input, Output, Policy, cache_aligned_allocator< Input > > my_class
 
typedef function_input_base< Input, Policy, cache_aligned_allocator< Input >, my_classbase_type
 
typedef function_input_queue< input_type, cache_aligned_allocator< Input > > input_queue_type
 
- Public Types inherited from tbb::flow::interface11::internal::function_input_base< Input, Policy, cache_aligned_allocator< Input >, function_input< Input, Output, Policy, cache_aligned_allocator< Input > > >
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, cache_aligned_allocator< Input > > input_queue_type
 
typedef tbb::internal::allocator_rebind< cache_aligned_allocator< Input >, input_queue_type >::type queue_allocator_type
 
- Public Types inherited from tbb::flow::interface11::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 
- Public Types inherited from tbb::flow::interface11::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::interface11::internal::untyped_sender
typedef untyped_receiver successor_type
 The successor type for this node. More...
 

Public Member Functions

template<typename Body >
__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. More...
 
__TBB_NOINLINE_SYM function_node (const function_node &src)
 Copy constructor. More...
 
- Public Member Functions inherited from tbb::flow::interface11::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface11::internal::function_input< Input, Output, Policy, cache_aligned_allocator< Input > >
 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::interface11::internal::function_input_base< Input, Policy, cache_aligned_allocator< Input >, function_input< Input, Output, Policy, cache_aligned_allocator< Input > > >
 __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::interface11::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::interface11::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::interface11::internal::function_output< Output >
 function_output (graph &g)
 
 function_output (const function_output &other)
 
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 ()
 
graphgraph_reference () const
 
- Public Member Functions inherited from tbb::flow::interface11::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::interface11::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::interface11::internal::function_input< Input, Output, Policy, cache_aligned_allocator< Input > >
void reset_function_input (reset_flags f)
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::function_input_base< Input, Policy, cache_aligned_allocator< Input >, function_input< Input, Output, Policy, cache_aligned_allocator< Input > > >
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 () const __TBB_override
 
tasktry_get_postponed_task (const input_type &i)
 
- Protected Member Functions inherited from tbb::flow::interface11::receiver< Input >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual bool is_continue_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface11::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::interface11::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...
 

Private Types

typedef cache_aligned_allocator< Input > internals_allocator
 

Private Member Functions

 __TBB_STATIC_ASSERT ((tbb::internal::is_same_type< Allocator, null_type >::value), "Allocator template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface.")
 

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

- Public Attributes inherited from tbb::flow::interface11::receiver< Input >
__TBB_DEPRECATED typedef Input input_type
 The input type of this receiver. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< Input >::filtered_type filtered_type
 
- Public Attributes inherited from tbb::flow::interface11::sender< Output >
__TBB_DEPRECATED typedef Output output_type
 The output type of this sender. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< Output >::filtered_type filtered_type
 
- Protected Attributes inherited from tbb::flow::interface11::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 
- Protected Attributes inherited from tbb::flow::interface11::internal::function_input< Input, Output, Policy, cache_aligned_allocator< Input > >
function_body_typemy_body
 
function_body_typemy_init_body
 
- Protected Attributes inherited from tbb::flow::interface11::internal::function_input_base< Input, Policy, cache_aligned_allocator< Input >, function_input< Input, Output, Policy, cache_aligned_allocator< Input > > >
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::interface11::internal::function_output< Output >
broadcast_cache_type my_successors
 
graphmy_graph_ref
 

Detailed Description

template<typename Input, typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
class tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >

Implements a function node that supports Input -> Output.

Definition at line 1456 of file flow_graph.h.

Member Typedef Documentation

◆ fOutput_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef internal::function_output<output_type> tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::fOutput_type

Definition at line 1482 of file flow_graph.h.

◆ input_impl_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef internal::function_input<input_type,output_type,Policy,internals_allocator> tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::input_impl_type

Definition at line 1480 of file flow_graph.h.

◆ input_queue_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef internal::function_input_queue<input_type, internals_allocator> tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::input_queue_type

Definition at line 1481 of file flow_graph.h.

◆ input_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef Input tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::input_type

Definition at line 1478 of file flow_graph.h.

◆ internals_allocator

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef cache_aligned_allocator<Input> tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::internals_allocator
private

Definition at line 1468 of file flow_graph.h.

◆ output_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef Output tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::output_type

Definition at line 1479 of file flow_graph.h.

◆ predecessor_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef input_impl_type::predecessor_type tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::predecessor_type

Definition at line 1483 of file flow_graph.h.

◆ successor_type

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
typedef fOutput_type::successor_type tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::successor_type

Definition at line 1484 of file flow_graph.h.

Constructor & Destructor Documentation

◆ function_node() [1/2]

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
template<typename Body >
__TBB_NOINLINE_SYM tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::function_node ( graph g,
size_t  concurrency,
__TBB_FLOW_GRAPH_PRIORITY_ARG1(Body body, node_priority_t priority=tbb::flow::internal::no_priority  
)
inline

Constructor.

Definition at line 1496 of file flow_graph.h.

1503  fOutput_type(g) {
1504  tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
1505  static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this), this->my_body );
1506  }
#define CODEPTR()
internal::function_input< input_type, output_type, Policy, internals_allocator > input_impl_type
Definition: flow_graph.h:1480
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
Definition: flow_graph.h:106
internal::function_output< output_type > fOutput_type
Definition: flow_graph.h:1482
static void fgt_node_with_body(void *, string_index, void *, void *, void *)

◆ function_node() [2/2]

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

Copy constructor.

Definition at line 1530 of file flow_graph.h.

1530  :
1531  graph_node(src.my_graph),
1532  input_impl_type(src),
1533  fOutput_type(src.my_graph) {
1534  tbb::internal::fgt_node_with_body( CODEPTR(), tbb::internal::FLOW_FUNCTION_NODE, &this->my_graph,
1535  static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this), this->my_body );
1536  }
#define CODEPTR()
internal::function_input< input_type, output_type, Policy, internals_allocator > input_impl_type
Definition: flow_graph.h:1480
internal::function_output< output_type > fOutput_type
Definition: flow_graph.h:1482
static void fgt_node_with_body(void *, string_index, void *, void *, void *)

Member Function Documentation

◆ __TBB_STATIC_ASSERT()

template<typename Input , typename Output = continue_msg, typename Policy = queueing, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::__TBB_STATIC_ASSERT ( (tbb::internal::is_same_type< Allocator, null_type >::value ,
"Allocator template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface."   
)
private

◆ reset_node()

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

Implements tbb::flow::interface11::graph_node.

Definition at line 1559 of file flow_graph.h.

1559  {
1561  // TODO: use clear() instead.
1562  if(f & rf_clear_edges) {
1563  successors().clear();
1565  }
1566  __TBB_ASSERT(!(f & rf_clear_edges) || successors().empty(), "function_node successors not empty");
1567  __TBB_ASSERT(this->my_predecessors.empty(), "function_node predecessors not empty");
1568  }
#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:1557

References tbb::flow::interface11::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 = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
internal::broadcast_cache<output_type>& tbb::flow::interface11::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 = __TBB_DEFAULT_NODE_ALLOCATOR(Input)>
template<typename X , typename Y >
friend class internal::broadcast_cache
friend

Definition at line 1553 of file flow_graph.h.

◆ internal::round_robin_cache

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

Definition at line 1554 of file flow_graph.h.

◆ run_and_put_task

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

Definition at line 1552 of file flow_graph.h.


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

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.