Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator > Class Template Reference

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >:
Collaboration diagram for tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >:

Classes

struct  DoCleanup
 

Public Types

typedef ValueType 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 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< Key >::type Knoref
 

Public Member Functions

 hash_buffer ()
 
 ~hash_buffer ()
 
void reset ()
 
void set_key_func (ValueToKey *vtk)
 
ValueToKey * 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)
 

Static Public Attributes

static const size_t INITIAL_SIZE = 8
 

Private Member Functions

size_t mask ()
 
void set_up_free_list (element_type **p_free_list, list_array_type la, size_t sz)
 
void grow_array ()
 
void internal_insert_with_key (element_type **p_pointer_array, size_t p_sz, list_array_type &p_free_list, const value_type &v)
 
void internal_initialize_buffer ()
 

Static Private Member Functions

static void internal_free_buffer (pointer_array_type &pa, list_array_type &el, size_t &sz, size_t &ne)
 

Private Attributes

ValueToKey * my_key
 
size_t my_size
 
size_t nelements
 
pointer_array_type pointer_array
 
list_array_type elements_array
 
element_typefree_list
 

Detailed Description

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
class tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >

Definition at line 49 of file flow_graph.h.

Member Typedef Documentation

◆ element_type

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef buffer_element_type< value_type >::type tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::element_type

Definition at line 53 of file flow_graph.h.

◆ elements_array_allocator

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef Allocator::template rebind<element_type>::other tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::elements_array_allocator

Definition at line 58 of file flow_graph.h.

◆ Knoref

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef tbb::internal::strip<Key>::type tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::Knoref

Definition at line 59 of file flow_graph.h.

◆ list_array_type

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef element_type* tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::list_array_type

Definition at line 55 of file flow_graph.h.

◆ pointer_array_allocator_type

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef Allocator::template rebind<list_array_type>::other tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::pointer_array_allocator_type

Definition at line 57 of file flow_graph.h.

◆ pointer_array_type

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef list_array_type* tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::pointer_array_type

Definition at line 56 of file flow_graph.h.

◆ pointer_type

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef value_type* tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::pointer_type

Definition at line 54 of file flow_graph.h.

◆ value_type

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
typedef ValueType tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::value_type

Definition at line 52 of file flow_graph.h.

Constructor & Destructor Documentation

◆ hash_buffer()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::hash_buffer ( )
inline

Definition at line 173 of file flow_graph.h.

186  {

◆ ~hash_buffer()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::~hash_buffer ( )
inline

Definition at line 177 of file flow_graph.h.

186  {

Member Function Documentation

◆ delete_with_key()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::delete_with_key ( const Knoref k)
inline

Definition at line 231 of file flow_graph.h.

233  {
234  return *static_cast<T*>(p);
235  }
236 
237  static task* try_put_task_wrapper_impl(receiver<T>* const this_recv, const void *p, bool is_async) {
238  if (is_async) {
239  // This (T) is NOT async and incoming 'A<X> t' IS async
240  // Get data from async_msg
241  const async_msg<filtered_type>& msg = async_helpers< async_msg<filtered_type> >::from_void_ptr(p);
242  task* const new_task = msg.my_storage->subscribe(*this_recv, this_recv->graph_reference());
243  // finalize() must be called after subscribe() because set() can be called in finalize()
244  // and 'this_recv' client must be subscribed by this moment
245  msg.finalize();
246  return new_task;
247  }
248  else {
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
virtual void finalize() const
async_storage_ptr my_storage
void const char const char int ITT_FORMAT __itt_group_sync p

◆ find_ref_with_key()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
bool tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::find_ref_with_key ( const Knoref k,
pointer_type v 
)
inline

Definition at line 208 of file flow_graph.h.

210  {
211 
212 template < typename T > class async_storage;
213 
214 template< typename T, typename = void >
215 struct async_helpers {
216  typedef async_msg<T> async_type;
217  typedef T filtered_type;
218 
219  static const bool is_async_type = false;

◆ find_with_key()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
bool tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::find_with_key ( const Knoref k,
value_type v 
)
inline

Definition at line 221 of file flow_graph.h.

221  {
222  return static_cast<const void*>(&t);
223  }
224 
225  static void* to_void_ptr(T& t) {
226  return static_cast<void*>(&t);
227  }
228 
229  static const T& from_void_ptr(const void* p) {
void const char const char int ITT_FORMAT __itt_group_sync p

◆ get_key_func()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
ValueToKey* tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::get_key_func ( )
inline

Definition at line 191 of file flow_graph.h.

191 {

◆ grow_array()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::grow_array ( )
inlineprivate

Definition at line 96 of file flow_graph.h.

98  { unlimited = 0, serial = 1 };
99 
100 namespace interface11 {
101 
103 struct null_type {};
104 
106 class continue_msg {};
107 
109 template< typename T > class sender;
110 template< typename T > class receiver;
111 class continue_receiver;
112 
113 template< typename T, typename U > class limiter_node; // needed for resetting decrementer
114 
115 template< typename R, typename B > class run_and_put_task;
116 
117 namespace internal {
118 
119 template<typename T, typename M> class successor_cache;
120 template<typename T, typename M> class broadcast_cache;
121 template<typename T, typename M> class round_robin_cache;
122 template<typename T, typename M> class predecessor_cache;
123 template<typename T, typename M> class reservable_predecessor_cache;
124 
125 #if __TBB_PREVIEW_FLOW_GRAPH_NODE_SET
126 namespace order {

◆ insert_with_key()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
bool tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::insert_with_key ( const value_type v)
inline

Definition at line 193 of file flow_graph.h.

198  {
199  // both are valid tasks
201  return right;
202  }
203  return left;
204 }
205 
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.

◆ internal_free_buffer()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
static void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::internal_free_buffer ( pointer_array_type pa,
list_array_type el,
size_t &  sz,
size_t &  ne 
)
inlinestaticprivate

Definition at line 150 of file flow_graph.h.

155  {
156  v = built_edges;
157  }
158 
159  size_t edge_count() {
160  return (size_t)(built_edges.size());
161  }
162 
163  void clear() {
164  built_edges.clear();
165  }
166 
167  // methods remove the statement from all predecessors/successors liste in the edge
168  // container.
169  template< typename S > void sender_extract(S &s);
170  template< typename R > void receiver_extract(R &r);
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 __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type size_t void ITT_FORMAT p const __itt_domain __itt_id __itt_string_handle const wchar_t size_t ITT_FORMAT lu const __itt_domain __itt_id __itt_relation __itt_id ITT_FORMAT p const wchar_t int ITT_FORMAT __itt_group_mark S
void const char const char int ITT_FORMAT __itt_group_sync s

◆ internal_initialize_buffer()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::internal_initialize_buffer ( )
inlineprivate

Definition at line 142 of file flow_graph.h.

142  {
143  built_edges.push_back(&s);
144  }
145 
146  void delete_edge(C &s) {
147  for (typename edge_list_type::iterator i = built_edges.begin(); i != built_edges.end(); ++i) {
void const char const char int ITT_FORMAT __itt_group_sync s

◆ internal_insert_with_key()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::internal_insert_with_key ( element_type **  p_pointer_array,
size_t  p_sz,
list_array_type p_free_list,
const value_type v 
)
inlineprivate

Definition at line 130 of file flow_graph.h.

137  {
138 
139 public:
140  typedef std::list<C *, tbb::tbb_allocator<C *> > edge_list_type;

◆ mask()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
size_t tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::mask ( )
inlineprivate

Definition at line 69 of file flow_graph.h.

69 {

◆ reset()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::reset ( )
inline

Definition at line 182 of file flow_graph.h.

186  {

◆ set_key_func()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::set_key_func ( ValueToKey *  vtk)
inline

Definition at line 189 of file flow_graph.h.

◆ set_up_free_list()

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
void tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::set_up_free_list ( element_type **  p_free_list,
list_array_type  la,
size_t  sz 
)
inlineprivate

Definition at line 71 of file flow_graph.h.

94  {

Member Data Documentation

◆ elements_array

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
list_array_type tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::elements_array
private

Definition at line 66 of file flow_graph.h.

◆ free_list

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
element_type* tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::free_list
private

Definition at line 67 of file flow_graph.h.

◆ INITIAL_SIZE

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
const size_t tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::INITIAL_SIZE = 8
static

Definition at line 51 of file flow_graph.h.

◆ my_key

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
ValueToKey* tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::my_key
private

Definition at line 62 of file flow_graph.h.

◆ my_size

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
size_t tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::my_size
private

Definition at line 63 of file flow_graph.h.

◆ nelements

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
size_t tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::nelements
private

Definition at line 64 of file flow_graph.h.

◆ pointer_array

template<typename Key, typename ValueType, typename ValueToKey, typename HashCompare, typename Allocator = tbb::cache_aligned_allocator< typename aligned_pair<ValueType, void *>::type >>
pointer_array_type tbb::flow::interface11::internal::hash_buffer< Key, ValueType, ValueToKey, HashCompare, Allocator >::pointer_array
private

Definition at line 65 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.