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 tbb::internal::allocator_rebind< A, input_queue_type >::type queue_allocator_type
 

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, __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
 
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...
 

Protected Member Functions

void reset_function_input_base (reset_flags f)
 
void reset_receiver (reset_flags f) __TBB_override
 
graph & graph_reference () const __TBB_override
 
tasktry_get_postponed_task (const input_type &i)
 

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)
 Creates tasks for postponed messages 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 Member Functions inherited from tbb::internal::no_assign
void operator= (const no_assign &)=delete
 
 no_assign (const no_assign &)=default
 
 no_assign ()=default
 

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 61 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 68 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 227 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 76 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 73 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 75 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 74 of file _flow_graph_node_impl.h.

◆ queue_allocator_type

template<typename Input , typename Policy , typename A , typename ImplType >
typedef tbb::internal::allocator_rebind<A, input_queue_type>::type internal::function_input_base< Input, Policy, A, ImplType >::queue_allocator_type

Definition at line 77 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 62 of file _flow_graph_node_impl.h.

63 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
64  , add_blt_pred, del_blt_pred,
65  blt_pred_cnt, blt_pred_cpy // create vector copies of preds and succs
66 #endif
67  };

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,
__TBB_FLOW_GRAPH_PRIORITY_ARG1(size_t max_concurrency, node_priority_t priority)   
)
inline

Constructor for function_input_base.

Definition at line 87 of file _flow_graph_node_impl.h.

90  , __TBB_FLOW_GRAPH_PRIORITY_ARG1(my_concurrency(0), my_priority(priority))
92  , forwarder_busy(false)
93  {
95  my_aggregator.initialize_handler(handler_type(this));
96  }
#define __TBB_FLOW_GRAPH_PRIORITY_ARG1(arg1, priority)
int max_concurrency()
Returns the maximal number of threads that can work inside the arena.
Definition: task_arena.h:490
void set_owner(successor_type *owner)
aggregator< handler_type, operation_type > my_aggregator
internal::aggregating_functor< class_type, operation_type > handler_type
function_input_queue< input_type, A > input_queue_type
predecessor_cache< input_type, null_mutex > my_predecessors

References internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, internal::function_input_base< Input, Policy, A, ImplType >::my_predecessors, and internal::predecessor_cache< T, M >::set_owner().

Here is the call graph for this function:

◆ 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 99 of file _flow_graph_node_impl.h.

100  : receiver<Input>(), tbb::internal::no_assign()
101  , my_graph_ref(src.my_graph_ref), my_max_concurrency(src.my_max_concurrency)
102  , __TBB_FLOW_GRAPH_PRIORITY_ARG1(my_concurrency(0), my_priority(src.my_priority))
103  , my_queue(src.my_queue ? new input_queue_type() : NULL), forwarder_busy(false)
104  {
106  my_aggregator.initialize_handler(handler_type(this));
107  }
Base class for types that should not be assigned.
Definition: tbb_stddef.h:322

References internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, internal::function_input_base< Input, Policy, A, ImplType >::my_predecessors, and internal::predecessor_cache< T, M >::set_owner().

Here is the call graph for this function:

◆ ~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 113 of file _flow_graph_node_impl.h.

113  {
114  if ( my_queue ) delete my_queue;
115  }

References internal::function_input_base< Input, Policy, A, ImplType >::my_queue.

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 373 of file _flow_graph_node_impl.h.

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

Referenced by internal::function_input_base< Input, Policy, A, ImplType >::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

allocates a task to apply a body

Definition at line 378 of file _flow_graph_node_impl.h.

378  {
380  new( task::allocate_additional_child_of(*(my_graph_ref.root_task())) )
382  *this, __TBB_FLOW_GRAPH_PRIORITY_ARG1(input, my_priority))
383  : NULL;
384  }
bool is_graph_active(tbb::flow::interface10::graph &g)
friend class apply_body_task_bypass< class_type, input_type >

References __TBB_FLOW_GRAPH_PRIORITY_ARG1, tbb::flow::interface11::internal::is_graph_active(), and internal::function_input_base< Input, Policy, A, ImplType >::my_graph_ref.

Referenced by internal::function_input_base< Input, Policy, A, ImplType >::internal_try_put_task(), internal::function_input_base< Input, Policy, A, ImplType >::perform_queued_requests(), and internal::function_input_base< Input, Policy, A, ImplType >::try_put_task_impl().

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

◆ 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 402 of file _flow_graph_node_impl.h.

402  {
404  new( task::allocate_additional_child_of(*(my_graph_ref.root_task())) )
406  : NULL;
407  }

References __TBB_FLOW_GRAPH_PRIORITY_ARG1, tbb::flow::interface11::internal::is_graph_active(), and internal::function_input_base< Input, Policy, A, ImplType >::my_graph_ref.

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

Here is the call graph for this function:
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 387 of file _flow_graph_node_impl.h.

387  {
388  operation_type op_data(try_fwd);
389  task* rval = NULL;
390  do {
391  op_data.status = WAIT;
392  my_aggregator.execute(&op_data);
393  if(op_data.status == SUCCEEDED) {
394  task* ttask = op_data.bypass_t;
395  __TBB_ASSERT( ttask && ttask != SUCCESSFULLY_ENQUEUED, NULL );
396  rval = combine_tasks(my_graph_ref, rval, ttask);
397  }
398  } while (op_data.status == SUCCEEDED);
399  return rval;
400  }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
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
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:199
static tbb::task *const SUCCESSFULLY_ENQUEUED

References __TBB_ASSERT, internal::function_input_base< Input, Policy, A, ImplType >::operation_type::bypass_t, tbb::flow::interface11::combine_tasks(), internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, internal::function_input_base< Input, Policy, A, ImplType >::my_graph_ref, tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, task, internal::function_input_base< Input, Policy, A, ImplType >::try_fwd, and internal::WAIT.

Here is the call graph for this function:

◆ graph_reference()

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

Definition at line 194 of file _flow_graph_node_impl.h.

194  {
195  return my_graph_ref;
196  }

References internal::function_input_base< Input, Policy, A, ImplType >::my_graph_ref.

Referenced by internal::function_input< Input, Output, Policy, A >::apply_body_impl_bypass(), and internal::function_input_base< Input, Policy, A, ImplType >::spawn_forward_task().

Here is the caller graph for this function:

◆ 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 250 of file _flow_graph_node_impl.h.

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

References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), internal::node_cache< T, M >::add(), internal::function_input_base< Input, Policy, A, ImplType >::app_body_bypass, internal::function_input_base< Input, Policy, A, ImplType >::operation_type::bypass_t, internal::FAILED, internal::function_input_base< Input, Policy, A, ImplType >::forwarder_busy, internal::function_input_base< Input, Policy, A, ImplType >::internal_forward(), internal::function_input_base< Input, Policy, A, ImplType >::internal_try_put_task(), internal::function_input_base< Input, Policy, A, ImplType >::my_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_max_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_predecessors, tbb::interface6::internal::aggregated_operation< Derived >::next, internal::function_input_base< Input, Policy, A, ImplType >::occupy_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::perform_queued_requests(), internal::function_input_base< Input, Policy, A, ImplType >::operation_type::r, internal::function_input_base< Input, Policy, A, ImplType >::reg_pred, internal::function_input_base< Input, Policy, A, ImplType >::rem_pred, internal::node_cache< T, M >::remove(), internal::function_input_base< Input, Policy, A, ImplType >::spawn_forward_task(), tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, internal::function_input_base< Input, Policy, A, ImplType >::try_fwd, internal::function_input_base< Input, Policy, A, ImplType >::tryput_bypass, and internal::function_input_base< Input, Policy, A, ImplType >::operation_type::type.

Here is the call graph for this function:

◆ 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

Creates tasks for postponed messages if available and if concurrency allows.

Definition at line 329 of file _flow_graph_node_impl.h.

329  {
330  op->bypass_t = NULL;
332  op->bypass_t = perform_queued_requests();
333  if(op->bypass_t)
334  __TBB_store_with_release(op->status, SUCCEEDED);
335  else {
336  forwarder_busy = false;
337  __TBB_store_with_release(op->status, FAILED);
338  }
339  }

References tbb::internal::__TBB_store_with_release(), internal::function_input_base< Input, Policy, A, ImplType >::operation_type::bypass_t, internal::FAILED, internal::function_input_base< Input, Policy, A, ImplType >::forwarder_busy, internal::function_input_base< Input, Policy, A, ImplType >::my_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_max_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::perform_queued_requests(), tbb::interface6::internal::aggregated_operation< Derived >::status, and internal::SUCCEEDED.

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

Here is the call graph for this function:
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 341 of file _flow_graph_node_impl.h.

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

References internal::function_input_base< Input, Policy, A, ImplType >::operation_type::bypass_t, internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, and internal::function_input_base< Input, Policy, A, ImplType >::tryput_bypass.

Referenced by internal::function_input_base< Input, Policy, A, ImplType >::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 312 of file _flow_graph_node_impl.h.

312  {
313  __TBB_ASSERT(my_max_concurrency != 0, NULL);
315  ++my_concurrency;
316  task * new_task = create_body_task(*(op->elem));
317  op->bypass_t = new_task;
318  __TBB_store_with_release(op->status, SUCCEEDED);
319  } else if ( my_queue && my_queue->push(*(op->elem)) ) {
320  op->bypass_t = SUCCESSFULLY_ENQUEUED;
321  __TBB_store_with_release(op->status, SUCCEEDED);
322  } else {
323  op->bypass_t = NULL;
324  __TBB_store_with_release(op->status, FAILED);
325  }
326  }
task * create_body_task(const input_type &input)
allocates a task to apply a body

References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), internal::function_input_base< Input, Policy, A, ImplType >::operation_type::bypass_t, internal::function_input_base< Input, Policy, A, ImplType >::create_body_task(), internal::function_input_base< Input, Policy, A, ImplType >::operation_type::elem, internal::FAILED, internal::function_input_base< Input, Policy, A, ImplType >::my_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_max_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_queue, internal::function_input_queue< T, A >::push(), tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, and task.

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

Here is the call graph for this function:
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 231 of file _flow_graph_node_impl.h.

231  {
232  task* new_task = NULL;
233  if(my_queue) {
234  if(!my_queue->empty()) {
235  ++my_concurrency;
236  new_task = create_body_task(my_queue->front());
237 
238  my_queue->pop();
239  }
240  }
241  else {
242  input_type i;
243  if(my_predecessors.get_item(i)) {
244  ++my_concurrency;
245  new_task = create_body_task(i);
246  }
247  }
248  return new_task;
249  }
Input input_type
The input type of this receiver.

References internal::function_input_base< Input, Policy, A, ImplType >::create_body_task(), internal::function_input_queue< T, A >::empty(), internal::function_input_queue< T, A >::front(), internal::predecessor_cache< T, M >::get_item(), internal::function_input_base< Input, Policy, A, ImplType >::my_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_predecessors, internal::function_input_base< Input, Policy, A, ImplType >::my_queue, internal::function_input_queue< T, A >::pop(), and task.

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

Here is the call graph for this function:
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)
inline

Adds src to the list of cached predecessors.

Definition at line 122 of file _flow_graph_node_impl.h.

122  {
123  operation_type op_data(reg_pred);
124  op_data.r = &src;
125  my_aggregator.execute(&op_data);
126  return true;
127  }

References internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, internal::function_input_base< Input, Policy, A, ImplType >::operation_type::r, and internal::function_input_base< Input, Policy, A, ImplType >::reg_pred.

◆ 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)
inline

Removes src from the list of cached predecessors.

Definition at line 130 of file _flow_graph_node_impl.h.

130  {
131  operation_type op_data(rem_pred);
132  op_data.r = &src;
133  my_aggregator.execute(&op_data);
134  return true;
135  }

References internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, internal::function_input_base< Input, Policy, A, ImplType >::operation_type::r, and internal::function_input_base< Input, Policy, A, ImplType >::rem_pred.

◆ 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

Definition at line 171 of file _flow_graph_node_impl.h.

171  {
172  my_concurrency = 0;
173  if(my_queue) {
174  my_queue->reset();
175  }
176  reset_receiver(f);
177  forwarder_busy = false;
178  }
void reset_receiver(reset_flags f) __TBB_override

References internal::function_input_base< Input, Policy, A, ImplType >::forwarder_busy, internal::function_input_base< Input, Policy, A, ImplType >::my_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::my_queue, internal::item_buffer< T, A >::reset(), and internal::function_input_base< Input, Policy, A, ImplType >::reset_receiver().

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

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

◆ 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 187 of file _flow_graph_node_impl.h.

187  {
189  else
191  __TBB_ASSERT(!(f & rf_clear_edges) || my_predecessors.empty(), "function_input_base reset failed");
192  }

References __TBB_ASSERT, internal::node_cache< T, M >::clear(), internal::node_cache< T, M >::empty(), internal::function_input_base< Input, Policy, A, ImplType >::my_predecessors, internal::predecessor_cache< T, M >::reset(), and tbb::flow::interface11::rf_clear_edges.

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

Here is the call graph for this function:
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  }
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
graph & graph_reference() const __TBB_override

References internal::function_input_base< Input, Policy, A, ImplType >::create_forward_task(), internal::function_input_base< Input, Policy, A, ImplType >::graph_reference(), tbb::flow::interface11::internal::spawn_in_graph_arena(), and task.

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

Here is the call graph for this function:
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 198 of file _flow_graph_node_impl.h.

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

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

Definition at line 117 of file _flow_graph_node_impl.h.

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

References internal::function_input_base< Input, Policy, A, ImplType >::try_put_task_impl().

Here is the call graph for this function:

◆ 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::false_type   
)
inlineprivate

Definition at line 363 of file _flow_graph_node_impl.h.

363  {
364  if( my_max_concurrency == 0 ) {
365  return create_body_task(t);
366  } else {
367  return internal_try_put_bypass(t);
368  }
369  }
task * internal_try_put_bypass(const input_type &t)

References internal::function_input_base< Input, Policy, A, ImplType >::create_body_task(), internal::function_input_base< Input, Policy, A, ImplType >::internal_try_put_bypass(), and internal::function_input_base< Input, Policy, A, ImplType >::my_max_concurrency.

Here is the call 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::true_type   
)
inlineprivate

Definition at line 350 of file _flow_graph_node_impl.h.

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

References internal::function_input_base< Input, Policy, A, ImplType >::apply_body_bypass(), internal::function_input_base< Input, Policy, A, ImplType >::internal_try_put_bypass(), internal::function_input_base< Input, Policy, A, ImplType >::my_aggregator, internal::function_input_base< Input, Policy, A, ImplType >::my_max_concurrency, internal::function_input_base< Input, Policy, A, ImplType >::occupy_concurrency, tbb::interface6::internal::aggregated_operation< Derived >::status, and internal::SUCCEEDED.

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

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

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 198 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 198 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 227 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-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.