Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
internal::join_node_base< JP, InputTuple, OutputTuple > Class Template Reference

join_node_base More...

#include <_flow_graph_join_impl.h>

Inheritance diagram for internal::join_node_base< JP, InputTuple, OutputTuple >:
Collaboration diagram for internal::join_node_base< JP, InputTuple, OutputTuple >:

Classes

class  join_node_base_operation
 

Public Types

typedef OutputTuple output_type
 
typedef sender< output_type >::successor_type successor_type
 
typedef join_node_FE< JP, InputTuple, OutputTuple > input_ports_type
 
- Public Types inherited from tbb::flow::interface10::sender< OutputTuple >
typedef OutputTuple output_type
 The output type of this sender. More...
 
typedef internal::async_helpers< OutputTuple >::filtered_type filtered_type
 
- Public Types inherited from tbb::flow::interface10::internal::untyped_sender
typedef untyped_receiver successor_type
 The successor type for this node. More...
 

Public Member Functions

 join_node_base (graph &g)
 
 join_node_base (const join_node_base &other)
 
template<typename FunctionTuple >
 join_node_base (graph &g, FunctionTuple f)
 
bool register_successor (successor_type &r) __TBB_override
 Add a new successor to this node. More...
 
bool remove_successor (successor_type &r) __TBB_override
 Removes a successor from this node. More...
 
bool try_get (output_type &v) __TBB_override
 Request an item from the sender. More...
 
- Public Member Functions inherited from tbb::flow::interface10::sender< OutputTuple >
virtual bool try_reserve (OutputTuple &)
 Reserves an item in the sender. More...
 
- Public Member Functions inherited from tbb::flow::interface10::internal::untyped_sender
virtual ~untyped_sender ()
 
virtual bool try_release ()
 Releases the reserved item. More...
 
virtual bool try_consume ()
 Consumes the reserved item. More...
 

Protected Member Functions

void reset_node (reset_flags f) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::sender< OutputTuple >
virtual bool try_get_wrapper (void *p, bool is_async) __TBB_override
 
virtual bool try_reserve_wrapper (void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::untyped_sender
template<typename X >
bool try_get (X &t)
 Request an item from the sender. More...
 
template<typename X >
bool try_reserve (X &t)
 Reserves an item in the sender. More...
 

Private Types

enum  op_type {
  reg_succ, rem_succ, try__get, do_fwrd,
  do_fwrd_bypass
}
 
enum  op_stat { WAIT =0, SUCCEEDED, FAILED }
 
typedef join_node_base< JP, InputTuple, OutputTuple > class_type
 
typedef internal::aggregating_functor< class_type, join_node_base_operationhandler_type
 

Private Member Functions

void handle_operations (join_node_base_operation *op_list)
 
taskforward_task ()
 

Private Attributes

bool forwarder_busy
 
aggregator< handler_type, join_node_base_operationmy_aggregator
 
broadcast_cache< output_type, null_rw_mutex > my_successors
 

Friends

class internal::aggregating_functor< class_type, join_node_base_operation >
 
class forward_task_bypass< join_node_base< JP, InputTuple, OutputTuple > >
 

Detailed Description

template<typename JP, typename InputTuple, typename OutputTuple>
class internal::join_node_base< JP, InputTuple, OutputTuple >

join_node_base

Definition at line 863 of file _flow_graph_join_impl.h.

Member Typedef Documentation

◆ class_type

template<typename JP , typename InputTuple , typename OutputTuple >
typedef join_node_base<JP,InputTuple,OutputTuple> internal::join_node_base< JP, InputTuple, OutputTuple >::class_type
private

Definition at line 1286 of file _flow_graph_join_impl.h.

◆ handler_type

template<typename JP , typename InputTuple , typename OutputTuple >
typedef internal::aggregating_functor<class_type, join_node_base_operation> internal::join_node_base< JP, InputTuple, OutputTuple >::handler_type
private

Definition at line 1307 of file _flow_graph_join_impl.h.

◆ input_ports_type

template<typename JP , typename InputTuple , typename OutputTuple >
typedef join_node_FE<JP, InputTuple, OutputTuple> internal::join_node_base< JP, InputTuple, OutputTuple >::input_ports_type

Definition at line 1268 of file _flow_graph_join_impl.h.

◆ output_type

template<typename JP , typename InputTuple , typename OutputTuple >
typedef OutputTuple internal::join_node_base< JP, InputTuple, OutputTuple >::output_type

Definition at line 1265 of file _flow_graph_join_impl.h.

◆ successor_type

template<typename JP , typename InputTuple , typename OutputTuple >
typedef sender<output_type>::successor_type internal::join_node_base< JP, InputTuple, OutputTuple >::successor_type

Definition at line 1267 of file _flow_graph_join_impl.h.

Member Enumeration Documentation

◆ op_stat

template<typename JP , typename InputTuple , typename OutputTuple >
enum internal::join_node_base::op_stat
private

◆ op_type

template<typename JP , typename InputTuple , typename OutputTuple >
enum internal::join_node_base::op_type
private
Enumerator
reg_succ 
rem_succ 
try__get 
do_fwrd 
do_fwrd_bypass 

Definition at line 1280 of file _flow_graph_join_impl.h.

Constructor & Destructor Documentation

◆ join_node_base() [1/3]

template<typename JP , typename InputTuple , typename OutputTuple >
internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base ( graph &  g)
inline

Definition at line 1392 of file _flow_graph_join_impl.h.

1392  : graph_node(g), input_ports_type(g), forwarder_busy(false) {
1393  my_successors.set_owner(this);
1394  input_ports_type::set_my_node(this);
1395  my_aggregator.initialize_handler(handler_type(this));
1396  }
aggregator< handler_type, join_node_base_operation > my_aggregator
broadcast_cache< output_type, null_rw_mutex > my_successors
void set_owner(owner_type *owner)
internal::aggregating_functor< class_type, join_node_base_operation > handler_type
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type

◆ join_node_base() [2/3]

template<typename JP , typename InputTuple , typename OutputTuple >
internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base ( const join_node_base< JP, InputTuple, OutputTuple > &  other)
inline

Definition at line 1398 of file _flow_graph_join_impl.h.

1398  :
1399  graph_node(other.graph_node::my_graph), input_ports_type(other),
1400  sender<OutputTuple>(), forwarder_busy(false), my_successors() {
1401  my_successors.set_owner(this);
1402  input_ports_type::set_my_node(this);
1403  my_aggregator.initialize_handler(handler_type(this));
1404  }
aggregator< handler_type, join_node_base_operation > my_aggregator
broadcast_cache< output_type, null_rw_mutex > my_successors
void set_owner(owner_type *owner)
internal::aggregating_functor< class_type, join_node_base_operation > handler_type
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type

◆ join_node_base() [3/3]

template<typename JP , typename InputTuple , typename OutputTuple >
template<typename FunctionTuple >
internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base ( graph &  g,
FunctionTuple  f 
)
inline

Definition at line 1407 of file _flow_graph_join_impl.h.

1407  : graph_node(g), input_ports_type(g, f), forwarder_busy(false) {
1408  my_successors.set_owner(this);
1409  input_ports_type::set_my_node(this);
1410  my_aggregator.initialize_handler(handler_type(this));
1411  }
aggregator< handler_type, join_node_base_operation > my_aggregator
broadcast_cache< output_type, null_rw_mutex > my_successors
void set_owner(owner_type *owner)
internal::aggregating_functor< class_type, join_node_base_operation > handler_type
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type

Member Function Documentation

◆ forward_task()

template<typename JP , typename InputTuple , typename OutputTuple >
task* internal::join_node_base< JP, InputTuple, OutputTuple >::forward_task ( )
inlineprivate

Definition at line 1475 of file _flow_graph_join_impl.h.

1475  {
1476  join_node_base_operation op_data(do_fwrd_bypass);
1477  my_aggregator.execute(&op_data);
1478  return op_data.bypass_t;
1479  }
aggregator< handler_type, join_node_base_operation > my_aggregator

References internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base_operation::bypass_t.

◆ handle_operations()

template<typename JP , typename InputTuple , typename OutputTuple >
void internal::join_node_base< JP, InputTuple, OutputTuple >::handle_operations ( join_node_base_operation op_list)
inlineprivate

Definition at line 1312 of file _flow_graph_join_impl.h.

1312  {
1313  join_node_base_operation *current;
1314  while(op_list) {
1315  current = op_list;
1316  op_list = op_list->next;
1317  switch(current->type) {
1318  case reg_succ: {
1319  my_successors.register_successor(*(current->my_succ));
1320  if(tuple_build_may_succeed() && !forwarder_busy && internal::is_graph_active(my_graph)) {
1321  task *rtask = new ( task::allocate_additional_child_of(*(my_graph.root_task())) )
1322  forward_task_bypass
1323  <join_node_base<JP,InputTuple,OutputTuple> >(*this);
1324  internal::spawn_in_graph_arena(my_graph, *rtask);
1325  forwarder_busy = true;
1326  }
1327  __TBB_store_with_release(current->status, SUCCEEDED);
1328  }
1329  break;
1330  case rem_succ:
1331  my_successors.remove_successor(*(current->my_succ));
1332  __TBB_store_with_release(current->status, SUCCEEDED);
1333  break;
1334  case try__get:
1335  if(tuple_build_may_succeed()) {
1336  if(try_to_make_tuple(*(current->my_arg))) {
1337  tuple_accepted();
1338  __TBB_store_with_release(current->status, SUCCEEDED);
1339  }
1340  else __TBB_store_with_release(current->status, FAILED);
1341  }
1342  else __TBB_store_with_release(current->status, FAILED);
1343  break;
1344  case do_fwrd_bypass: {
1345  bool build_succeeded;
1346  task *last_task = NULL;
1347  output_type out;
1348  if(tuple_build_may_succeed()) { // checks output queue of FE
1349  do {
1350  build_succeeded = try_to_make_tuple(out); // fetch front_end of queue
1351  if(build_succeeded) {
1352  task *new_task = my_successors.try_put_task(out);
1353  last_task = combine_tasks(my_graph, last_task, new_task);
1354  if(new_task) {
1355  tuple_accepted();
1356  }
1357  else {
1358  tuple_rejected();
1359  build_succeeded = false;
1360  }
1361  }
1362  } while(build_succeeded);
1363  }
1364  current->bypass_t = last_task;
1365  __TBB_store_with_release(current->status, SUCCEEDED);
1366  forwarder_busy = false;
1367  }
1368  break;
1369 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1370  case add_blt_succ:
1371  my_successors.internal_add_built_successor(*(current->my_succ));
1372  __TBB_store_with_release(current->status, SUCCEEDED);
1373  break;
1374  case del_blt_succ:
1375  my_successors.internal_delete_built_successor(*(current->my_succ));
1376  __TBB_store_with_release(current->status, SUCCEEDED);
1377  break;
1378  case blt_succ_cnt:
1379  current->cnt_val = my_successors.successor_count();
1380  __TBB_store_with_release(current->status, SUCCEEDED);
1381  break;
1382  case blt_succ_cpy:
1383  my_successors.copy_successors(*(current->slist));
1384  __TBB_store_with_release(current->status, SUCCEEDED);
1385  break;
1386 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
1387  }
1388  }
1389  }
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:713
broadcast_cache< output_type, null_rw_mutex > my_successors
void spawn_in_graph_arena(graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
task * try_put_task(const T &t) __TBB_override
void remove_successor(successor_type &r)
void register_successor(successor_type &r)
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:167

References tbb::internal::__TBB_store_with_release(), internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base_operation::bypass_t, tbb::flow::interface10::combine_tasks(), FAILED, tbb::flow::interface10::internal::is_graph_active(), internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base_operation::my_arg, internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base_operation::my_succ, tbb::flow::interface10::internal::spawn_in_graph_arena(), SUCCEEDED, task, and internal::join_node_base< JP, InputTuple, OutputTuple >::join_node_base_operation::type.

Here is the call graph for this function:

◆ register_successor()

template<typename JP , typename InputTuple , typename OutputTuple >
bool internal::join_node_base< JP, InputTuple, OutputTuple >::register_successor ( successor_type r)
inlinevirtual

Add a new successor to this node.

Implements tbb::flow::interface10::internal::untyped_sender.

Definition at line 1413 of file _flow_graph_join_impl.h.

1413  {
1414  join_node_base_operation op_data(r, reg_succ);
1415  my_aggregator.execute(&op_data);
1416  return op_data.status == SUCCEEDED;
1417  }
aggregator< handler_type, join_node_base_operation > my_aggregator

References SUCCEEDED.

◆ remove_successor()

template<typename JP , typename InputTuple , typename OutputTuple >
bool internal::join_node_base< JP, InputTuple, OutputTuple >::remove_successor ( successor_type r)
inlinevirtual

Removes a successor from this node.

Implements tbb::flow::interface10::internal::untyped_sender.

Definition at line 1419 of file _flow_graph_join_impl.h.

1419  {
1420  join_node_base_operation op_data(r, rem_succ);
1421  my_aggregator.execute(&op_data);
1422  return op_data.status == SUCCEEDED;
1423  }
aggregator< handler_type, join_node_base_operation > my_aggregator

References SUCCEEDED.

◆ reset_node()

template<typename JP , typename InputTuple , typename OutputTuple >
void internal::join_node_base< JP, InputTuple, OutputTuple >::reset_node ( reset_flags  f)
inlineprotected

Definition at line 1466 of file _flow_graph_join_impl.h.

1466  {
1467  input_ports_type::reset(f);
1469  }
broadcast_cache< output_type, null_rw_mutex > my_successors

References tbb::flow::interface10::rf_clear_edges.

◆ try_get()

template<typename JP , typename InputTuple , typename OutputTuple >
bool internal::join_node_base< JP, InputTuple, OutputTuple >::try_get ( output_type )
inlinevirtual

Request an item from the sender.

Reimplemented from tbb::flow::interface10::sender< OutputTuple >.

Definition at line 1425 of file _flow_graph_join_impl.h.

1425  {
1426  join_node_base_operation op_data(v, try__get);
1427  my_aggregator.execute(&op_data);
1428  return op_data.status == SUCCEEDED;
1429  }
aggregator< handler_type, join_node_base_operation > my_aggregator

References SUCCEEDED.

Friends And Related Function Documentation

◆ forward_task_bypass< join_node_base< JP, InputTuple, OutputTuple > >

template<typename JP , typename InputTuple , typename OutputTuple >
friend class forward_task_bypass< join_node_base< JP, InputTuple, OutputTuple > >
friend

Definition at line 1474 of file _flow_graph_join_impl.h.

◆ internal::aggregating_functor< class_type, join_node_base_operation >

template<typename JP , typename InputTuple , typename OutputTuple >
friend class internal::aggregating_functor< class_type, join_node_base_operation >
friend

Definition at line 1308 of file _flow_graph_join_impl.h.

Member Data Documentation

◆ forwarder_busy

template<typename JP , typename InputTuple , typename OutputTuple >
bool internal::join_node_base< JP, InputTuple, OutputTuple >::forwarder_busy
private

Definition at line 1309 of file _flow_graph_join_impl.h.

◆ my_aggregator

template<typename JP , typename InputTuple , typename OutputTuple >
aggregator<handler_type, join_node_base_operation> internal::join_node_base< JP, InputTuple, OutputTuple >::my_aggregator
private

Definition at line 1310 of file _flow_graph_join_impl.h.

◆ my_successors

template<typename JP , typename InputTuple , typename OutputTuple >
broadcast_cache<output_type, null_rw_mutex> internal::join_node_base< JP, InputTuple, OutputTuple >::my_successors
private

Definition at line 1472 of file _flow_graph_join_impl.h.


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

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