Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
internal::function_input_base< Input, Policy, A, ImplType > Class Template Reference

Input and scheduling for a function node that takes a type Input as input. More...

#include <_flow_graph_node_impl.h>

Inheritance diagram for internal::function_input_base< Input, Policy, A, ImplType >:
Collaboration diagram for internal::function_input_base< Input, Policy, A, ImplType >:

Classes

class  operation_type
 

Public Types

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::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 Member Functions

 __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, size_t max_concurrency)
 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...
 

Protected Member Functions

void reset_function_input_base (reset_flags f)
 
void reset_receiver (reset_flags f) __TBB_override
 
graph & graph_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 void reset_receiver (reset_flags f=rf_reset_protocol)=0
 put receiver back in initial state More...
 
virtual bool is_continue_receiver ()
 

Protected Attributes

graph & my_graph_ref
 
const size_t my_max_concurrency
 
size_t my_concurrency
 
input_queue_typemy_queue
 
predecessor_cache< input_type, null_mutex > my_predecessors
 

Private Types

enum  op_type {
  reg_pred, rem_pred, try_fwd, tryput_bypass,
  app_body_bypass, occupy_concurrency
}
 
typedef function_input_base< Input, Policy, A, ImplType > class_type
 
typedef internal::aggregating_functor< class_type, operation_typehandler_type
 

Private Member Functions

taskperform_queued_requests ()
 
void handle_operations (operation_type *op_list)
 
void internal_try_put_task (operation_type *op)
 Put to the node, but return the task instead of enqueueing it. More...
 
void internal_forward (operation_type *op)
 Tries to spawn bodies if available and if concurrency allows. More...
 
taskinternal_try_put_bypass (const input_type &t)
 
tasktry_put_task_impl (const input_type &t, tbb::internal::true_type)
 
tasktry_put_task_impl (const input_type &t, tbb::internal::false_type)
 
taskapply_body_bypass (const input_type &i)
 Applies the body to the provided input. More...
 
taskcreate_body_task (const input_type &input)
 allocates a task to apply a body More...
 
taskforward_task ()
 This is executed by an enqueued task, the "forwarder". More...
 
taskcreate_forward_task ()
 
void spawn_forward_task ()
 Spawns a task that calls forward() More...
 

Private Attributes

bool forwarder_busy
 
aggregator< handler_type, operation_typemy_aggregator
 

Friends

class apply_body_task_bypass< class_type, input_type >
 
class forward_task_bypass< class_type >
 
class internal::aggregating_functor< class_type, operation_type >
 

Detailed Description

template<typename Input, typename Policy, typename A, typename ImplType>
class internal::function_input_base< Input, Policy, A, ImplType >

Input and scheduling for a function node that takes a type Input as input.

Definition at line 65 of file _flow_graph_node_impl.h.

Member Typedef Documentation

◆ class_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef function_input_base<Input, Policy, A, ImplType> internal::function_input_base< Input, Policy, A, ImplType >::class_type
private

Definition at line 72 of file _flow_graph_node_impl.h.

◆ handler_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef internal::aggregating_functor<class_type, operation_type> internal::function_input_base< Input, Policy, A, ImplType >::handler_type
private

Definition at line 228 of file _flow_graph_node_impl.h.

◆ input_queue_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef function_input_queue<input_type, A> internal::function_input_base< Input, Policy, A, ImplType >::input_queue_type

Definition at line 80 of file _flow_graph_node_impl.h.

◆ input_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef Input internal::function_input_base< Input, Policy, A, ImplType >::input_type

The input type of this receiver.

Definition at line 77 of file _flow_graph_node_impl.h.

◆ predecessor_cache_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef predecessor_cache<input_type, null_mutex > internal::function_input_base< Input, Policy, A, ImplType >::predecessor_cache_type

Definition at line 79 of file _flow_graph_node_impl.h.

◆ predecessor_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef receiver<input_type>::predecessor_type internal::function_input_base< Input, Policy, A, ImplType >::predecessor_type

Definition at line 78 of file _flow_graph_node_impl.h.

◆ queue_allocator_type

template<typename Input, typename Policy, typename A, typename ImplType>
typedef A::template rebind< input_queue_type >::other internal::function_input_base< Input, Policy, A, ImplType >::queue_allocator_type

Definition at line 81 of file _flow_graph_node_impl.h.

Member Enumeration Documentation

◆ op_type

template<typename Input, typename Policy, typename A, typename ImplType>
enum internal::function_input_base::op_type
private
Enumerator
reg_pred 
rem_pred 
try_fwd 
tryput_bypass 
app_body_bypass 
occupy_concurrency 

Definition at line 66 of file _flow_graph_node_impl.h.

Constructor & Destructor Documentation

◆ function_input_base() [1/2]

template<typename Input, typename Policy, typename A, typename ImplType>
internal::function_input_base< Input, Policy, A, ImplType >::function_input_base ( graph &  g,
size_t  max_concurrency 
)
inline

Constructor for function_input_base.

Definition at line 91 of file _flow_graph_node_impl.h.

94  forwarder_busy(false)
95  {
97  my_aggregator.initialize_handler(handler_type(this));
98  }
function_input_queue< input_type, A > input_queue_type
predecessor_cache< input_type, null_mutex > my_predecessors
int max_concurrency()
Returns the maximal number of threads that can work inside the arena.
Definition: task_arena.h:402
aggregator< handler_type, operation_type > my_aggregator
internal::aggregating_functor< class_type, operation_type > handler_type
void set_owner(successor_type *owner)

◆ function_input_base() [2/2]

template<typename Input, typename Policy, typename A, typename ImplType>
internal::function_input_base< Input, Policy, A, ImplType >::function_input_base ( const function_input_base< Input, Policy, A, ImplType > &  src)
inline

Copy constructor.

Definition at line 101 of file _flow_graph_node_impl.h.

101  :
102  receiver<Input>(), tbb::internal::no_assign(),
103  my_graph_ref(src.my_graph_ref), my_max_concurrency(src.my_max_concurrency),
104  my_concurrency(0), my_queue(src.my_queue ? new input_queue_type() : NULL),
105  forwarder_busy(false)
106  {
108  my_aggregator.initialize_handler(handler_type(this));
109  }
function_input_queue< input_type, A > input_queue_type
predecessor_cache< input_type, null_mutex > my_predecessors
Base class for types that should not be assigned.
Definition: tbb_stddef.h:324
aggregator< handler_type, operation_type > my_aggregator
internal::aggregating_functor< class_type, operation_type > handler_type
void set_owner(successor_type *owner)

◆ ~function_input_base()

template<typename Input, typename Policy, typename A, typename ImplType>
virtual internal::function_input_base< Input, Policy, A, ImplType >::~function_input_base ( )
inlinevirtual

Destructor.

Definition at line 115 of file _flow_graph_node_impl.h.

115  {
116  if ( my_queue ) delete my_queue;
117  }

Member Function Documentation

◆ __TBB_STATIC_ASSERT()

template<typename Input, typename Policy, typename A, typename ImplType>
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"   
)

◆ apply_body_bypass()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::apply_body_bypass ( const input_type i)
inlineprivate

Applies the body to the provided input.

Definition at line 374 of file _flow_graph_node_impl.h.

374  {
375  return static_cast<ImplType *>(this)->apply_body_impl_bypass(i);
376  }

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::try_put_task_impl().

Here is the caller graph for this function:

◆ create_body_task()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::create_body_task ( const input_type input)
inlineprivate

◆ create_forward_task()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::create_forward_task ( )
inlineprivate

Definition at line 403 of file _flow_graph_node_impl.h.

403  {
405  new(task::allocate_additional_child_of(*(my_graph_ref.root_task()))) forward_task_bypass< class_type >(*this) :
406  NULL;
407  }

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::spawn_forward_task().

Here is the caller graph for this function:

◆ forward_task()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::forward_task ( )
inlineprivate

This is executed by an enqueued task, the "forwarder".

Definition at line 388 of file _flow_graph_node_impl.h.

388  {
389  operation_type op_data(try_fwd);
390  task *rval = NULL;
391  do {
392  op_data.status = WAIT;
393  my_aggregator.execute(&op_data);
394  if(op_data.status == SUCCEEDED) {
395  // workaround for icc bug
396  tbb::task *ttask = op_data.bypass_t;
397  rval = combine_tasks(my_graph_ref, rval, ttask);
398  }
399  } while (op_data.status == SUCCEEDED);
400  return rval;
401  }
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:171
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
Base class for user-defined tasks.
Definition: task.h:576
aggregator< handler_type, operation_type > my_aggregator

◆ graph_reference()

template<typename Input, typename Policy, typename A, typename ImplType>
graph& internal::function_input_base< Input, Policy, A, ImplType >::graph_reference ( )
inlineprotectedvirtual

◆ handle_operations()

template<typename Input, typename Policy, typename A, typename ImplType>
void internal::function_input_base< Input, Policy, A, ImplType >::handle_operations ( operation_type op_list)
inlineprivate

Definition at line 251 of file _flow_graph_node_impl.h.

251  {
252  operation_type *tmp;
253  while (op_list) {
254  tmp = op_list;
255  op_list = op_list->next;
256  switch (tmp->type) {
257  case reg_pred:
258  my_predecessors.add(*(tmp->r));
259  __TBB_store_with_release(tmp->status, SUCCEEDED);
260  if (!forwarder_busy) {
261  forwarder_busy = true;
263  }
264  break;
265  case rem_pred:
266  my_predecessors.remove(*(tmp->r));
267  __TBB_store_with_release(tmp->status, SUCCEEDED);
268  break;
269  case app_body_bypass: {
270  tmp->bypass_t = NULL;
271  __TBB_ASSERT(my_max_concurrency != 0, NULL);
272  --my_concurrency;
274  tmp->bypass_t = perform_queued_requests();
275 
276  __TBB_store_with_release(tmp->status, SUCCEEDED);
277  }
278  break;
279  case tryput_bypass: internal_try_put_task(tmp); break;
280  case try_fwd: internal_forward(tmp); break;
281  case occupy_concurrency:
283  ++my_concurrency;
284  __TBB_store_with_release(tmp->status, SUCCEEDED);
285  } else {
286  __TBB_store_with_release(tmp->status, FAILED);
287  }
288  break;
289 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
290  case add_blt_pred: {
291  my_predecessors.internal_add_built_predecessor(*(tmp->r));
292  __TBB_store_with_release(tmp->status, SUCCEEDED);
293  }
294  break;
295  case del_blt_pred:
296  my_predecessors.internal_delete_built_predecessor(*(tmp->r));
297  __TBB_store_with_release(tmp->status, SUCCEEDED);
298  break;
299  case blt_pred_cnt:
300  tmp->cnt_val = my_predecessors.predecessor_count();
301  __TBB_store_with_release(tmp->status, SUCCEEDED);
302  break;
303  case blt_pred_cpy:
304  my_predecessors.copy_predecessors( *(tmp->predv) );
305  __TBB_store_with_release(tmp->status, SUCCEEDED);
306  break;
307 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
308  }
309  }
310  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:717
predecessor_cache< input_type, null_mutex > my_predecessors
void internal_try_put_task(operation_type *op)
Put to the node, but return the task instead of enqueueing it.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
void spawn_forward_task()
Spawns a task that calls forward()
void internal_forward(operation_type *op)
Tries to spawn bodies if available and if concurrency allows.

◆ internal_forward()

template<typename Input, typename Policy, typename A, typename ImplType>
void internal::function_input_base< Input, Policy, A, ImplType >::internal_forward ( operation_type op)
inlineprivate

Tries to spawn bodies if available and if concurrency allows.

Definition at line 330 of file _flow_graph_node_impl.h.

330  {
331  op->bypass_t = NULL;
333  op->bypass_t = perform_queued_requests();
334  if(op->bypass_t)
335  __TBB_store_with_release(op->status, SUCCEEDED);
336  else {
337  forwarder_busy = false;
338  __TBB_store_with_release(op->status, FAILED);
339  }
340  }
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:717

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::handle_operations().

Here is the caller graph for this function:

◆ internal_try_put_bypass()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::internal_try_put_bypass ( const input_type t)
inlineprivate

Definition at line 342 of file _flow_graph_node_impl.h.

342  {
343  operation_type op_data(t, tryput_bypass);
344  my_aggregator.execute(&op_data);
345  if( op_data.status == internal::SUCCEEDED ) {
346  return op_data.bypass_t;
347  }
348  return NULL;
349  }
aggregator< handler_type, operation_type > my_aggregator

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::try_put_task_impl().

Here is the caller graph for this function:

◆ internal_try_put_task()

template<typename Input, typename Policy, typename A, typename ImplType>
void internal::function_input_base< Input, Policy, A, ImplType >::internal_try_put_task ( operation_type op)
inlineprivate

Put to the node, but return the task instead of enqueueing it.

Definition at line 313 of file _flow_graph_node_impl.h.

313  {
314  __TBB_ASSERT(my_max_concurrency != 0, NULL);
316  ++my_concurrency;
317  task * new_task = create_body_task(*(op->elem));
318  op->bypass_t = new_task;
319  __TBB_store_with_release(op->status, SUCCEEDED);
320  } else if ( my_queue && my_queue->push(*(op->elem)) ) {
321  op->bypass_t = SUCCESSFULLY_ENQUEUED;
322  __TBB_store_with_release(op->status, SUCCEEDED);
323  } else {
324  op->bypass_t = NULL;
325  __TBB_store_with_release(op->status, FAILED);
326  }
327  }
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
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:717
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
static tbb::task *const SUCCESSFULLY_ENQUEUED
task * create_body_task(const input_type &input)
allocates a task to apply a body

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::handle_operations().

Here is the caller graph for this function:

◆ perform_queued_requests()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::perform_queued_requests ( )
inlineprivate

Definition at line 232 of file _flow_graph_node_impl.h.

232  {
233  task* new_task = NULL;
234  if(my_queue) {
235  if(!my_queue->empty()) {
236  ++my_concurrency;
237  new_task = create_body_task(my_queue->front());
238 
239  my_queue->pop();
240  }
241  }
242  else {
243  input_type i;
244  if(my_predecessors.get_item(i)) {
245  ++my_concurrency;
246  new_task = create_body_task(i);
247  }
248  }
249  return new_task;
250  }
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
predecessor_cache< input_type, null_mutex > my_predecessors
Input input_type
The input type of this receiver.
task * create_body_task(const input_type &input)
allocates a task to apply a body

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::handle_operations(), and internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::internal_forward().

Here is the caller graph for this function:

◆ register_predecessor()

template<typename Input, typename Policy, typename A, typename ImplType>
bool internal::function_input_base< Input, Policy, A, ImplType >::register_predecessor ( predecessor_type src)
inlinevirtual

Adds src to the list of cached predecessors.

Reimplemented from tbb::flow::interface10::internal::untyped_receiver.

Definition at line 124 of file _flow_graph_node_impl.h.

124  {
125  operation_type op_data(reg_pred);
126  op_data.r = &src;
127  my_aggregator.execute(&op_data);
128  return true;
129  }
aggregator< handler_type, operation_type > my_aggregator

◆ remove_predecessor()

template<typename Input, typename Policy, typename A, typename ImplType>
bool internal::function_input_base< Input, Policy, A, ImplType >::remove_predecessor ( predecessor_type src)
inlinevirtual

Removes src from the list of cached predecessors.

Reimplemented from tbb::flow::interface10::internal::untyped_receiver.

Definition at line 132 of file _flow_graph_node_impl.h.

132  {
133  operation_type op_data(rem_pred);
134  op_data.r = &src;
135  my_aggregator.execute(&op_data);
136  return true;
137  }
aggregator< handler_type, operation_type > my_aggregator

◆ reset_function_input_base()

template<typename Input, typename Policy, typename A, typename ImplType>
void internal::function_input_base< Input, Policy, A, ImplType >::reset_function_input_base ( reset_flags  f)
inlineprotected

◆ reset_receiver()

template<typename Input, typename Policy, typename A, typename ImplType>
void internal::function_input_base< Input, Policy, A, ImplType >::reset_receiver ( reset_flags  f)
inlineprotected

Definition at line 188 of file _flow_graph_node_impl.h.

188  {
190  else
192  __TBB_ASSERT(!(f & rf_clear_edges) || my_predecessors.empty(), "function_input_base reset failed");
193  }
predecessor_cache< input_type, null_mutex > my_predecessors
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::reset_function_input_base().

Here is the caller graph for this function:

◆ spawn_forward_task()

template<typename Input, typename Policy, typename A, typename ImplType>
void internal::function_input_base< Input, Policy, A, ImplType >::spawn_forward_task ( )
inlineprivate

Spawns a task that calls forward()

Definition at line 410 of file _flow_graph_node_impl.h.

410  {
411  task* tp = create_forward_task();
412  if(tp) {
414  }
415  }
graph & graph_reference() __TBB_override
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
void spawn_in_graph_arena(graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::handle_operations().

Here is the caller graph for this function:

◆ try_get_postponed_task()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::try_get_postponed_task ( const input_type i)
inlineprotected

Definition at line 199 of file _flow_graph_node_impl.h.

199  {
200  operation_type op_data(i, app_body_bypass); // tries to pop an item or get_item
201  my_aggregator.execute(&op_data);
202  return op_data.bypass_t;
203  }
aggregator< handler_type, operation_type > my_aggregator

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

Here is the caller graph for this function:

◆ try_put_task()

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::try_put_task ( const input_type t)
inlinevirtual

Put item to successor; return task to run the successor if possible.

Implements tbb::flow::interface10::receiver< Input >.

Definition at line 119 of file _flow_graph_node_impl.h.

119  {
121  }
task * try_put_task_impl(const input_type &t, tbb::internal::true_type)

◆ try_put_task_impl() [1/2]

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::try_put_task_impl ( const input_type t,
tbb::internal::true_type   
)
inlineprivate

Definition at line 351 of file _flow_graph_node_impl.h.

351  {
352  if( my_max_concurrency == 0 ) {
353  return apply_body_bypass(t);
354  } else {
355  operation_type check_op(t, occupy_concurrency);
356  my_aggregator.execute(&check_op);
357  if( check_op.status == internal::SUCCEEDED ) {
358  return apply_body_bypass(t);
359  }
360  return internal_try_put_bypass(t);
361  }
362  }
task * apply_body_bypass(const input_type &i)
Applies the body to the provided input.
aggregator< handler_type, operation_type > my_aggregator
task * internal_try_put_bypass(const input_type &t)

Referenced by internal::function_input_base< Input, Policy, A, multifunction_input< Input, OutputPortSet, Policy, A > >::try_put_task().

Here is the caller graph for this function:

◆ try_put_task_impl() [2/2]

template<typename Input, typename Policy, typename A, typename ImplType>
task* internal::function_input_base< Input, Policy, A, ImplType >::try_put_task_impl ( const input_type t,
tbb::internal::false_type   
)
inlineprivate

Definition at line 364 of file _flow_graph_node_impl.h.

364  {
365  if( my_max_concurrency == 0 ) {
366  return create_body_task(t);
367  } else {
368  return internal_try_put_bypass(t);
369  }
370  }
task * internal_try_put_bypass(const input_type &t)
task * create_body_task(const input_type &input)
allocates a task to apply a body

Friends And Related Function Documentation

◆ apply_body_task_bypass< class_type, input_type >

template<typename Input, typename Policy, typename A, typename ImplType>
friend class apply_body_task_bypass< class_type, input_type >
friend

Definition at line 207 of file _flow_graph_node_impl.h.

◆ forward_task_bypass< class_type >

template<typename Input, typename Policy, typename A, typename ImplType>
friend class forward_task_bypass< class_type >
friend

Definition at line 208 of file _flow_graph_node_impl.h.

◆ internal::aggregating_functor< class_type, operation_type >

template<typename Input, typename Policy, typename A, typename ImplType>
friend class internal::aggregating_functor< class_type, operation_type >
friend

Definition at line 229 of file _flow_graph_node_impl.h.

Member Data Documentation

◆ forwarder_busy

◆ my_aggregator

◆ my_concurrency

◆ my_graph_ref

◆ my_max_concurrency

◆ my_predecessors

◆ my_queue


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

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