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 867 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 1290 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 1311 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 1272 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 1269 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 1271 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 1284 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 1396 of file _flow_graph_join_impl.h.

1396  : graph_node(g), input_ports_type(g), forwarder_busy(false) {
1397  my_successors.set_owner(this);
1398  input_ports_type::set_my_node(this);
1399  my_aggregator.initialize_handler(handler_type(this));
1400  }
aggregator< handler_type, join_node_base_operation > my_aggregator
void set_owner(owner_type *owner)
broadcast_cache< output_type, null_rw_mutex > my_successors
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type
internal::aggregating_functor< class_type, join_node_base_operation > handler_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 1402 of file _flow_graph_join_impl.h.

1402  :
1403  graph_node(other.graph_node::my_graph), input_ports_type(other),
1404  sender<OutputTuple>(), forwarder_busy(false), my_successors() {
1405  my_successors.set_owner(this);
1406  input_ports_type::set_my_node(this);
1407  my_aggregator.initialize_handler(handler_type(this));
1408  }
aggregator< handler_type, join_node_base_operation > my_aggregator
void set_owner(owner_type *owner)
broadcast_cache< output_type, null_rw_mutex > my_successors
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type
internal::aggregating_functor< class_type, join_node_base_operation > handler_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 1411 of file _flow_graph_join_impl.h.

1411  : graph_node(g), input_ports_type(g, f), forwarder_busy(false) {
1412  my_successors.set_owner(this);
1413  input_ports_type::set_my_node(this);
1414  my_aggregator.initialize_handler(handler_type(this));
1415  }
aggregator< handler_type, join_node_base_operation > my_aggregator
void set_owner(owner_type *owner)
broadcast_cache< output_type, null_rw_mutex > my_successors
join_node_FE< JP, InputTuple, OutputTuple > input_ports_type
internal::aggregating_functor< class_type, join_node_base_operation > handler_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 1479 of file _flow_graph_join_impl.h.

1479  {
1480  join_node_base_operation op_data(do_fwrd_bypass);
1481  my_aggregator.execute(&op_data);
1482  return op_data.bypass_t;
1483  }
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 1316 of file _flow_graph_join_impl.h.

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

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

1417  {
1418  join_node_base_operation op_data(r, reg_succ);
1419  my_aggregator.execute(&op_data);
1420  return op_data.status == SUCCEEDED;
1421  }
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 1423 of file _flow_graph_join_impl.h.

1423  {
1424  join_node_base_operation op_data(r, rem_succ);
1425  my_aggregator.execute(&op_data);
1426  return op_data.status == SUCCEEDED;
1427  }
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 1470 of file _flow_graph_join_impl.h.

1470  {
1471  input_ports_type::reset(f);
1473  }
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 1429 of file _flow_graph_join_impl.h.

1429  {
1430  join_node_base_operation op_data(v, try__get);
1431  my_aggregator.execute(&op_data);
1432  return op_data.status == SUCCEEDED;
1433  }
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 1478 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 1312 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 1313 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 1314 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 1476 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.