Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::continue_receiver Class Referenceabstract

Base class for receivers of completion messages. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::continue_receiver:
Collaboration diagram for tbb::flow::interface11::continue_receiver:

Public Member Functions

__TBB_DEPRECATED continue_receiver (__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority))
 Constructor. More...
 
__TBB_DEPRECATED continue_receiver (const continue_receiver &src)
 Copy constructor. More...
 
__TBB_DEPRECATED bool register_predecessor (predecessor_type &) __TBB_override
 Increments the trigger threshold. More...
 
__TBB_DEPRECATED bool remove_predecessor (predecessor_type &) __TBB_override
 Decrements the trigger threshold. More...
 
- Public Member Functions inherited from tbb::flow::interface11::receiver< continue_msg >
virtual ~receiver ()
 Destructor. More...
 
bool try_put (const continue_msg &t)
 Put an item to the receiver. More...
 

Public Attributes

__TBB_DEPRECATED typedef continue_msg input_type
 The input type. More...
 
__TBB_DEPRECATED typedef receiver< input_type >::predecessor_type predecessor_type
 The predecessor type for this node. More...
 
- Public Attributes inherited from tbb::flow::interface11::receiver< continue_msg >
__TBB_DEPRECATED typedef continue_msg input_type
 The input type of this receiver. More...
 
__TBB_DEPRECATED typedef sender< continue_msgpredecessor_type
 The predecessor type for this node. More...
 

Protected Member Functions

tasktry_put_task (const input_type &) __TBB_override
 
void reset_receiver (reset_flags f) __TBB_override
 put receiver back in initial state More...
 
virtual taskexecute ()=0
 Does whatever should happen when the threshold is reached. More...
 
bool is_continue_receiver () __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::receiver< continue_msg >
virtual tasktry_put_task (const continue_msg &t)=0
 
virtual graphgraph_reference () const=0
 

Protected Attributes

spin_mutex my_mutex
 
int my_predecessor_count
 
int my_current_count
 
int my_initial_predecessor_count
 

Friends

template<typename R , typename B >
class run_and_put_task
 
template<typename X , typename Y >
class internal::broadcast_cache
 
template<typename X , typename Y >
class internal::round_robin_cache
 
template<typename U , typename V >
class tbb::flow::interface11::limiter_node
 
template<typename TT , typename M >
class internal::successor_cache
 

Detailed Description

Base class for receivers of completion messages.

These receivers automatically reset, but cannot be explicitly waited on

Definition at line 598 of file flow_graph.h.

Constructor & Destructor Documentation

◆ continue_receiver() [1/2]

__TBB_DEPRECATED tbb::flow::interface11::continue_receiver::continue_receiver ( __TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority)  )
inlineexplicit

Constructor.

Definition at line 608 of file flow_graph.h.

609  {
610  my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
611  my_current_count = 0;
612  __TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = priority; )
613  }

References __TBB_FLOW_GRAPH_PRIORITY_EXPR, my_current_count, my_initial_predecessor_count, and my_predecessor_count.

◆ continue_receiver() [2/2]

__TBB_DEPRECATED tbb::flow::interface11::continue_receiver::continue_receiver ( const continue_receiver src)
inline

Copy constructor.

Definition at line 616 of file flow_graph.h.

616  : receiver<continue_msg>() {
617  my_predecessor_count = my_initial_predecessor_count = src.my_initial_predecessor_count;
618  my_current_count = 0;
619  __TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = src.my_priority; )
620  }

References __TBB_FLOW_GRAPH_PRIORITY_EXPR, my_current_count, my_initial_predecessor_count, and my_predecessor_count.

Member Function Documentation

◆ execute()

virtual task* tbb::flow::interface11::continue_receiver::execute ( )
protectedpure virtual

Does whatever should happen when the threshold is reached.

This should be very fast or else spawn a task. This is called while the sender is blocked in the try_put().

Referenced by try_put_task().

Here is the caller graph for this function:

◆ is_continue_receiver()

bool tbb::flow::interface11::continue_receiver::is_continue_receiver ( )
inlineprotectedvirtual

Reimplemented from tbb::flow::interface11::receiver< continue_msg >.

Definition at line 712 of file flow_graph.h.

712 { return true; }

◆ register_predecessor()

__TBB_DEPRECATED bool tbb::flow::interface11::continue_receiver::register_predecessor ( predecessor_type )
inlinevirtual

Increments the trigger threshold.

Reimplemented from tbb::flow::interface11::receiver< continue_msg >.

Definition at line 623 of file flow_graph.h.

623  {
626  return true;
627  }

References my_mutex, and my_predecessor_count.

◆ remove_predecessor()

__TBB_DEPRECATED bool tbb::flow::interface11::continue_receiver::remove_predecessor ( predecessor_type )
inlinevirtual

Decrements the trigger threshold.

Does not check to see if the removal of the predecessor now makes the current count exceed the new threshold. So removing a predecessor while the graph is active can cause unexpected results.

Reimplemented from tbb::flow::interface11::receiver< continue_msg >.

Definition at line 633 of file flow_graph.h.

633  {
636  return true;
637  }

References my_mutex, and my_predecessor_count.

◆ reset_receiver()

void tbb::flow::interface11::continue_receiver::reset_receiver ( reset_flags  f)
inlineprotectedvirtual

put receiver back in initial state

Implements tbb::flow::interface11::receiver< continue_msg >.

Definition at line 697 of file flow_graph.h.

697  {
698  my_current_count = 0;
699  if (f & rf_clear_edges) {
700 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
701  my_built_predecessors.clear();
702 #endif
704  }
705  }

References my_current_count, my_initial_predecessor_count, my_predecessor_count, and tbb::flow::interface11::rf_clear_edges.

◆ try_put_task()

task* tbb::flow::interface11::continue_receiver::try_put_task ( const input_type )
inlineprotected

Definition at line 671 of file flow_graph.h.

671  {
672  {
675  return SUCCESSFULLY_ENQUEUED;
676  else
677  my_current_count = 0;
678  }
679  task * res = execute();
680  return res? res : SUCCESSFULLY_ENQUEUED;
681  }

References execute(), my_current_count, my_mutex, my_predecessor_count, and tbb::flow::internal::SUCCESSFULLY_ENQUEUED.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ internal::broadcast_cache

template<typename X , typename Y >
friend class internal::broadcast_cache
friend

Definition at line 668 of file flow_graph.h.

◆ internal::round_robin_cache

template<typename X , typename Y >
friend class internal::round_robin_cache
friend

Definition at line 669 of file flow_graph.h.

◆ internal::successor_cache

template<typename TT , typename M >
friend class internal::successor_cache
friend

Definition at line 711 of file flow_graph.h.

◆ run_and_put_task

template<typename R , typename B >
friend class run_and_put_task
friend

Definition at line 667 of file flow_graph.h.

◆ tbb::flow::interface11::limiter_node

template<typename U , typename V >
friend class tbb::flow::interface11::limiter_node
friend

Definition at line 695 of file flow_graph.h.

Member Data Documentation

◆ input_type

__TBB_DEPRECATED typedef continue_msg tbb::flow::interface11::continue_receiver::input_type

The input type.

Definition at line 602 of file flow_graph.h.

◆ my_current_count

int tbb::flow::interface11::continue_receiver::my_current_count
protected

Definition at line 690 of file flow_graph.h.

Referenced by continue_receiver(), reset_receiver(), and try_put_task().

◆ my_initial_predecessor_count

int tbb::flow::interface11::continue_receiver::my_initial_predecessor_count
protected

Definition at line 691 of file flow_graph.h.

Referenced by continue_receiver(), and reset_receiver().

◆ my_mutex

spin_mutex tbb::flow::interface11::continue_receiver::my_mutex
protected

Definition at line 688 of file flow_graph.h.

Referenced by register_predecessor(), remove_predecessor(), and try_put_task().

◆ my_predecessor_count

int tbb::flow::interface11::continue_receiver::my_predecessor_count
protected

◆ predecessor_type

__TBB_DEPRECATED typedef receiver<input_type>::predecessor_type tbb::flow::interface11::continue_receiver::predecessor_type

The predecessor type for this node.

Definition at line 605 of file flow_graph.h.


The documentation for this class was generated from the following file:
__TBB_FLOW_GRAPH_PRIORITY_EXPR
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)
Definition: _flow_graph_impl.h:38
tbb::flow::interface11::continue_receiver::my_current_count
int my_current_count
Definition: flow_graph.h:690
tbb::flow::internal::SUCCESSFULLY_ENQUEUED
static tbb::task *const SUCCESSFULLY_ENQUEUED
Definition: _flow_graph_impl.h:61
tbb::spin_mutex::scoped_lock
friend class scoped_lock
Definition: spin_mutex.h:179
tbb::flow::interface11::continue_receiver::my_initial_predecessor_count
int my_initial_predecessor_count
Definition: flow_graph.h:691
task
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
Definition: ittnotify_static.h:119
tbb::flow::interface11::rf_clear_edges
@ rf_clear_edges
Definition: _flow_graph_impl.h:161
tbb::flow::interface11::continue_receiver::my_predecessor_count
int my_predecessor_count
Definition: flow_graph.h:689
tbb::flow::interface11::continue_receiver::my_mutex
spin_mutex my_mutex
Definition: flow_graph.h:688
tbb::flow::interface11::continue_receiver::execute
virtual task * execute()=0
Does whatever should happen when the threshold is reached.

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.