Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface10::internal::key_matching_port< TraitsType > Class Template Reference

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface10::internal::key_matching_port< TraitsType >:
Collaboration diagram for tbb::flow::interface10::internal::key_matching_port< TraitsType >:

Classes

class  key_matching_port_operation
 

Public Types

typedef TraitsType traits
 
typedef key_matching_port< traitsclass_type
 
typedef TraitsType::T input_type
 
typedef TraitsType::K key_type
 
typedef tbb::internal::strip< key_type >::type noref_key_type
 
typedef receiver< input_type >::predecessor_type predecessor_type
 
typedef TraitsType::TtoK type_to_key_func_type
 
typedef TraitsType::KHash hash_compare_type
 
typedef hash_buffer< key_type, input_type, type_to_key_func_type, hash_compare_typebuffer_type
 
- Public Types inherited from tbb::flow::interface10::receiver< TraitsType::T >
typedef TraitsType::T input_type
 The input type of this receiver. More...
 
typedef internal::async_helpers< TraitsType::T >::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 Types inherited from tbb::flow::interface10::internal::hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >
typedef TraitsType::T value_type
 
typedef buffer_element_type< value_type >::type element_type
 
typedef value_typepointer_type
 
typedef element_typelist_array_type
 
typedef list_array_typepointer_array_type
 
typedef tbb::cache_aligned_allocator< typename aligned_pair< TraitsType::T, void * >::type > ::template rebind< list_array_type >::other pointer_array_allocator_type
 
typedef tbb::cache_aligned_allocator< typename aligned_pair< TraitsType::T, void * >::type > ::template rebind< element_type >::other elements_array_allocator
 
typedef tbb::internal::strip< TraitsType::K >::type Knoref
 

Public Member Functions

 key_matching_port ()
 
 key_matching_port (const key_matching_port &)
 
 ~key_matching_port ()
 
void set_join_node_pointer (forwarding_base *join)
 
void set_my_key_func (type_to_key_func_type *f)
 
type_to_key_func_typeget_my_key_func ()
 
bool get_item (input_type &v)
 
void reset_port ()
 
void reset_receiver (reset_flags f) __TBB_override
 put receiver back in initial state More...
 
- Public Member Functions inherited from tbb::flow::interface10::receiver< TraitsType::T >
bool try_put (const typename internal::async_helpers< TraitsType::T >::filtered_type &t)
 Put an item to the receiver. More...
 
bool try_put (const typename internal::async_helpers< TraitsType::T >::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...
 
virtual bool register_predecessor (predecessor_type &)
 Add a predecessor to the node. More...
 
virtual bool remove_predecessor (predecessor_type &)
 Remove a predecessor from the node. More...
 
- Public Member Functions inherited from tbb::flow::interface10::internal::hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >
 hash_buffer ()
 
 ~hash_buffer ()
 
void reset ()
 
void set_key_func (TraitsType::TtoK *vtk)
 
TraitsType::TtoK * get_key_func ()
 
bool insert_with_key (const value_type &v)
 
bool find_ref_with_key (const Knoref &k, pointer_type &v)
 
bool find_with_key (const Knoref &k, value_type &v)
 
void delete_with_key (const Knoref &k)
 

Protected Member Functions

tasktry_put_task (const input_type &v) __TBB_override
 Put item to successor; return task to run the successor if possible. More...
 
graphgraph_reference () __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::receiver< TraitsType::T >
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 bool is_continue_receiver ()
 

Private Types

enum  op_type { try__put, get__item, res_port }
 
enum  op_stat { WAIT =0, SUCCEEDED, FAILED }
 
typedef internal::aggregating_functor< class_type, key_matching_port_operationhandler_type
 

Private Member Functions

void handle_operations (key_matching_port_operation *op_list)
 

Private Attributes

aggregator< handler_type, key_matching_port_operationmy_aggregator
 
matching_forwarding_base< key_type > * my_join
 

Friends

class internal::aggregating_functor< class_type, key_matching_port_operation >
 
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

- Static Public Attributes inherited from tbb::flow::interface10::internal::hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >
static const size_t INITIAL_SIZE
 

Detailed Description

template<class TraitsType>
class tbb::flow::interface10::internal::key_matching_port< TraitsType >

Definition at line 652 of file flow_graph.h.

Member Typedef Documentation

◆ buffer_type

◆ class_type

template<class TraitsType >
typedef key_matching_port<traits> tbb::flow::interface10::internal::key_matching_port< TraitsType >::class_type

Definition at line 658 of file flow_graph.h.

◆ handler_type

template<class TraitsType >
typedef internal::aggregating_functor<class_type, key_matching_port_operation> tbb::flow::interface10::internal::key_matching_port< TraitsType >::handler_type
private

Definition at line 700 of file flow_graph.h.

◆ hash_compare_type

template<class TraitsType >
typedef TraitsType::KHash tbb::flow::interface10::internal::key_matching_port< TraitsType >::hash_compare_type

Definition at line 664 of file flow_graph.h.

◆ input_type

template<class TraitsType >
typedef TraitsType::T tbb::flow::interface10::internal::key_matching_port< TraitsType >::input_type

Definition at line 659 of file flow_graph.h.

◆ key_type

template<class TraitsType >
typedef TraitsType::K tbb::flow::interface10::internal::key_matching_port< TraitsType >::key_type

Definition at line 660 of file flow_graph.h.

◆ noref_key_type

Definition at line 661 of file flow_graph.h.

◆ predecessor_type

Definition at line 662 of file flow_graph.h.

◆ traits

template<class TraitsType >
typedef TraitsType tbb::flow::interface10::internal::key_matching_port< TraitsType >::traits

Definition at line 657 of file flow_graph.h.

◆ type_to_key_func_type

template<class TraitsType >
typedef TraitsType::TtoK tbb::flow::interface10::internal::key_matching_port< TraitsType >::type_to_key_func_type

Definition at line 663 of file flow_graph.h.

Member Enumeration Documentation

◆ op_stat

template<class TraitsType >
enum tbb::flow::interface10::internal::key_matching_port::op_stat
private
Enumerator
WAIT 
SUCCEEDED 
FAILED 

Definition at line 678 of file flow_graph.h.

◆ op_type

template<class TraitsType >
enum tbb::flow::interface10::internal::key_matching_port::op_type
private
Enumerator
try__put 
get__item 
res_port 

Definition at line 673 of file flow_graph.h.

Constructor & Destructor Documentation

◆ key_matching_port() [1/2]

template<class TraitsType >
tbb::flow::interface10::internal::key_matching_port< TraitsType >::key_matching_port ( )
inline

Definition at line 772 of file flow_graph.h.

772  {
773  my_root_task->increment_ref_count();
775  }
static void fgt_reserve_wait(void *)

References tbb::internal::fgt_reserve_wait(), tbb::task::increment_ref_count(), and tbb::flow::interface10::graph::my_root_task.

Here is the call graph for this function:

◆ key_matching_port() [2/2]

template<class TraitsType >
tbb::flow::interface10::internal::key_matching_port< TraitsType >::key_matching_port ( const key_matching_port< TraitsType > &  )
inline

Definition at line 778 of file flow_graph.h.

778  {
779  if (my_root_task) {
781  my_root_task->decrement_ref_count();
static void fgt_release_wait(void *)

◆ ~key_matching_port()

template<class TraitsType >
tbb::flow::interface10::internal::key_matching_port< TraitsType >::~key_matching_port ( )
inline

Definition at line 783 of file flow_graph.h.

Member Function Documentation

◆ get_item()

template<class TraitsType >
bool tbb::flow::interface10::internal::key_matching_port< TraitsType >::get_item ( input_type v)
inline

Definition at line 793 of file flow_graph.h.

796  {
797  {
798  spin_mutex::scoped_lock lock(nodelist_mutex);
friend class scoped_lock
Definition: spin_mutex.h:176
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 __itt_model_task_instance ITT_FORMAT p void * lock

◆ get_my_key_func()

template<class TraitsType >
type_to_key_func_type* tbb::flow::interface10::internal::key_matching_port< TraitsType >::get_my_key_func ( )
inline

Definition at line 791 of file flow_graph.h.

◆ graph_reference()

template<class TraitsType >
graph& tbb::flow::interface10::internal::key_matching_port< TraitsType >::graph_reference ( )
inlineprotectedvirtual

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

Definition at line 766 of file flow_graph.h.

◆ handle_operations()

template<class TraitsType >
void tbb::flow::interface10::internal::key_matching_port< TraitsType >::handle_operations ( key_matching_port_operation op_list)
inlineprivate

Definition at line 704 of file flow_graph.h.

705  {
706 namespace flow {
707 namespace interface10 {
708 
712 #if __TBB_PREVIEW_ASYNC_MSG
714 #endif
715 using namespace internal::graph_policy_namespace;
716 
717 template <typename C, typename N>
718 graph_iterator<C,N>::graph_iterator(C *g, bool begin) : my_graph(g), current_node(NULL)
719 {
720  if (begin) current_node = my_graph->my_nodes;
721  //else it is an end iterator by default
722 }
723 
724 template <typename C, typename N>
725 typename graph_iterator<C,N>::reference graph_iterator<C,N>::operator*() const {
726  __TBB_ASSERT(current_node, "graph_iterator at end");
727  return *operator->();
728 }
729 
730 template <typename C, typename N>
731 typename graph_iterator<C,N>::pointer graph_iterator<C,N>::operator->() const {
732  return current_node;
733 }
734 
735 template <typename C, typename N>
736 void graph_iterator<C,N>::internal_forward() {
737  if (current_node) current_node = current_node->next;
738 }
739 
741 inline graph::graph() : my_nodes(NULL), my_nodes_last(NULL), my_task_arena(NULL) {
742  prepare_task_arena();
743  own_context = true;
744  cancelled = false;
745  caught_exception = false;
746  my_context = new task_group_context(tbb::internal::FLOW_TASKS);
747  my_root_task = (new (task::allocate_root(*my_context)) empty_task);
748  my_root_task->set_ref_count(1);
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
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 __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp begin

◆ reset_port()

template<class TraitsType >
void tbb::flow::interface10::internal::key_matching_port< TraitsType >::reset_port ( )
inline

Definition at line 830 of file flow_graph.h.

831  { return iterator(this, true); }
832 
833 inline graph::iterator graph::end() { return iterator(this, false); }
834 
iterator end()
end iterator
Definition: flow_graph.h:833
graph_iterator< graph, graph_node > iterator

◆ reset_receiver()

template<class TraitsType >
void tbb::flow::interface10::internal::key_matching_port< TraitsType >::reset_receiver ( reset_flags  f)
inlinevirtual

put receiver back in initial state

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

Definition at line 842 of file flow_graph.h.

844  {
846 }
847 #endif
848 
849 inline graph_node::graph_node(graph& g) : my_graph(g) {
static void fgt_graph_desc(void *, const char *)
void const char const char int ITT_FORMAT __itt_group_sync x void const char * name

◆ set_join_node_pointer()

template<class TraitsType >
void tbb::flow::interface10::internal::key_matching_port< TraitsType >::set_join_node_pointer ( forwarding_base join)
inline

Definition at line 785 of file flow_graph.h.

785  {
786  n->next = NULL;
787  {

References lock, tbb::flow::interface10::graph_node::next, and tbb::flow::interface10::graph::nodelist_mutex.

◆ set_my_key_func()

template<class TraitsType >
void tbb::flow::interface10::internal::key_matching_port< TraitsType >::set_my_key_func ( type_to_key_func_type f)
inline

Definition at line 789 of file flow_graph.h.

◆ try_put_task()

template<class TraitsType >
task* tbb::flow::interface10::internal::key_matching_port< TraitsType >::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< TraitsType::T >.

Definition at line 754 of file flow_graph.h.

754  {
755  prepare_task_arena();
756  own_context = false;
757  my_root_task = (new (task::allocate_root(*my_context)) empty_task);
758  my_root_task->set_ref_count(1);
760  my_is_active = true;
761 }
762 
763 inline graph::~graph() {
764  wait_for_all();
~graph()
Destroys the graph.
Definition: flow_graph.h:763
static void fgt_graph(void *)
static internal::allocate_root_proxy allocate_root()
Returns proxy for overloaded new that allocates a root task.
Definition: task.h:633

References tbb::task::allocate_root(), and tbb::internal::fgt_graph().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ internal::aggregating_functor< class_type, key_matching_port_operation >

template<class TraitsType >
friend class internal::aggregating_functor< class_type, key_matching_port_operation >
friend

Definition at line 701 of file flow_graph.h.

◆ internal::broadcast_cache

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

Definition at line 752 of file flow_graph.h.

◆ internal::round_robin_cache

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

Definition at line 753 of file flow_graph.h.

◆ run_and_put_task

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

Definition at line 751 of file flow_graph.h.

Member Data Documentation

◆ my_aggregator

template<class TraitsType >
aggregator<handler_type, key_matching_port_operation> tbb::flow::interface10::internal::key_matching_port< TraitsType >::my_aggregator
private

Definition at line 702 of file flow_graph.h.

◆ my_join

template<class TraitsType >
matching_forwarding_base<key_type>* tbb::flow::interface10::internal::key_matching_port< TraitsType >::my_join
private

Definition at line 854 of file flow_graph.h.


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.