Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Forwards messages only if the threshold has not been reached. More...
#include <flow_graph.h>
Public Types | |
typedef T | input_type |
typedef T | output_type |
typedef receiver< input_type >::predecessor_type | predecessor_type |
typedef sender< output_type >::successor_type | successor_type |
![]() | |
typedef untyped_sender | predecessor_type |
The predecessor type for this node. More... | |
![]() | |
typedef untyped_receiver | successor_type |
The successor type for this node. More... | |
Public Member Functions | |
limiter_node (graph &g, __TBB_DEPRECATED_LIMITER_ARG2(size_t threshold, int num_decrement_predecessors=0)) | |
Constructor. More... | |
limiter_node (const limiter_node &src) | |
Copy constructor. More... | |
bool | register_successor (successor_type &r) __TBB_override |
Replace the current successor with this new successor. More... | |
bool | remove_successor (successor_type &r) __TBB_override |
Removes a successor from this node. More... | |
bool | register_predecessor (predecessor_type &src) __TBB_override |
Adds src to the list of cached predecessors. More... | |
bool | remove_predecessor (predecessor_type &src) __TBB_override |
Removes src from the list of cached predecessors. More... | |
![]() | |
graph_node (graph &g) | |
virtual | ~graph_node () |
![]() | |
bool | try_put (const typename internal::async_helpers< T >::filtered_type &t) |
Put an item to the receiver. More... | |
bool | try_put (const typename internal::async_helpers< T >::async_type &t) |
![]() | |
virtual | ~untyped_receiver () |
Destructor. More... | |
template<typename X > | |
bool | try_put (const X &t) |
Put an item to the receiver. More... | |
![]() | |
virtual bool | try_get (T &) |
Request an item from the sender. More... | |
virtual bool | try_reserve (T &) |
Reserves an item in the sender. More... | |
![]() | |
virtual | ~untyped_sender () |
virtual bool | try_release () |
Releases the reserved item. More... | |
virtual bool | try_consume () |
Consumes the reserved item. More... | |
Public Attributes | |
internal::decrementer< limiter_node< T, DecrementType >, DecrementType > | decrement |
The internal receiver< DecrementType > that decrements the count. More... | |
![]() | |
__TBB_DEPRECATED typedef T | input_type |
The input type of this receiver. More... | |
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type | filtered_type |
![]() | |
__TBB_DEPRECATED typedef T | output_type |
The output type of this sender. More... | |
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type | filtered_type |
Protected Member Functions | |
task * | try_put_task (const T &t) __TBB_override |
Puts an item to this receiver. More... | |
graph & | graph_reference () const __TBB_override |
void | reset_receiver (reset_flags) __TBB_override |
put receiver back in initial state More... | |
void | reset_node (reset_flags f) __TBB_override |
![]() | |
virtual task * | try_put_task_wrapper (const void *p, bool is_async) __TBB_override |
![]() | |
template<typename X > | |
task * | try_put_task (const X &t) |
virtual bool | is_continue_receiver () |
![]() | |
virtual bool | try_get_wrapper (void *p, bool is_async) __TBB_override |
virtual bool | try_reserve_wrapper (void *p, bool is_async) __TBB_override |
![]() | |
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... | |
Private Member Functions | |
bool | check_conditions () |
task * | forward_task () |
void | forward () |
task * | decrement_counter (long long delta) |
void | initialize () |
Private Attributes | |
size_t | my_threshold |
size_t | my_count |
size_t | my_tries |
internal::reservable_predecessor_cache< T, spin_mutex > | my_predecessors |
spin_mutex | my_mutex |
internal::broadcast_cache< T > | my_successors |
Friends | |
class | internal::forward_task_bypass< limiter_node< T, DecrementType > > |
class | internal::decrementer< limiter_node< T, DecrementType >, DecrementType > |
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 |
Additional Inherited Members | |
![]() | |
graph & | my_graph |
graph_node * | next |
graph_node * | prev |
Forwards messages only if the threshold has not been reached.
This node forwards items until its threshold is reached. It contains no buffering. If the downstream node rejects, the message is dropped.
Definition at line 113 of file flow_graph.h.
typedef T tbb::flow::interface11::limiter_node< T, DecrementType >::input_type |
Definition at line 2600 of file flow_graph.h.
typedef T tbb::flow::interface11::limiter_node< T, DecrementType >::output_type |
Definition at line 2601 of file flow_graph.h.
typedef receiver<input_type>::predecessor_type tbb::flow::interface11::limiter_node< T, DecrementType >::predecessor_type |
Definition at line 2602 of file flow_graph.h.
typedef sender<output_type>::successor_type tbb::flow::interface11::limiter_node< T, DecrementType >::successor_type |
Definition at line 2603 of file flow_graph.h.
|
inline |
Constructor.
Definition at line 2723 of file flow_graph.h.
|
inline |
Copy constructor.
Definition at line 2742 of file flow_graph.h.
References __TBB_override, and tbb::internal::fgt_node_desc().
|
inlineprivate |
Definition at line 2626 of file flow_graph.h.
References tbb::flow::interface11::internal::node_cache< untyped_sender, M >::empty(), and tbb::flow::interface11::internal::successor_cache< T, M >::empty().
|
inlineprivate |
Definition at line 2689 of file flow_graph.h.
References lock.
|
inlineprivate |
Definition at line 2684 of file flow_graph.h.
References __TBB_ASSERT.
|
inlineprivate |
Definition at line 2631 of file flow_graph.h.
References __TBB_ASSERT, tbb::flow::interface11::internal::function_output< Output >::graph_reference(), tbb::flow::interface11::internal::is_graph_active(), lock, tbb::flow::interface11::internal::spawn_in_graph_arena(), tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::try_consume(), tbb::flow::interface11::internal::broadcast_cache< T, M >::try_put_task(), tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::try_release(), and tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::try_reserve().
|
inlineprotectedvirtual |
Implements tbb::flow::interface11::internal::untyped_receiver.
Definition at line 2873 of file flow_graph.h.
|
inlineprivate |
Definition at line 2702 of file flow_graph.h.
References CODEPTR, tbb::internal::fgt_node(), tbb::flow::interface11::internal::predecessor_cache< T, M >::set_owner(), and tbb::flow::interface11::internal::successor_cache< T, M >::set_owner().
|
inlinevirtual |
Adds src to the list of cached predecessors.
Reimplemented from tbb::flow::interface11::internal::untyped_receiver.
Definition at line 2823 of file flow_graph.h.
References tbb::flow::interface11::internal::node_cache< untyped_sender, M >::add(), tbb::flow::interface11::internal::successor_cache< T, M >::empty(), tbb::flow::interface11::internal::function_output< Output >::graph_reference(), tbb::flow::interface11::internal::is_graph_active(), lock, and tbb::flow::interface11::internal::spawn_in_graph_arena().
|
inlinevirtual |
Replace the current successor with this new successor.
Implements tbb::flow::interface11::internal::untyped_sender.
Definition at line 2759 of file flow_graph.h.
References tbb::flow::interface11::internal::node_cache< untyped_sender, M >::empty(), tbb::flow::interface11::internal::successor_cache< T, M >::empty(), tbb::flow::interface11::internal::function_output< Output >::graph_reference(), tbb::flow::interface11::internal::is_graph_active(), lock, tbb::flow::interface11::internal::successor_cache< T, M >::register_successor(), and tbb::flow::interface11::internal::spawn_in_graph_arena().
|
inlinevirtual |
Removes src from the list of cached predecessors.
Reimplemented from tbb::flow::interface11::internal::untyped_receiver.
Definition at line 2835 of file flow_graph.h.
References tbb::flow::interface11::internal::node_cache< untyped_sender, M >::remove().
|
inlinevirtual |
Removes a successor from this node.
r.remove_predecessor(*this) is also called.
Implements tbb::flow::interface11::internal::untyped_sender.
Definition at line 2776 of file flow_graph.h.
References __TBB_override, and tbb::flow::interface11::internal::successor_cache< T, M >::remove_successor().
|
inlineprotectedvirtual |
Implements tbb::flow::interface11::graph_node.
Definition at line 2879 of file flow_graph.h.
References tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::clear(), tbb::flow::interface11::internal::successor_cache< T, M >::clear(), tbb::flow::interface11::internal::input_port(), and tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::reset().
|
inlineprotectedvirtual |
put receiver back in initial state
Implements tbb::flow::interface11::internal::untyped_receiver.
Definition at line 2875 of file flow_graph.h.
References __TBB_ASSERT.
|
inlineprotectedvirtual |
Puts an item to this receiver.
Implements tbb::flow::interface11::receiver< T >.
Definition at line 2846 of file flow_graph.h.
References tbb::flow::interface11::internal::is_graph_active(), lock, and tbb::flow::interface11::internal::broadcast_cache< T, M >::try_put_task().
|
friend |
Definition at line 2843 of file flow_graph.h.
|
friend |
Definition at line 2624 of file flow_graph.h.
|
friend |
Definition at line 2621 of file flow_graph.h.
|
friend |
Definition at line 2844 of file flow_graph.h.
|
friend |
Definition at line 2842 of file flow_graph.h.
internal::decrementer< limiter_node<T, DecrementType>, DecrementType > tbb::flow::interface11::limiter_node< T, DecrementType >::decrement |
The internal receiver< DecrementType > that decrements the count.
Definition at line 2714 of file flow_graph.h.
|
private |
Definition at line 2614 of file flow_graph.h.
|
private |
Definition at line 2617 of file flow_graph.h.
|
private |
Definition at line 2616 of file flow_graph.h.
|
private |
Definition at line 2618 of file flow_graph.h.
|
private |
Definition at line 2613 of file flow_graph.h.
|
private |
Definition at line 2615 of file flow_graph.h.