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

join_node_base More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::internal::join_node_base< JP, InputTuple, OutputTuple >:
Collaboration diagram for tbb::flow::interface11::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::interface11::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::interface11::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface11::sender< OutputTuple >
virtual bool try_reserve (OutputTuple &)
 Reserves an item in the sender. More...
 
- Public Member Functions inherited from tbb::flow::interface11::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::interface11::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::interface11::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...
 

Protected Attributes

graphmy_graph
 
- Protected Attributes inherited from tbb::flow::interface11::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 

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_mutexmy_successors
 

Friends

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

Additional Inherited Members

- Public Attributes inherited from tbb::flow::interface11::sender< OutputTuple >
__TBB_DEPRECATED typedef OutputTuple output_type
 The output type of this sender. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< OutputTuple >::filtered_type filtered_type
 

Detailed Description

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

join_node_base

Definition at line 868 of file flow_graph.h.

Member Typedef Documentation

◆ class_type

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

Definition at line 1289 of file flow_graph.h.

◆ handler_type

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

Definition at line 1310 of file flow_graph.h.

◆ input_ports_type

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

Definition at line 1272 of file flow_graph.h.

◆ output_type

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

Definition at line 1269 of file flow_graph.h.

◆ successor_type

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

Definition at line 1271 of file flow_graph.h.

Member Enumeration Documentation

◆ op_type

template<typename JP , typename InputTuple , typename OutputTuple >
enum tbb::flow::interface11::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.h.

1286  {
1287  v = my_cached_item;
1288  my_has_cached_item = false;

Constructor & Destructor Documentation

◆ join_node_base() [1/3]

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

Definition at line 1395 of file flow_graph.h.

References tbb::internal::fgt_begin_body(), and tbb::internal::fgt_end_body().

1395  {
1396  tbb::internal::fgt_begin_body( my_body );
1397  bool r = (*my_body)(my_cached_item);
1398  tbb::internal::fgt_end_body( my_body );
1399  if (r) {
static void fgt_end_body(void *)
static void fgt_begin_body(void *)
Here is the call graph for this function:

◆ join_node_base() [2/3]

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

Definition at line 1401 of file flow_graph.h.

1403  {
1404  v = my_cached_item;
1405  my_reserved = true;
1406  return true;
1407  } else {

◆ join_node_base() [3/3]

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

Definition at line 1410 of file flow_graph.h.

1416  {

Member Function Documentation

◆ forward_task()

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

Definition at line 1478 of file flow_graph.h.

◆ handle_operations()

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

Definition at line 1315 of file flow_graph.h.

1315  {
1316  spin_mutex::scoped_lock lock(my_mutex);
1317  __TBB_ASSERT( my_reserved && my_has_cached_item, "releasing non-existent reservation" );
1318  my_reserved = false;
1319  if(!my_successors.empty())
1320  spawn_put();
1321  return true;
1322  }
1323 
1325  bool try_consume( ) __TBB_override {
1326  spin_mutex::scoped_lock lock(my_mutex);
1327  __TBB_ASSERT( my_reserved && my_has_cached_item, "consuming non-existent reservation" );
1328  my_reserved = false;
1329  my_has_cached_item = false;
1330  if ( !my_successors.empty() ) {
1331  spawn_put();
1332  }
1333  return true;
1334  }
1335 
1337  void activate() {
1338  spin_mutex::scoped_lock lock(my_mutex);
1339  my_active = true;
1340  if (!my_successors.empty())
1341  spawn_put();
1342  }
1343 
1344  template<typename Body>
1345  Body copy_function_object() {
1346  internal::source_body<output_type> &body_ref = *this->my_body;
1347  return dynamic_cast< internal::source_body_leaf<output_type, Body> & >(body_ref).get_body();
1348  }
1349 
1350 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1351  void extract( ) __TBB_override {
1352  my_successors.built_successors().sender_extract(*this); // removes "my_owner" == this from each successor
1353  my_active = init_my_active;
1354  my_reserved = false;
1355  if(my_has_cached_item) my_has_cached_item = false;
1356  }
1357 #endif
1358 
1359 protected:
1360 
1363  my_active = init_my_active;
1364  my_reserved =false;
1365  if(my_has_cached_item) {
1366  my_has_cached_item = false;
1367  }
1369  if(f & rf_reset_bodies) {
1370  internal::source_body<output_type> *tmp = my_init_body->clone();
1371  delete my_body;
1372  my_body = tmp;
1373  }
1374  if(my_active)
1375  internal::add_task_to_graph_reset_list(this->my_graph, create_put_task());
1376  }
1377 
1378 private:
1379  spin_mutex my_mutex;
1380  bool my_active;
1381  bool init_my_active;
1383  internal::source_body<output_type> *my_init_body;
1385  bool my_reserved;
1386  bool my_has_cached_item;
1387  output_type my_cached_item;
1388 
1389  // used by apply_body_bypass, can invoke body of node.
1390  bool try_reserve_apply_body(output_type &v) {
1391  spin_mutex::scoped_lock lock(my_mutex);
1392  if ( my_reserved ) {
virtual source_body * clone()=0
void add_task_to_graph_reset_list(tbb::flow::interface10::graph &g, tbb::task *tp)
A functor that takes no input and generates a value of type Output.
broadcast_cache< output_type, null_rw_mutex > my_successors
Definition: flow_graph.h:1475
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1469
virtual bool try_consume()
Consumes the reserved item.
Definition: flow_graph.h:328
friend class scoped_lock
Definition: spin_mutex.h:179
#define __TBB_override
Definition: tbb_stddef.h:240
#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 __itt_model_task_instance ITT_FORMAT p void * lock
The leaf for source_body.

◆ register_successor()

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

Add a new successor to this node.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 1416 of file flow_graph.h.

1416  {
1417  return ( new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
1418  internal:: source_task_bypass < source_node< output_type > >( *this ) );
1419  }
1420 
A task that calls a node&#39;s apply_body_bypass function with no input.
tbb::task * root_task()
Returns the root task of the graph.

◆ remove_successor()

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

Removes a successor from this node.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 1422 of file flow_graph.h.

1422  {
1423  if(internal::is_graph_active(this->my_graph)) {
1424  internal::spawn_in_graph_arena(this->my_graph, *create_put_task());
1425  }
1426  }
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.
bool is_graph_active(tbb::flow::interface10::graph &g)

◆ reset_node()

template<typename JP , typename InputTuple , typename OutputTuple >
void tbb::flow::interface11::internal::join_node_base< JP, InputTuple, OutputTuple >::reset_node ( reset_flags  f)
inlineprotectedvirtual

Implements tbb::flow::interface11::graph_node.

Definition at line 1469 of file flow_graph.h.

1469  :
1470  typedef Input input_type;
1471  typedef Output output_type;
Implements methods for a function node that takes a type Input as input and sends.

◆ try_get()

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

Request an item from the sender.

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

Definition at line 1428 of file flow_graph.h.

1430  {
1431  output_type v;
1432  if ( !try_reserve_apply_body(v) )

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 1477 of file flow_graph.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 1311 of file flow_graph.h.

Member Data Documentation

◆ forwarder_busy

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

Definition at line 1312 of file flow_graph.h.

◆ my_aggregator

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

Definition at line 1313 of file flow_graph.h.

◆ my_graph

template<typename JP , typename InputTuple , typename OutputTuple >
graph& tbb::flow::interface11::graph_node::my_graph
protected

Definition at line 464 of file _flow_graph_impl.h.

◆ my_successors

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

Definition at line 1475 of file flow_graph.h.


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.