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
}
 
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 860 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 1281 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 1302 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 1264 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 1261 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 1263 of file _flow_graph_join_impl.h.

Member Enumeration Documentation

◆ 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 1276 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 1387 of file _flow_graph_join_impl.h.

1387  : graph_node(g), input_ports_type(g), forwarder_busy(false) {
1388  my_successors.set_owner(this);
1389  input_ports_type::set_my_node(this);
1390  my_aggregator.initialize_handler(handler_type(this));
1391  }
internal::aggregating_functor< class_type, join_node_base_operation > handler_type
broadcast_cache< output_type, null_rw_mutex > my_successors
aggregator< handler_type, join_node_base_operation > my_aggregator
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type
void set_owner(owner_type *owner)

◆ 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 1393 of file _flow_graph_join_impl.h.

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

◆ 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 1402 of file _flow_graph_join_impl.h.

1402  : graph_node(g), input_ports_type(g, f), forwarder_busy(false) {
1403  my_successors.set_owner(this);
1404  input_ports_type::set_my_node(this);
1405  my_aggregator.initialize_handler(handler_type(this));
1406  }
internal::aggregating_functor< class_type, join_node_base_operation > handler_type
broadcast_cache< output_type, null_rw_mutex > my_successors
aggregator< handler_type, join_node_base_operation > my_aggregator
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type
void set_owner(owner_type *owner)

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 1470 of file _flow_graph_join_impl.h.

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

1470  {
1471  join_node_base_operation op_data(do_fwrd_bypass);
1472  my_aggregator.execute(&op_data);
1473  return op_data.bypass_t;
1474  }
aggregator< handler_type, join_node_base_operation > my_aggregator

◆ 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 1307 of file _flow_graph_join_impl.h.

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.

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

References SUCCEEDED.

1408  {
1409  join_node_base_operation op_data(r, reg_succ);
1410  my_aggregator.execute(&op_data);
1411  return op_data.status == SUCCEEDED;
1412  }
aggregator< handler_type, join_node_base_operation > my_aggregator

◆ 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 1414 of file _flow_graph_join_impl.h.

References SUCCEEDED.

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

◆ 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 1461 of file _flow_graph_join_impl.h.

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

1461  {
1462  input_ports_type::reset(f);
1464  }
broadcast_cache< output_type, null_rw_mutex > my_successors

◆ 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 1420 of file _flow_graph_join_impl.h.

References __TBB_override, and SUCCEEDED.

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

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 1469 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 1303 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 1304 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 1305 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 1467 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.