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

task * | try_put_task (const input_type &) __TBB_override
void | reset_receiver (reset_flags f) __TBB_override
| put receiver back in initial state More...
virtual task * | execute ()=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 task * | try_put_task_wrapper (const void *p, bool is_async) __TBB_override
virtual task * | try_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 >
task * | try_put_task (const X &t)
virtual graph & | graph_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) |  | ) |

inline explicit

Constructor.

Definition at line 609 of file flow_graph.h.

{
my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
my_current_count = 0;
__TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = priority; )
}
__TBB_FLOW_GRAPH_PRIORITY_EXPR
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)
Definition: _flow_graph_impl.h:38
tbb::flow::interface11::continue_receiver::my_initial_predecessor_count
int my_initial_predecessor_count
Definition: flow_graph.h:692
tbb::flow::interface11::continue_receiver::my_current_count
int my_current_count
Definition: flow_graph.h:691
tbb::flow::interface11::continue_receiver::my_predecessor_count
int my_predecessor_count
Definition: flow_graph.h:690

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

: receiver<continue_msg>() {
my_predecessor_count = my_initial_predecessor_count = src.my_initial_predecessor_count;
my_current_count = 0;
__TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = src.my_priority; )
}

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

protected pure 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 | ( |  | ) |

inline protected virtual

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

Definition at line 713 of file flow_graph.h.

{ return true; }

## register_predecessor()

__TBB_DEPRECATED bool tbb::flow::interface11::continue_receiver::register_predecessor | ( | predecessor_type & |  | ) |

inline virtual

Increments the trigger threshold.

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

Definition at line 624 of file flow_graph.h.

{
spin_mutex::scoped_lock l(my_mutex);
++my_predecessor_count;
return true;
}
tbb::flow::interface11::continue_receiver::my_mutex
spin_mutex my_mutex
Definition: flow_graph.h:689
tbb::spin_mutex::scoped_lock
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 & |  | ) |

inline virtual

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.

{
spin_mutex::scoped_lock l(my_mutex);
--my_predecessor_count;
return true;
}

References my_mutex, and my_predecessor_count.

## reset_receiver()

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

inline protected virtual

put receiver back in initial state

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

Definition at line 698 of file flow_graph.h.

{
my_current_count = 0;
if (f & rf_clear_edges) {
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
my_built_predecessors.clear();
#endif
my_predecessor_count = my_initial_predecessor_count;
}
}
tbb::flow::interface11::rf_clear_edges
@ rf_clear_edges
Definition: _flow_graph_impl.h:161

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 & |  | ) |

inline protected

Definition at line 672 of file flow_graph.h.

{
{
spin_mutex::scoped_lock l(my_mutex);
if ( ++my_current_count < my_predecessor_count )
return SUCCESSFULLY_ENQUEUED;
else
my_current_count = 0;
}
task * res = execute();
return res? res : SUCCESSFULLY_ENQUEUED;
}
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::internal::SUCCESSFULLY_ENQUEUED
static tbb::task *const SUCCESSFULLY_ENQUEUED
Definition: _flow_graph_impl.h:61
tbb::flow::interface11::continue_receiver::execute
virtual task * execute()=0
Does whatever should happen when the threshold is reached.

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 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(), reset_receiver(), and try_put_task().

## 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(), and reset_receiver().

## my_mutex

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

protected

Definition at line 689 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

Definition at line 690 of file flow_graph.h.

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

## 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 606 of file flow_graph.h.

The documentation for this class was generated from the following file:

- flow_graph.h

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.