Home ⌂Doc Index ◂Up ▴
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.

1289  {

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.

1398  {
1399  spin_mutex::scoped_lock lock(my_mutex);
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
friend class scoped_lock
Definition: spin_mutex.h:179

◆ 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  tbb::internal::fgt_begin_body( my_body );
1405  bool r = (*my_body)(my_cached_item);
1406  tbb::internal::fgt_end_body( my_body );
1407  if (r) {
static void fgt_end_body(void *)
static void fgt_begin_body(void *)

◆ 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.

1411  {
1412  v = my_cached_item;
1413  my_reserved = true;
1414  return true;

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.

1316  {
1317  return false;
1318  }
1319  }
1320 
1322 
1323  bool try_release( ) __TBB_override {
1324  spin_mutex::scoped_lock lock(my_mutex);
1325  __TBB_ASSERT( my_reserved && my_has_cached_item, "releasing non-existent reservation" );
1326  my_reserved = false;
1327  if(!my_successors.empty())
1328  spawn_put();
1329  return true;
1330  }
1331 
1333  bool try_consume( ) __TBB_override {
1334  spin_mutex::scoped_lock lock(my_mutex);
1335  __TBB_ASSERT( my_reserved && my_has_cached_item, "consuming non-existent reservation" );
1336  my_reserved = false;
1337  my_has_cached_item = false;
1338  if ( !my_successors.empty() ) {
1339  spawn_put();
1340  }
1341  return true;
1342  }
1343 
1345  void activate() {
1346  spin_mutex::scoped_lock lock(my_mutex);
1347  my_active = true;
1348  if (!my_successors.empty())
1349  spawn_put();
1350  }
1351 
1352  template<typename Body>
1353  Body copy_function_object() {
1354  internal::source_body<output_type> &body_ref = *this->my_body;
1355  return dynamic_cast< internal::source_body_leaf<output_type, Body> & >(body_ref).get_body();
1356  }
1357 
1358 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
1359  void extract( ) __TBB_override {
1360  my_successors.built_successors().sender_extract(*this); // removes "my_owner" == this from each successor
1361  my_active = init_my_active;
1362  my_reserved = false;
1363  if(my_has_cached_item) my_has_cached_item = false;
1364  }
1365 #endif
1366 
1367 protected:
1368 
1371  my_active = init_my_active;
1372  my_reserved =false;
1373  if(my_has_cached_item) {
1374  my_has_cached_item = false;
1375  }
1377  if(f & rf_reset_bodies) {
1378  internal::source_body<output_type> *tmp = my_init_body->clone();
1379  delete my_body;
1380  my_body = tmp;
1381  }
1382  if(my_active)
1383  internal::add_task_to_graph_reset_list(this->my_graph, create_put_task());
1384  }
1385 
1386 private:
1387  spin_mutex my_mutex;
1388  bool my_active;
1389  bool init_my_active;
1391  internal::source_body<output_type> *my_init_body;
The leaf for source_body.
virtual bool try_release()
Releases the reserved item.
Definition: flow_graph.h:326
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:1469
virtual source_body * clone()=0
broadcast_cache< output_type, null_rw_mutex > my_successors
Definition: flow_graph.h:1475
void add_task_to_graph_reset_list(tbb::flow::interface10::graph &g, tbb::task *tp)
#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
virtual bool try_consume()
Consumes the reserved item.
Definition: flow_graph.h:329
friend class scoped_lock
Definition: spin_mutex.h:179

◆ 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.

1424  {

◆ 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.

1424  {
1425  return ( new ( task::allocate_additional_child_of( *(this->my_graph.root_task()) ) )
1426  internal:: source_task_bypass < source_node< output_type > >( *this ) );
A task that calls a node's apply_body_bypass function with no input.
__TBB_DEPRECATED tbb::task * root_task()
Returns the root task of the graph.

◆ 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.

1477  :
1478  typedef Input input_type;

◆ 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  if(internal::is_graph_active(this->my_graph)) {
1432  internal::spawn_in_graph_arena(this->my_graph, *create_put_task());
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)

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.