internal::multifunction_input< Input, OutputPortSet, Policy, A > Class Template Reference

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

`#include <_flow_graph_node_impl.h>`

Inheritance diagram for internal::multifunction_input< Input, OutputPortSet, Policy, A >:
Collaboration diagram for internal::multifunction_input< Input, OutputPortSet, Policy, A >:

## Public Types

typedef Input | input_type
typedef OutputPortSet | output_ports_type
typedef multifunction_body< input_type, output_ports_type > | multifunction_body_type
typedef multifunction_input< Input, OutputPortSet, 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, multifunction_input< Input, OutputPortSet, 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 tbb::internal::allocator_rebind< A, input_queue_type >::type | queue_allocator_type

## Public Member Functions

template<typename Body >
| multifunction_input (graph &g, size_t max_concurrency,)
| multifunction_input (const multifunction_input &src)
| Copy constructor. More...
| ~multifunction_input ()
template<typename Body >
Body | copy_function_object ()
task * | apply_body_impl_bypass (const input_type &i)
output_ports_type & | output_ports ()
Public Member Functions inherited from internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, 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
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...

## Static Public Attributes

static const int | N = tbb::flow::tuple_size<OutputPortSet>::value

## Protected Member Functions

void | reset (reset_flags f)
Protected Member Functions inherited from internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, 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 Attributes

multifunction_body_type * | my_body
multifunction_body_type * | my_init_body
output_ports_type | my_output_ports
Protected Attributes inherited from internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, 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

## Detailed Description

### template<typename Input, typename OutputPortSet, typename Policy, typename A>
class internal::multifunction_input< Input, OutputPortSet, Policy, A >

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

Definition at line 638 of file _flow_graph_node_impl.h.

## Member Typedef Documentation

## base_type

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

typedef function_input_base<Input, Policy, A, my_class> internal::multifunction_input< Input, OutputPortSet, Policy, A >::base_type

Definition at line 645 of file _flow_graph_node_impl.h.

## input_queue_type

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

typedef function_input_queue<input_type, A> internal::multifunction_input< Input, OutputPortSet, Policy, A >::input_queue_type

Definition at line 646 of file _flow_graph_node_impl.h.

## input_type

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

typedef Input internal::multifunction_input< Input, OutputPortSet, Policy, A >::input_type

Definition at line 641 of file _flow_graph_node_impl.h.

## multifunction_body_type

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

typedef multifunction_body<input_type, output_ports_type> internal::multifunction_input< Input, OutputPortSet, Policy, A >::multifunction_body_type

Definition at line 643 of file _flow_graph_node_impl.h.

## my_class

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

typedef multifunction_input<Input, OutputPortSet, Policy, A> internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_class

Definition at line 644 of file _flow_graph_node_impl.h.

## output_ports_type

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

typedef OutputPortSet internal::multifunction_input< Input, OutputPortSet, Policy, A >::output_ports_type

Definition at line 642 of file _flow_graph_node_impl.h.

## Constructor & Destructor Documentation

## multifunction_input() [1/2]

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

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

inline

Definition at line 650 of file _flow_graph_node_impl.h.

: base_type(g, __TBB_FLOW_GRAPH_PRIORITY_ARG1(max_concurrency, priority))
, my_body( new internal::multifunction_body_leaf<input_type, output_ports_type, Body>(body) )
, my_init_body( new internal::multifunction_body_leaf<input_type, output_ports_type, Body>(body) )
, my_output_ports(init_output_ports<output_ports_type>::call(g, my_output_ports)){
}
__TBB_FLOW_GRAPH_PRIORITY_ARG1
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
Definition: _flow_graph_impl.h:40
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::multifunction_body_leaf
leaf for multifunction. OutputSet can be a std::tuple or a vector.
Definition: _flow_graph_body_impl.h:260
internal::init_output_ports::call
static OutputTuple call(graph &g, const tbb::flow::tuple< Args... > &)
Definition: _flow_graph_node_impl.h:566
internal::multifunction_input::base_type
function_input_base< Input, Policy, A, my_class > base_type
Definition: _flow_graph_node_impl.h:645
internal::multifunction_input::my_init_body
multifunction_body_type * my_init_body
Definition: _flow_graph_node_impl.h:712
internal::multifunction_input::my_body
multifunction_body_type * my_body
Definition: _flow_graph_node_impl.h:711
internal::multifunction_input::my_output_ports
output_ports_type my_output_ports
Definition: _flow_graph_node_impl.h:713

## multifunction_input() [2/2]

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

internal::multifunction_input< Input, OutputPortSet, Policy, A >::multifunction_input | ( | const multifunction_input< Input, OutputPortSet, Policy, A > & | src | ) |

inline

Copy constructor.

Definition at line 659 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() ),
my_output_ports( init_output_ports<output_ports_type>::call(src.my_graph_ref, my_output_ports) ) {
}

## ~multifunction_input()

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

internal::multifunction_input< Input, OutputPortSet, Policy, A >::~multifunction_input | ( |  | ) |

inline

Definition at line 666 of file _flow_graph_node_impl.h.

{
delete my_body;
delete my_init_body;
}

References internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_body, and internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_init_body.

## Member Function Documentation

## apply_body_impl_bypass()

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

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

inline

Definition at line 680 of file _flow_graph_node_impl.h.

{
tbb::internal::fgt_begin_body( my_body );
(*my_body)(i, my_output_ports);
tbb::internal::fgt_end_body( my_body );
task* ttask = NULL;
if(base_type::my_max_concurrency != 0) {
ttask = base_type::try_get_postponed_task(i);
}
return ttask ? ttask : SUCCESSFULLY_ENQUEUED;
}
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::internal::fgt_begin_body
static void fgt_begin_body(void *)
Definition: _flow_graph_trace_impl.h:336
tbb::internal::fgt_end_body
static void fgt_end_body(void *)
Definition: _flow_graph_trace_impl.h:337
tbb::flow::internal::SUCCESSFULLY_ENQUEUED
static tbb::task *const SUCCESSFULLY_ENQUEUED
Definition: _flow_graph_impl.h:61
internal::function_input_base::my_max_concurrency
const size_t my_max_concurrency
Definition: _flow_graph_node_impl.h:181
internal::function_input_base::try_get_postponed_task
task * try_get_postponed_task(const input_type &i)
Definition: _flow_graph_node_impl.h:198

References tbb::internal::fgt_begin_body(), tbb::internal::fgt_end_body(), internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_body, internal::function_input_base< Input, Policy, A, ImplType >::my_max_concurrency, internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_output_ports, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, task, and internal::function_input_base< Input, Policy, A, ImplType >::try_get_postponed_task().

Here is the call graph for this function:

## copy_function_object()

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

Body internal::multifunction_input< Input, OutputPortSet, Policy, A >::copy_function_object | ( |  | ) |

inline

Definition at line 672 of file _flow_graph_node_impl.h.

{
multifunction_body_type &body_ref = *this->my_body;
return *static_cast<Body*>(dynamic_cast< internal::multifunction_body_leaf<input_type, output_ports_type, Body> & >(body_ref).get_body_ptr());
}
internal::multifunction_input::multifunction_body_type
multifunction_body< input_type, output_ports_type > multifunction_body_type
Definition: _flow_graph_node_impl.h:643

References internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_body.

## output_ports()

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

output_ports_type& internal::multifunction_input< Input, OutputPortSet, Policy, A >::output_ports | ( |  | ) |

inline

Definition at line 691 of file _flow_graph_node_impl.h.

{ return my_output_ports; }

References internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_output_ports.

## reset()

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

void internal::multifunction_input< Input, OutputPortSet, Policy, A >::reset | ( | reset_flags | f | ) |

inline protected

Definition at line 700 of file _flow_graph_node_impl.h.

{
base_type::reset_function_input_base(f);
if(f & rf_clear_edges)clear_element<N>::clear_this(my_output_ports);
if(f & rf_reset_bodies) {
multifunction_body_type *tmp = my_init_body->clone();
delete my_body;
my_body = tmp;
}
__TBB_ASSERT(!(f & rf_clear_edges) || clear_element<N>::this_empty(my_output_ports), "multifunction_node reset failed");
}
__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::rf_reset_bodies
@ rf_reset_bodies
Definition: _flow_graph_impl.h:160
internal::multifunction_body::clone
virtual multifunction_body * clone()=0
internal::function_input_base::reset_function_input_base
void reset_function_input_base(reset_flags f)
Definition: _flow_graph_node_impl.h:171
internal::clear_element::clear_this
static void clear_this(P &p)
Definition: _flow_graph_node_impl.h:526
internal::clear_element::this_empty
static bool this_empty(P &p)
Definition: _flow_graph_node_impl.h:530

References __TBB_ASSERT, internal::clear_element< N >::clear_this(), internal::multifunction_body< Input, OutputSet >::clone(), internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_body, internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_init_body, internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_output_ports, internal::function_input_base< Input, Policy, A, ImplType >::reset_function_input_base(), tbb::flow::interface11::rf_clear_edges, and tbb::flow::interface11::rf_reset_bodies.

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

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## my_body

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

multifunction_body_type* internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_body

protected

Definition at line 711 of file _flow_graph_node_impl.h.

Referenced by internal::multifunction_input< Input, OutputPortSet, Policy, A >::apply_body_impl_bypass(), internal::multifunction_input< Input, OutputPortSet, Policy, A >::copy_function_object(), internal::multifunction_input< Input, OutputPortSet, Policy, A >::reset(), and internal::multifunction_input< Input, OutputPortSet, Policy, A >::~multifunction_input().

## my_init_body

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

multifunction_body_type* internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_init_body

protected

Definition at line 712 of file _flow_graph_node_impl.h.

Referenced by internal::multifunction_input< Input, OutputPortSet, Policy, A >::reset(), and internal::multifunction_input< Input, OutputPortSet, Policy, A >::~multifunction_input().

## my_output_ports

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

output_ports_type internal::multifunction_input< Input, OutputPortSet, Policy, A >::my_output_ports

protected

Definition at line 713 of file _flow_graph_node_impl.h.

Referenced by internal::multifunction_input< Input, OutputPortSet, Policy, A >::apply_body_impl_bypass(), internal::multifunction_input< Input, OutputPortSet, Policy, A >::output_ports(), and internal::multifunction_input< Input, OutputPortSet, Policy, A >::reset().

## N

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

const int internal::multifunction_input< Input, OutputPortSet, Policy, A >::N = tbb::flow::tuple_size<OutputPortSet>::value

static

Definition at line 640 of file _flow_graph_node_impl.h.

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

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