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_allocator > | input_impl_type
typedef internal::function_input_queue< input_type, internals_allocator > | input_queue_type
typedef internal::function_output< output_type > | fOutput_type
typedef input_impl_type::predecessor_type | predecessor_type
typedef fOutput_type::successor_type | successor_type
Public Types inherited from internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >
typedef Input | input_type
typedef continue_msg | output_type
typedef function_body< input_type, output_type > | function_body_type
typedef function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > > | my_class
typedef function_input_base< Input, queueing, cache_aligned_allocator< Input >, my_class > | base_type
typedef function_input_queue< input_type, cache_aligned_allocator< Input > > | input_queue_type
Public Types inherited from internal::function_input_base< Input, Policy, A, ImplType >
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_mutex > | predecessor_cache_type
typedef function_input_queue< input_type, A > | input_queue_type
typedef tbb::internal::allocator_rebind< A, input_queue_type >::type | queue_allocator_type
Public Types inherited from internal::function_output< continue_msg >
typedef continue_msg | output_type
typedef sender< output_type >::successor_type | successor_type
typedef broadcast_cache< output_type > | broadcast_cache_type

## 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 internal::function_input< Input, continue_msg, queueing, 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)
task * | apply_body_impl_bypass (const input_type &i)
Public Member Functions inherited from internal::function_input_base< Input, Policy, A, ImplType >
| __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...
task * | try_put_task (const input_type &t) __TBB_override
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 internal::function_output< continue_msg >
| 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...
task * | try_put_task (const output_type &i)
broadcast_cache_type & | successors ()
graph & | graph_reference () const

## Protected Member Functions

internal::broadcast_cache< output_type > & | successors () __TBB_override
void | reset_node (reset_flags f) __TBB_override
Protected Member Functions inherited from internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >
void | reset_function_input (reset_flags f)
Protected Member Functions inherited from internal::function_input_base< Input, Policy, A, ImplType >
void | reset_function_input_base (reset_flags f)
void | reset_receiver (reset_flags f) __TBB_override
graph & | graph_reference () const __TBB_override
task * | try_get_postponed_task (const input_type &i)

## 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

Protected Attributes inherited from tbb::flow::interface11::graph_node
graph & | my_graph
graph_node * | next
graph_node * | prev
Protected Attributes inherited from internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >
function_body_type * | my_body
function_body_type * | my_init_body
Protected Attributes inherited from internal::function_input_base< Input, Policy, A, ImplType >
graph & | my_graph_ref
const size_t | my_max_concurrency
size_t | my_concurrency
input_queue_type * | my_queue
predecessor_cache< input_type, null_mutex > | my_predecessors
Protected Attributes inherited from internal::function_output< continue_msg >
broadcast_cache_type | my_successors
graph & | my_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.

: 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 );
}
__TBB_FLOW_GRAPH_PRIORITY_ARG1
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
Definition: _flow_graph_impl.h:40
CODEPTR
#define CODEPTR()
Definition: _flow_graph_trace_impl.h:297
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::concurrency
concurrency
An enumeration the provides the two most common concurrency levels: unlimited and serial.
Definition: flow_graph.h:106
tbb::flow::interface11::function_node::fOutput_type
internal::function_output< output_type > fOutput_type
Definition: flow_graph.h:1482
tbb::flow::interface11::function_node::input_impl_type
internal::function_input< input_type, output_type, Policy, internals_allocator > input_impl_type
Definition: flow_graph.h:1480
tbb::flow::interface11::graph_node::my_graph
graph & my_graph
Definition: _flow_graph_impl.h:464
tbb::flow::interface11::graph_node::graph_node
graph_node(graph &g)
Definition: flow_graph.h:888
internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >::my_body
function_body_type * my_body
Definition: _flow_graph_node_impl.h:517

References CODEPTR, tbb::internal::fgt_node_with_body(), internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >::my_body, and tbb::flow::interface11::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 = __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.

:
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 );
}

References CODEPTR, tbb::internal::fgt_node_with_body(), internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >::my_body, and tbb::flow::interface11::graph_node::my_graph.

Here is the call graph for this function:

## 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 | ) |

inline protected virtual

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

Definition at line 1559 of file flow_graph.h.

{
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");
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::flow::interface11::rf_clear_edges
@ rf_clear_edges
Definition: _flow_graph_impl.h:161
tbb::flow::interface11::function_node::successors
internal::broadcast_cache< output_type > & successors() __TBB_override
Definition: flow_graph.h:1557
internal::node_cache::clear
void clear()
Definition: _flow_graph_cache_impl.h:54
internal::node_cache::empty
bool empty()
Definition: _flow_graph_cache_impl.h:35
internal::successor_cache::clear
void clear()
Definition: _flow_graph_cache_impl.h:351
internal::function_input_base::my_predecessors
predecessor_cache< input_type, null_mutex > my_predecessors
Definition: _flow_graph_node_impl.h:185
internal::function_input::reset_function_input
void reset_function_input(reset_flags f)
Definition: _flow_graph_node_impl.h:508

References __TBB_ASSERT, internal::node_cache< T, M >::clear(), internal::successor_cache< T, M >::clear(), internal::node_cache< T, M >::empty(), internal::successor_cache< T, spin_rw_mutex >::empty(), internal::function_input_base< Input, Policy, A, ImplType >::my_predecessors, internal::function_input< Input, Output, Policy, A >::reset_function_input(), tbb::flow::interface11::rf_clear_edges, and tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::successors().

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 | ( |  | ) |

inline protected virtual

Implements internal::function_input< Input, continue_msg, queueing, cache_aligned_allocator< Input > >.

Definition at line 1557 of file flow_graph.h.

{ return fOutput_type::my_successors; }
internal::function_output::my_successors
broadcast_cache_type my_successors
Definition: _flow_graph_node_impl.h:920

References internal::function_output< Output >::my_successors.

Referenced by tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >::reset_node().

Here is the caller graph for this function:

## 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:

- flow_graph.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.