Intel(R) Threading Building Blocks Doxygen Documentation version 4.2.3
Loading...
Searching...
No Matches
tbb::flow::interface11::broadcast_node< T > Class Template Reference

Forwards messages of type T to all successors. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::broadcast_node< T >:
Collaboration diagram for tbb::flow::interface11::broadcast_node< T >:

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
 
- Public Types inherited from tbb::flow::interface11::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node.
 
- Public Types inherited from tbb::flow::interface11::internal::untyped_sender
typedef untyped_receiver successor_type
 The successor type for this node.
 

Public Member Functions

__TBB_NOINLINE_SYM broadcast_node (graph &g)
 
__TBB_NOINLINE_SYM broadcast_node (const broadcast_node &src)
 
bool register_successor (successor_type &r) __TBB_override
 Adds a successor.
 
bool remove_successor (successor_type &r) __TBB_override
 Removes s as a successor.
 
- Public Member Functions inherited from tbb::flow::interface11::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface11::receiver< T >
bool try_put (const typename internal::async_helpers< T >::filtered_type &t)
 Put an item to the receiver.
 
bool try_put (const typename internal::async_helpers< T >::async_type &t)
 
- Public Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
virtual ~untyped_receiver ()
 Destructor.
 
template<typename X >
bool try_put (const X &t)
 Put an item to the receiver.
 
virtual bool register_predecessor (predecessor_type &)
 Add a predecessor to the node.
 
virtual bool remove_predecessor (predecessor_type &)
 Remove a predecessor from the node.
 
- Public Member Functions inherited from tbb::flow::interface11::sender< T >
virtual bool try_get (T &)
 Request an item from the sender.
 
virtual bool try_reserve (T &)
 Reserves an item in the sender.
 
- Public Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
virtual ~untyped_sender ()
 
virtual bool register_successor (successor_type &r)=0
 Add a new successor to this node.
 
virtual bool remove_successor (successor_type &r)=0
 Removes a successor from this node.
 
virtual bool try_release ()
 Releases the reserved item.
 
virtual bool try_consume ()
 Consumes the reserved item.
 

Protected Member Functions

tasktry_put_task (const T &t) __TBB_override
 build a task to run the successor if possible. Default is old behavior.
 
graphgraph_reference () const __TBB_override
 
void reset_receiver (reset_flags) __TBB_override
 put receiver back in initial state
 
void reset_node (reset_flags f) __TBB_override
 
virtual void reset_node (reset_flags f=rf_reset_protocol)=0
 
- Protected Member Functions inherited from tbb::flow::interface11::receiver< T >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
virtual tasktry_put_task (const T &t)=0
 Put item to successor; return task to run the successor if possible.
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual tasktry_put_task_wrapper (const void *p, bool is_async)=0
 
virtual graphgraph_reference () const =0
 
virtual void reset_receiver (reset_flags f=rf_reset_protocol)=0
 put receiver back in initial state
 
virtual bool is_continue_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface11::sender< T >
virtual bool try_get_wrapper (void *p, bool is_async) __TBB_override
 
virtual bool try_reserve_wrapper (void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
template<typename X >
bool try_get (X &t)
 Request an item from the sender.
 
template<typename X >
bool try_reserve (X &t)
 Reserves an item in the sender.
 
virtual bool try_get_wrapper (void *p, bool is_async)=0
 
virtual bool try_reserve_wrapper (void *p, bool is_async)=0
 

Private Attributes

internal::broadcast_cache< input_typemy_successors
 

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
 

Additional Inherited Members

- Public Attributes inherited from tbb::flow::interface11::receiver< T >
__TBB_DEPRECATED typedef T input_type
 The input type of this receiver.
 
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
 
- Public Attributes inherited from tbb::flow::interface11::sender< T >
__TBB_DEPRECATED typedef T output_type
 The output type of this sender.
 
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
 
- Protected Attributes inherited from tbb::flow::interface11::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 

Detailed Description

template<typename T>
class tbb::flow::interface11::broadcast_node< T >

Forwards messages of type T to all successors.

Definition at line 1905 of file flow_graph.h.

Member Typedef Documentation

◆ input_type

template<typename T >
typedef T tbb::flow::interface11::broadcast_node< T >::input_type

Definition at line 1907 of file flow_graph.h.

◆ output_type

template<typename T >
typedef T tbb::flow::interface11::broadcast_node< T >::output_type

Definition at line 1908 of file flow_graph.h.

◆ predecessor_type

template<typename T >
typedef receiver<input_type>::predecessor_type tbb::flow::interface11::broadcast_node< T >::predecessor_type

Definition at line 1909 of file flow_graph.h.

◆ successor_type

template<typename T >
typedef sender<output_type>::successor_type tbb::flow::interface11::broadcast_node< T >::successor_type

Definition at line 1910 of file flow_graph.h.

Constructor & Destructor Documentation

◆ broadcast_node() [1/2]

template<typename T >
__TBB_NOINLINE_SYM tbb::flow::interface11::broadcast_node< T >::broadcast_node ( graph g)
inlineexplicit

Definition at line 1923 of file flow_graph.h.

1923 : graph_node(g) {
1924 my_successors.set_owner( this );
1925 tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BROADCAST_NODE, &this->my_graph,
1926 static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
1927 }
#define CODEPTR()
static void fgt_node(void *, string_index, void *, void *)
internal::broadcast_cache< input_type > my_successors

References CODEPTR, tbb::internal::fgt_node(), tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::broadcast_node< T >::my_successors.

Here is the call graph for this function:

◆ broadcast_node() [2/2]

template<typename T >
__TBB_NOINLINE_SYM tbb::flow::interface11::broadcast_node< T >::broadcast_node ( const broadcast_node< T > &  src)
inline

Definition at line 1937 of file flow_graph.h.

1937 :
1938 graph_node(src.my_graph), receiver<T>(), sender<T>()
1939 {
1940 my_successors.set_owner( this );
1941 tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_BROADCAST_NODE, &this->my_graph,
1942 static_cast<receiver<input_type> *>(this), static_cast<sender<output_type> *>(this) );
1943 }

References CODEPTR, tbb::internal::fgt_node(), tbb::flow::interface11::graph_node::my_graph, and tbb::flow::interface11::broadcast_node< T >::my_successors.

Here is the call graph for this function:

Member Function Documentation

◆ graph_reference()

template<typename T >
graph & tbb::flow::interface11::broadcast_node< T >::graph_reference ( ) const
inlineprotectedvirtual

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

Definition at line 2025 of file flow_graph.h.

2025 {
2026 return my_graph;
2027 }

References tbb::flow::interface11::graph_node::my_graph.

◆ register_successor()

template<typename T >
bool tbb::flow::interface11::broadcast_node< T >::register_successor ( successor_type r)
inlinevirtual

Adds a successor.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 1952 of file flow_graph.h.

1952 {
1953 my_successors.register_successor( r );
1954 return true;
1955 }

References tbb::flow::interface11::broadcast_node< T >::my_successors.

◆ remove_successor()

template<typename T >
bool tbb::flow::interface11::broadcast_node< T >::remove_successor ( successor_type r)
inlinevirtual

Removes s as a successor.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 1958 of file flow_graph.h.

1958 {
1959 my_successors.remove_successor( r );
1960 return true;
1961 }

References tbb::flow::interface11::broadcast_node< T >::my_successors.

◆ reset_node()

template<typename T >
void tbb::flow::interface11::broadcast_node< T >::reset_node ( reset_flags  f)
inlineprotectedvirtual

Implements tbb::flow::interface11::graph_node.

Definition at line 2031 of file flow_graph.h.

2031 {
2032 if (f&rf_clear_edges) {
2033 my_successors.clear();
2034#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
2035 my_built_predecessors.clear();
2036#endif
2037 }
2038 __TBB_ASSERT(!(f & rf_clear_edges) || my_successors.empty(), "Error resetting broadcast_node");
2039 }
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition tbb_stddef.h:165

References __TBB_ASSERT, tbb::flow::interface11::broadcast_node< T >::my_successors, and tbb::flow::interface11::rf_clear_edges.

◆ reset_receiver()

template<typename T >
void tbb::flow::interface11::broadcast_node< T >::reset_receiver ( reset_flags  f)
inlineprotectedvirtual

put receiver back in initial state

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

Definition at line 2029 of file flow_graph.h.

2029{}

◆ try_put_task()

template<typename T >
task * tbb::flow::interface11::broadcast_node< T >::try_put_task ( const T &  t)
inlineprotectedvirtual

build a task to run the successor if possible. Default is old behavior.

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

Definition at line 2019 of file flow_graph.h.

2019 {
2020 task *new_task = my_successors.try_put_task(t);
2021 if (!new_task) new_task = SUCCESSFULLY_ENQUEUED;
2022 return new_task;
2023 }
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

References tbb::flow::interface11::broadcast_node< T >::my_successors.

Friends And Related Symbol Documentation

◆ internal::broadcast_cache

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

Definition at line 2016 of file flow_graph.h.

◆ internal::round_robin_cache

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

Definition at line 2017 of file flow_graph.h.

◆ run_and_put_task

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

Definition at line 2015 of file flow_graph.h.

Member Data Documentation

◆ my_successors


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.