internal::key_matching_port< TraitsType > Class Template Reference

`#include <_flow_graph_join_impl.h>`

Inheritance diagram for internal::key_matching_port< TraitsType >:
Collaboration diagram for internal::key_matching_port< TraitsType >:

## Classes

class | key_matching_port_operation

## Public Types

typedef TraitsType | traits
typedef key_matching_port< traits > | class_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_type > | buffer_type
Public Types inherited from 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_type * | pointer_type
typedef element_type * | list_array_type
typedef list_array_type * | pointer_array_type
typedef Allocator::template rebind< list_array_type >::other | pointer_array_allocator_type
typedef Allocator::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_type * | get_my_key_func ()
bool | get_item (input_type &v)
void | reset_port ()
void | reset_receiver (reset_flags f) __TBB_override
Public Member Functions inherited from 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

task * | try_put_task (const input_type &v) __TBB_override
graph & | graph_reference () const __TBB_override

## Private Types

enum | op_type { try__put , get__item , res_port }
typedef internal::aggregating_functor< class_type, key_matching_port_operation > | handler_type

## Private Member Functions

void | handle_operations (key_matching_port_operation *op_list)

## Private Attributes

aggregator< handler_type, key_matching_port_operation > | my_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 hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >
static const size_t | INITIAL_SIZE

## Detailed Description

### template<class TraitsType>
class internal::key_matching_port< TraitsType >

Definition at line 658 of file _flow_graph_join_impl.h.

## Member Typedef Documentation

## buffer_type

template<class TraitsType >

typedef hash_buffer< key_type, input_type, type_to_key_func_type, hash_compare_type > internal::key_matching_port< TraitsType >::buffer_type

Definition at line 671 of file _flow_graph_join_impl.h.

## class_type

template<class TraitsType >

typedef key_matching_port<traits> internal::key_matching_port< TraitsType >::class_type

Definition at line 664 of file _flow_graph_join_impl.h.

## handler_type

template<class TraitsType >

typedef internal::aggregating_functor<class_type, key_matching_port_operation> internal::key_matching_port< TraitsType >::handler_type

private

Definition at line 705 of file _flow_graph_join_impl.h.

## hash_compare_type

template<class TraitsType >

typedef TraitsType::KHash internal::key_matching_port< TraitsType >::hash_compare_type

Definition at line 670 of file _flow_graph_join_impl.h.

## input_type

template<class TraitsType >

typedef TraitsType::T internal::key_matching_port< TraitsType >::input_type

Definition at line 665 of file _flow_graph_join_impl.h.

## key_type

template<class TraitsType >

typedef TraitsType::K internal::key_matching_port< TraitsType >::key_type

Definition at line 666 of file _flow_graph_join_impl.h.

## noref_key_type

template<class TraitsType >

typedef tbb::internal::strip<key_type>::type internal::key_matching_port< TraitsType >::noref_key_type

Definition at line 667 of file _flow_graph_join_impl.h.

## predecessor_type

template<class TraitsType >

typedef receiver<input_type>::predecessor_type internal::key_matching_port< TraitsType >::predecessor_type

Definition at line 668 of file _flow_graph_join_impl.h.

## traits

template<class TraitsType >

typedef TraitsType internal::key_matching_port< TraitsType >::traits

Definition at line 663 of file _flow_graph_join_impl.h.

## type_to_key_func_type

template<class TraitsType >

typedef TraitsType::TtoK internal::key_matching_port< TraitsType >::type_to_key_func_type

Definition at line 669 of file _flow_graph_join_impl.h.

## Member Enumeration Documentation

## op_type

template<class TraitsType >

enum internal::key_matching_port::op_type

private

Enumerator
try__put |
get__item |
res_port |

Definition at line 679 of file _flow_graph_join_impl.h.

{ try__put, get__item, res_port
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
, add_blt_pred, del_blt_pred, blt_pred_cnt, blt_pred_cpy
#endif
};
internal::key_matching_port::get__item
@ get__item
Definition: _flow_graph_join_impl.h:679
internal::key_matching_port::res_port
@ res_port
Definition: _flow_graph_join_impl.h:679
internal::key_matching_port::try__put
@ try__put
Definition: _flow_graph_join_impl.h:679

## Constructor & Destructor Documentation

## key_matching_port() [1/2]

template<class TraitsType >

internal::key_matching_port< TraitsType >::key_matching_port | ( |  | ) |

inline

Definition at line 777 of file _flow_graph_join_impl.h.

: receiver<input_type>(), buffer_type() {
my_join = NULL;
my_aggregator.initialize_handler(handler_type(this));
}
internal::key_matching_port::my_join
matching_forwarding_base< key_type > * my_join
Definition: _flow_graph_join_impl.h:859
internal::key_matching_port::my_aggregator
aggregator< handler_type, key_matching_port_operation > my_aggregator
Definition: _flow_graph_join_impl.h:707
internal::key_matching_port::handler_type
internal::aggregating_functor< class_type, key_matching_port_operation > handler_type
Definition: _flow_graph_join_impl.h:705
internal::key_matching_port::buffer_type
hash_buffer< key_type, input_type, type_to_key_func_type, hash_compare_type > buffer_type
Definition: _flow_graph_join_impl.h:671

References internal::key_matching_port< TraitsType >::my_aggregator, and internal::key_matching_port< TraitsType >::my_join.

## key_matching_port() [2/2]

template<class TraitsType >

internal::key_matching_port< TraitsType >::key_matching_port | ( | const key_matching_port< TraitsType > & |  | ) |

inline

Definition at line 783 of file _flow_graph_join_impl.h.

: receiver<input_type>(), buffer_type() {
my_join = NULL;
my_aggregator.initialize_handler(handler_type(this));
}

References internal::key_matching_port< TraitsType >::my_aggregator, and internal::key_matching_port< TraitsType >::my_join.

## ~key_matching_port()

template<class TraitsType >

internal::key_matching_port< TraitsType >::~key_matching_port | ( |  | ) |

inline

Definition at line 788 of file _flow_graph_join_impl.h.

{ }

## Member Function Documentation

## get_item()

template<class TraitsType >

bool internal::key_matching_port< TraitsType >::get_item | ( | input_type & | v | ) |

inline

Definition at line 798 of file _flow_graph_join_impl.h.

{
// aggregator uses current_key from FE for Key
key_matching_port_operation op_data(&v, get__item);
my_aggregator.execute(&op_data);
return op_data.status == SUCCEEDED;
}
internal::SUCCEEDED
@ SUCCEEDED
Definition: _flow_graph_types_impl.h:719

References internal::key_matching_port< TraitsType >::get__item, internal::key_matching_port< TraitsType >::my_aggregator, tbb::interface6::internal::aggregated_operation< Derived >::status, and internal::SUCCEEDED.

## get_my_key_func()

template<class TraitsType >

type_to_key_func_type* internal::key_matching_port< TraitsType >::get_my_key_func | ( |  | ) |

inline

Definition at line 796 of file _flow_graph_join_impl.h.

{ return this->get_key_func(); }
hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::get_key_func
TraitsType::TtoK * get_key_func()
Definition: _flow_graph_tagged_buffer_impl.h:190

References hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::get_key_func().

Here is the call graph for this function:

## graph_reference()

template<class TraitsType >

graph& internal::key_matching_port< TraitsType >::graph_reference | ( |  | ) | const

inline protected

Definition at line 771 of file _flow_graph_join_impl.h.

{
return my_join->graph_ref;
}
internal::forwarding_base::graph_ref
graph & graph_ref
Definition: _flow_graph_join_impl.h:34

References internal::forwarding_base::graph_ref, and internal::key_matching_port< TraitsType >::my_join.

## handle_operations()

template<class TraitsType >

void internal::key_matching_port< TraitsType >::handle_operations | ( | key_matching_port_operation * | op_list | ) |

inline private

Definition at line 709 of file _flow_graph_join_impl.h.

{
key_matching_port_operation *current;
while(op_list) {
current = op_list;
op_list = op_list->next;
switch(current->type) {
case try__put: {
bool was_inserted = this->insert_with_key(current->my_val);
// return failure if a duplicate insertion occurs
__TBB_store_with_release(current->status, was_inserted ? SUCCEEDED : FAILED);
}
break;
case get__item:
// use current_key from FE for item
if(!this->find_with_key(my_join->current_key, *(current->my_arg))) {
__TBB_ASSERT(false, "Failed to find item corresponding to current_key.");
}
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case res_port:
// use current_key from FE for item
this->delete_with_key(my_join->current_key);
__TBB_store_with_release(current->status, SUCCEEDED);
break;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
case add_blt_pred:
my_built_predecessors.add_edge(*(current->pred));
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case del_blt_pred:
my_built_predecessors.delete_edge(*(current->pred));
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case blt_pred_cnt:
current->cnt_val = my_built_predecessors.edge_count();
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case blt_pred_cpy:
my_built_predecessors.copy_edges(*(current->plist));
__TBB_store_with_release(current->status, SUCCEEDED);
break;
#endif
}
}
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::internal::__TBB_store_with_release
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:716
internal::FAILED
@ FAILED
Definition: _flow_graph_types_impl.h:719
internal::matching_forwarding_base::current_key
current_key_type current_key
Definition: _flow_graph_join_impl.h:44
hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::delete_with_key
void delete_with_key(const Knoref &k)
Definition: _flow_graph_tagged_buffer_impl.h:230
hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::find_with_key
bool find_with_key(const Knoref &k, value_type &v)
Definition: _flow_graph_tagged_buffer_impl.h:220
hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::insert_with_key
bool insert_with_key(const value_type &v)
Definition: _flow_graph_tagged_buffer_impl.h:192

References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), internal::matching_forwarding_base< KeyType >::current_key, hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::delete_with_key(), internal::FAILED, hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::find_with_key(), internal::key_matching_port< TraitsType >::get__item, hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::insert_with_key(), internal::key_matching_port< TraitsType >::key_matching_port_operation::my_arg, internal::key_matching_port< TraitsType >::my_join, internal::key_matching_port< TraitsType >::key_matching_port_operation::my_val, tbb::interface6::internal::aggregated_operation< Derived >::next, internal::key_matching_port< TraitsType >::res_port, tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, internal::key_matching_port< TraitsType >::try__put, and internal::key_matching_port< TraitsType >::key_matching_port_operation::type.

Here is the call graph for this function:

## reset_port()

template<class TraitsType >

void internal::key_matching_port< TraitsType >::reset_port | ( |  | ) |

inline

Definition at line 835 of file _flow_graph_join_impl.h.

{
key_matching_port_operation op_data(res_port);
my_aggregator.execute(&op_data);
return;
}

References internal::key_matching_port< TraitsType >::my_aggregator, and internal::key_matching_port< TraitsType >::res_port.

## reset_receiver()

template<class TraitsType >

void internal::key_matching_port< TraitsType >::reset_receiver | ( | reset_flags | f | ) |

inline

Definition at line 847 of file _flow_graph_join_impl.h.

{
tbb::internal::suppress_unused_warning(f);
buffer_type::reset();
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
if (f & rf_clear_edges)
my_built_predecessors.clear();
#endif
}
tbb::internal::suppress_unused_warning
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
Definition: tbb_stddef.h:398
tbb::flow::interface11::rf_clear_edges
@ rf_clear_edges
Definition: _flow_graph_impl.h:161
hash_buffer::reset
void reset()
Definition: _flow_graph_tagged_buffer_impl.h:181

References hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::reset(), tbb::flow::interface11::rf_clear_edges, and tbb::internal::suppress_unused_warning().

Here is the call graph for this function:

## set_join_node_pointer()

template<class TraitsType >

void internal::key_matching_port< TraitsType >::set_join_node_pointer | ( | forwarding_base * | join | ) |

inline

Definition at line 790 of file _flow_graph_join_impl.h.

{
my_join = dynamic_cast<matching_forwarding_base<key_type>*>(join);
}

References internal::key_matching_port< TraitsType >::my_join.

## set_my_key_func()

template<class TraitsType >

void internal::key_matching_port< TraitsType >::set_my_key_func | ( | type_to_key_func_type * | f | ) |

inline

Definition at line 794 of file _flow_graph_join_impl.h.

{ this->set_key_func(f); }
hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::set_key_func
void set_key_func(TraitsType::TtoK *vtk)
Definition: _flow_graph_tagged_buffer_impl.h:188

References hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::set_key_func().

Here is the call graph for this function:

## try_put_task()

template<class TraitsType >

task* internal::key_matching_port< TraitsType >::try_put_task | ( | const input_type & | v | ) |

inline protected

Definition at line 759 of file _flow_graph_join_impl.h.

{
key_matching_port_operation op_data(v, try__put);
task *rtask = NULL;
my_aggregator.execute(&op_data);
if(op_data.status == SUCCEEDED) {
rtask = my_join->increment_key_count((*(this->get_key_func()))(v), false); // may spawn
// rtask has to reflect the return status of the try_put
if(!rtask) rtask = SUCCESSFULLY_ENQUEUED;
}
return rtask;
}
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
internal::matching_forwarding_base::increment_key_count
virtual task * increment_key_count(current_key_type const &, bool)=0

References hash_buffer< TraitsType::K, TraitsType::T, TraitsType::TtoK, TraitsType::KHash >::get_key_func(), internal::matching_forwarding_base< KeyType >::increment_key_count(), internal::key_matching_port< TraitsType >::my_aggregator, internal::key_matching_port< TraitsType >::my_join, tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, task, and internal::key_matching_port< TraitsType >::try__put.

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 705 of file _flow_graph_join_impl.h.

## internal::broadcast_cache

template<class TraitsType >
template<typename X , typename Y >

friend class internal::broadcast_cache

friend

Definition at line 757 of file _flow_graph_join_impl.h.

## internal::round_robin_cache

template<class TraitsType >
template<typename X , typename Y >

friend class internal::round_robin_cache

friend

Definition at line 758 of file _flow_graph_join_impl.h.

## run_and_put_task

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

friend class run_and_put_task

friend

Definition at line 756 of file _flow_graph_join_impl.h.

## Member Data Documentation

## my_aggregator

template<class TraitsType >

aggregator<handler_type, key_matching_port_operation> internal::key_matching_port< TraitsType >::my_aggregator

private

Definition at line 707 of file _flow_graph_join_impl.h.

Referenced by internal::key_matching_port< TraitsType >::get_item(), internal::key_matching_port< TraitsType >::key_matching_port(), internal::key_matching_port< TraitsType >::reset_port(), and internal::key_matching_port< TraitsType >::try_put_task().

## my_join

template<class TraitsType >

matching_forwarding_base<key_type>* internal::key_matching_port< TraitsType >::my_join

private

Definition at line 859 of file _flow_graph_join_impl.h.

Referenced by internal::key_matching_port< TraitsType >::graph_reference(), internal::key_matching_port< TraitsType >::handle_operations(), internal::key_matching_port< TraitsType >::key_matching_port(), internal::key_matching_port< TraitsType >::set_join_node_pointer(), and internal::key_matching_port< TraitsType >::try_put_task().

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

- _flow_graph_join_impl.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.