Home ⌂Doc Index ◂Up ▴
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 >
bool try_put (const typename internal::async_helpers< continue_msg >::filtered_type &t)
 Put an item to the receiver. More...
 
bool try_put (const typename internal::async_helpers< continue_msg >::async_type &t)
 
- Public Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
virtual ~untyped_receiver ()
 Destructor. More...
 
template<typename X >
bool try_put (const X &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 internal::async_helpers< continue_msg >::filtered_type filtered_type
 

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_wrapper (const void *p, bool is_async) __TBB_override
 
virtual tasktry_put_task (const continue_msg &t)=0
 Put item to successor; return task to run the successor if possible. More...
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
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
 

Additional Inherited Members

- Public Types inherited from tbb::flow::interface11::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 

Detailed Description

Base class for receivers of completion messages.

These receivers automatically reset, but cannot be explicitly waited on

Definition at line 599 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 609 of file flow_graph.h.

610  {
611  my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
612  my_current_count = 0;
613  __TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = priority; )
614  }
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)

References 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 617 of file flow_graph.h.

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

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().

Implemented in tbb::flow::interface11::internal::continue_input< Output, Policy >, and tbb::flow::interface11::internal::decrementer< T, continue_msg, void >.

◆ is_continue_receiver()

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

Reimplemented from tbb::flow::interface11::internal::untyped_receiver.

Definition at line 713 of file flow_graph.h.

713 { 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::internal::untyped_receiver.

Definition at line 624 of file flow_graph.h.

624  {
627  return true;
628  }
friend class scoped_lock
Definition: spin_mutex.h:179

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::internal::untyped_receiver.

Definition at line 634 of file flow_graph.h.

634  {
637  return true;
638  }
friend class scoped_lock
Definition: spin_mutex.h:179

◆ reset_receiver()

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

put receiver back in initial state

Implements tbb::flow::interface11::internal::untyped_receiver.

Reimplemented in tbb::flow::interface11::internal::continue_input< Output, Policy >.

Definition at line 698 of file flow_graph.h.

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

◆ try_put_task()

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

Definition at line 672 of file flow_graph.h.

672  {
673  {
676  return SUCCESSFULLY_ENQUEUED;
677  else
678  my_current_count = 0;
679  }
680  task * res = execute();
681  return res? res : SUCCESSFULLY_ENQUEUED;
682  }
virtual task * execute()=0
Does whatever should happen when the threshold is reached.
static tbb::task *const SUCCESSFULLY_ENQUEUED
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
friend class scoped_lock
Definition: spin_mutex.h:179

References my_mutex.

Friends And Related Function Documentation

◆ internal::broadcast_cache

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

Definition at line 669 of file flow_graph.h.

◆ internal::round_robin_cache

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

Definition at line 670 of file flow_graph.h.

◆ internal::successor_cache

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

Definition at line 712 of file flow_graph.h.

◆ run_and_put_task

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

Definition at line 668 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 696 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 603 of file flow_graph.h.

◆ my_current_count

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

Definition at line 691 of file flow_graph.h.

Referenced by continue_receiver().

◆ my_initial_predecessor_count

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

Definition at line 692 of file flow_graph.h.

Referenced by continue_receiver().

◆ my_mutex

◆ my_predecessor_count

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

Definition at line 690 of file flow_graph.h.

Referenced by continue_receiver(), and register_predecessor().

◆ predecessor_type


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.