internal::function_input< Input, Output, Policy, A > Class Template Referenceabstract

Implements methods for a function node that takes a type Input as input and sends. More...

`#include <_flow_graph_node_impl.h>`

Inheritance diagram for internal::function_input< Input, Output, Policy, A >:
Collaboration diagram for internal::function_input< Input, Output, Policy, A >:

## Public Types

typedef Input | input_type
typedef Output | output_type
typedef function_body< input_type, output_type > | function_body_type
typedef function_input< Input, Output, Policy, A > | my_class
typedef function_input_base< Input, Policy, A, my_class > | base_type
typedef function_input_queue< input_type, A > | input_queue_type
Public Types inherited from internal::function_input_base< Input, Policy, A, function_input< Input, Output, Policy, A > >
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 A::template rebind< input_queue_type >::other | 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 Member Functions

template<typename Body >
| function_input (graph &g, size_t max_concurrency,)
| function_input (const function_input &src)
| Copy constructor. More...
| ~function_input ()
template<typename Body >
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, function_input< Input, Output, Policy, A > >
| __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
| 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...

## Protected Member Functions

void | reset_function_input (reset_flags f)
virtual broadcast_cache< output_type > & | successors ()=0
Protected Member Functions inherited from internal::function_input_base< Input, Policy, A, function_input< Input, Output, Policy, A > >
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)
Protected Member Functions inherited from tbb::flow::interface11::receiver< Input >
virtual task * | try_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 >
task * | try_put_task (const X &t)
virtual void | reset_receiver (reset_flags f=rf_reset_protocol)=0
| put receiver back in initial state More...
virtual bool | is_continue_receiver ()

## Protected Attributes

function_body_type * | my_body
function_body_type * | my_init_body
Protected Attributes inherited from internal::function_input_base< Input, Policy, A, function_input< Input, Output, Policy, A > >
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

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

## Detailed Description

### template<typename Input, typename Output, typename Policy, typename A>
class internal::function_input< Input, Output, Policy, A >

Implements methods for a function node that takes a type Input as input and sends.

Definition at line 421 of file _flow_graph_node_impl.h.

## Member Typedef Documentation

## base_type

template<typename Input, typename Output, typename Policy, typename A>

typedef function_input_base<Input, Policy, A, my_class> internal::function_input< Input, Output, Policy, A >::base_type

Definition at line 427 of file _flow_graph_node_impl.h.

## function_body_type

template<typename Input, typename Output, typename Policy, typename A>

typedef function_body<input_type, output_type> internal::function_input< Input, Output, Policy, A >::function_body_type

Definition at line 425 of file _flow_graph_node_impl.h.

## input_queue_type

template<typename Input, typename Output, typename Policy, typename A>

typedef function_input_queue<input_type, A> internal::function_input< Input, Output, Policy, A >::input_queue_type

Definition at line 428 of file _flow_graph_node_impl.h.

## input_type

template<typename Input, typename Output, typename Policy, typename A>

typedef Input internal::function_input< Input, Output, Policy, A >::input_type

Definition at line 423 of file _flow_graph_node_impl.h.

## my_class

template<typename Input, typename Output, typename Policy, typename A>

typedef function_input<Input, Output, Policy,A> internal::function_input< Input, Output, Policy, A >::my_class

Definition at line 426 of file _flow_graph_node_impl.h.

## output_type

template<typename Input, typename Output, typename Policy, typename A>

typedef Output internal::function_input< Input, Output, Policy, A >::output_type

Definition at line 424 of file _flow_graph_node_impl.h.

## Constructor & Destructor Documentation

## function_input() [1/2]

template<typename Input, typename Output, typename Policy, typename A>
template<typename Body >

internal::function_input< Input, Output, Policy, A >::function_input | ( | graph & | g,
|  | size_t | max_concurrency
| ) |  |

inline

Definition at line 432 of file _flow_graph_node_impl.h.

: base_type(g, __TBB_FLOW_GRAPH_PRIORITY_ARG1(max_concurrency, priority))
, my_body( new internal::function_body_leaf< input_type, output_type, Body>(body) )
, my_init_body( new internal::function_body_leaf< input_type, output_type, Body>(body) ) {
}

## function_input() [2/2]

template<typename Input, typename Output, typename Policy, typename A>

internal::function_input< Input, Output, Policy, A >::function_input | ( | const function_input< Input, Output, Policy, A > & | src | ) |

inline

Copy constructor.

Definition at line 441 of file _flow_graph_node_impl.h.

:
base_type(src),
my_body( src.my_init_body->clone() ),
my_init_body(src.my_init_body->clone() ) {
}

## ~function_input()

template<typename Input, typename Output, typename Policy, typename A>

internal::function_input< Input, Output, Policy, A >::~function_input | ( |  | ) |

inline

Definition at line 447 of file _flow_graph_node_impl.h.

{
delete my_body;
delete my_init_body;
}

## Member Function Documentation

## apply_body_impl()

template<typename Input, typename Output, typename Policy, typename A>

output_type internal::function_input< Input, Output, Policy, A >::apply_body_impl | ( | const input_type & | i | ) |

inline

Definition at line 458 of file _flow_graph_node_impl.h.

{
// There is an extra copied needed to capture the
// body execution without the try_put
tbb::internal::fgt_begin_body( my_body );
output_type v = (*my_body)(i);
tbb::internal::fgt_end_body( my_body );
return v;
}

Referenced by internal::function_input< Input, Output, Policy, Allocator >::apply_body_impl_bypass().

Here is the caller graph for this function:

## apply_body_impl_bypass()

template<typename Input, typename Output, typename Policy, typename A>

task* internal::function_input< Input, Output, Policy, A >::apply_body_impl_bypass | ( | const input_type & | i | ) |

inline

Definition at line 468 of file _flow_graph_node_impl.h.

{
output_type v = apply_body_impl(i);
#if TBB_DEPRECATED_MESSAGE_FLOW_ORDER
task* successor_task = successors().try_put_task(v);
#endif
task* postponed_task = NULL;
if( base_type::my_max_concurrency != 0 ) {
postponed_task = base_type::try_get_postponed_task(i);
__TBB_ASSERT( !postponed_task || postponed_task != SUCCESSFULLY_ENQUEUED, NULL );
}
#if TBB_DEPRECATED_MESSAGE_FLOW_ORDER
graph& g = base_type::my_graph_ref;
return combine_tasks(g, successor_task, postponed_task);
#else
if( postponed_task ) {
// make the task available for other workers since we do not know successors'
// execution policy
internal::spawn_in_graph_arena(base_type::graph_reference(), *postponed_task);
}
task* successor_task = successors().try_put_task(v);
#if _MSC_VER && !__INTEL_COMPILER
#pragma warning (push)
#pragma warning (disable: 4127) /* suppress conditional expression is constant */
#endif
if(internal::has_policy<lightweight, Policy>::value) {
#if _MSC_VER && !__INTEL_COMPILER
#pragma warning (pop)
#endif
if(!successor_task) {
// Return confirmative status since current
// node's body has been executed anyway
successor_task = SUCCESSFULLY_ENQUEUED;
}
}
return successor_task;
#endif /* TBB_DEPRECATED_MESSAGE_FLOW_ORDER */
}

## copy_function_object()

template<typename Input, typename Output, typename Policy, typename A>
template<typename Body >

Body internal::function_input< Input, Output, Policy, A >::copy_function_object | ( |  | ) |

inline

Definition at line 453 of file _flow_graph_node_impl.h.

{
function_body_type &body_ref = *this->my_body;
return dynamic_cast< internal::function_body_leaf<input_type, output_type, Body> & >(body_ref).get_body();
}

## reset_function_input()

template<typename Input, typename Output, typename Policy, typename A>

void internal::function_input< Input, Output, Policy, A >::reset_function_input | ( | reset_flags | f | ) |

inline protected

Definition at line 508 of file _flow_graph_node_impl.h.

{
base_type::reset_function_input_base(f);
if(f & rf_reset_bodies) {
function_body_type *tmp = my_init_body->clone();
delete my_body;
my_body = tmp;
}
}

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

Here is the caller graph for this function:

## successors()

template<typename Input, typename Output, typename Policy, typename A>

virtual broadcast_cache<output_type >& internal::function_input< Input, Output, Policy, A >::successors | ( |  | ) |

protected pure virtual

Implemented in tbb::flow::interface11::function_node< Input, Output, Policy, Allocator >.

Referenced by internal::function_input< Input, Output, Policy, Allocator >::apply_body_impl_bypass().

Here is the caller graph for this function:

## Member Data Documentation

## my_body

template<typename Input, typename Output, typename Policy, typename A>

function_body_type* internal::function_input< Input, Output, Policy, A >::my_body

protected

Definition at line 517 of file _flow_graph_node_impl.h.

Referenced by internal::function_input< Input, Output, Policy, Allocator >::apply_body_impl(), internal::function_input< Input, Output, Policy, Allocator >::copy_function_object(), internal::function_input< Input, Output, Policy, Allocator >::reset_function_input(), and internal::function_input< Input, Output, Policy, Allocator >::~function_input().

## my_init_body

template<typename Input, typename Output, typename Policy, typename A>

function_body_type* internal::function_input< Input, Output, Policy, A >::my_init_body

protected

Definition at line 518 of file _flow_graph_node_impl.h.

Referenced by internal::function_input< Input, Output, Policy, Allocator >::reset_function_input(), and internal::function_input< Input, Output, Policy, Allocator >::~function_input().

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

- _flow_graph_node_impl.h

internal::function_input::function_body_type
function_body< input_type, output_type > function_body_type
Definition: _flow_graph_node_impl.h:425
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_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
internal::function_input::successors
virtual broadcast_cache< output_type > & successors()=0
__TBB_FLOW_GRAPH_PRIORITY_ARG1
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
Definition: _flow_graph_impl.h:40
tbb::flow::interface11::combine_tasks
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:191
internal::has_policy
Definition: _flow_graph_body_impl.h:36
tbb::flow::internal::SUCCESSFULLY_ENQUEUED
static tbb::task *const SUCCESSFULLY_ENQUEUED
Definition: _flow_graph_impl.h:61
internal::function_input::output_type
Output output_type
Definition: _flow_graph_node_impl.h:424
internal::function_body::clone
virtual function_body * clone()=0
tbb::internal::fgt_begin_body
static void fgt_begin_body(void *)
Definition: _flow_graph_trace_impl.h:336
internal::function_input::base_type
function_input_base< Input, Policy, A, my_class > base_type
Definition: _flow_graph_node_impl.h:427
internal::function_input_base::reset_function_input_base
void reset_function_input_base(reset_flags f)
Definition: _flow_graph_node_impl.h:171
internal::function_input_base::graph_reference
graph & graph_reference() const __TBB_override
Definition: _flow_graph_node_impl.h:194
tbb::this_task_arena::max_concurrency
int max_concurrency()
Returns the maximal number of threads that can work inside the arena.
Definition: task_arena.h:490
internal::function_input_base::my_graph_ref
graph & my_graph_ref
Definition: _flow_graph_node_impl.h:180
internal::function_input_base::my_max_concurrency
const size_t my_max_concurrency
Definition: _flow_graph_node_impl.h:181
internal::function_input::my_init_body
function_body_type * my_init_body
Definition: _flow_graph_node_impl.h:518
internal::broadcast_cache::try_put_task
task * try_put_task(const T &t) __TBB_override
Definition: _flow_graph_cache_impl.h:478
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
internal::function_body_leaf
the leaf for function_body
Definition: _flow_graph_body_impl.h:128
tbb::internal::fgt_end_body
static void fgt_end_body(void *)
Definition: _flow_graph_trace_impl.h:337
internal::function_input_base::try_get_postponed_task
task * try_get_postponed_task(const input_type &i)
Definition: _flow_graph_node_impl.h:198
internal::function_input::apply_body_impl
output_type apply_body_impl(const input_type &i)
Definition: _flow_graph_node_impl.h:458
tbb::flow::interface11::rf_reset_bodies
Definition: _flow_graph_impl.h:160
internal::function_input::my_body
function_body_type * my_body
Definition: _flow_graph_node_impl.h:517

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.