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

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

#include <flow_graph.h>

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

Public Types

typedef continue_msg input_type
 The input type. More...
 
typedef receiver< input_type >::predecessor_type predecessor_type
 The predecessor type for this node. More...
 
- Public Types inherited from tbb::flow::interface10::receiver< continue_msg >
typedef continue_msg input_type
 The input type of this receiver. More...
 
typedef internal::async_helpers< continue_msg >::filtered_type filtered_type
 
- Public Types inherited from tbb::flow::interface10::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 

Public Member Functions

 continue_receiver (__TBB_FLOW_GRAPH_PRIORITY_ARG1(int number_of_predecessors, node_priority_t priority))
 Constructor. More...
 
 continue_receiver (const continue_receiver &src)
 Copy constructor. More...
 
bool register_predecessor (predecessor_type &) __TBB_override
 Increments the trigger threshold. More...
 
bool remove_predecessor (predecessor_type &) __TBB_override
 Decrements the trigger threshold. More...
 
- Public Member Functions inherited from tbb::flow::interface10::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::interface10::internal::untyped_receiver
virtual ~untyped_receiver ()
 Destructor. More...
 
template<typename X >
bool try_put (const X &t)
 Put an item to the receiver. More...
 

Protected Member Functions

tasktry_put_task (const input_type &) __TBB_override
 Put item to successor; return task to run the successor if possible. More...
 
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::interface10::receiver< continue_msg >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual graphgraph_reference ()=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 >
class 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 569 of file flow_graph.h.

Member Typedef Documentation

◆ input_type

The input type.

Definition at line 573 of file flow_graph.h.

◆ predecessor_type

The predecessor type for this node.

Definition at line 576 of file flow_graph.h.

Constructor & Destructor Documentation

◆ continue_receiver() [1/2]

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

Constructor.

Definition at line 579 of file flow_graph.h.

580  {
581  my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
582  my_current_count = 0;
583  __TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = priority; )
584  }
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)

◆ continue_receiver() [2/2]

tbb::flow::interface10::continue_receiver::continue_receiver ( const continue_receiver src)
inline

Copy constructor.

Definition at line 587 of file flow_graph.h.

587  : receiver<continue_msg>() {
588  my_predecessor_count = my_initial_predecessor_count = src.my_initial_predecessor_count;
589  my_current_count = 0;
590  __TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = src.my_priority; )
591  }
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)

References my_current_count, my_initial_predecessor_count, and my_predecessor_count.

Member Function Documentation

◆ execute()

virtual task* tbb::flow::interface10::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::interface10::internal::continue_input< Output, Policy >, tbb::flow::interface10::internal::decrementer< T >, and tbb::flow::interface10::internal::decrementer< tbb::flow::interface10::limiter_node< T > >.

◆ is_continue_receiver()

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

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

Definition at line 683 of file flow_graph.h.

683 { return true; }

◆ register_predecessor()

bool tbb::flow::interface10::continue_receiver::register_predecessor ( predecessor_type )
inlinevirtual

Increments the trigger threshold.

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

Definition at line 594 of file flow_graph.h.

594  {
597  return true;
598  }
friend class scoped_lock
Definition: spin_mutex.h:176

◆ remove_predecessor()

bool tbb::flow::interface10::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::interface10::internal::untyped_receiver.

Definition at line 604 of file flow_graph.h.

604  {
607  return true;
608  }
friend class scoped_lock
Definition: spin_mutex.h:176

◆ reset_receiver()

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

put receiver back in initial state

Implements tbb::flow::interface10::internal::untyped_receiver.

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

Definition at line 668 of file flow_graph.h.

668  {
669  my_current_count = 0;
670  if (f & rf_clear_edges) {
671 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
672  my_built_predecessors.clear();
673 #endif
675  }
676  }

◆ try_put_task()

task* tbb::flow::interface10::continue_receiver::try_put_task ( const input_type t)
inlineprotectedvirtual

Put item to successor; return task to run the successor if possible.

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

Definition at line 642 of file flow_graph.h.

642  {
643  {
646  return SUCCESSFULLY_ENQUEUED;
647  else
648  my_current_count = 0;
649  }
650  task * res = execute();
651  return res? res : SUCCESSFULLY_ENQUEUED;
652  }
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
static tbb::task *const SUCCESSFULLY_ENQUEUED
virtual task * execute()=0
Does whatever should happen when the threshold is reached.
friend class scoped_lock
Definition: spin_mutex.h:176

Friends And Related Function Documentation

◆ internal::broadcast_cache

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

Definition at line 639 of file flow_graph.h.

◆ internal::round_robin_cache

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

Definition at line 640 of file flow_graph.h.

◆ internal::successor_cache

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

Definition at line 682 of file flow_graph.h.

◆ limiter_node

template<typename U >
friend class limiter_node
friend

Definition at line 666 of file flow_graph.h.

◆ run_and_put_task

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

Definition at line 638 of file flow_graph.h.

Member Data Documentation

◆ my_current_count

int tbb::flow::interface10::continue_receiver::my_current_count
protected

Definition at line 661 of file flow_graph.h.

Referenced by continue_receiver().

◆ my_initial_predecessor_count

int tbb::flow::interface10::continue_receiver::my_initial_predecessor_count
protected

Definition at line 662 of file flow_graph.h.

Referenced by continue_receiver().

◆ my_mutex

spin_mutex tbb::flow::interface10::continue_receiver::my_mutex
protected

Definition at line 659 of file flow_graph.h.

◆ my_predecessor_count

int tbb::flow::interface10::continue_receiver::my_predecessor_count
protected

Definition at line 660 of file flow_graph.h.

Referenced by continue_receiver().


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.