Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::internal::reservable_predecessor_cache< T, M > Class Template Reference

An cache of predecessors that supports requests and reservations. More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >:
Collaboration diagram for tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >:

Public Types

typedef M mutex_type
 
typedef T output_type
 
typedef untyped_sender predecessor_type
 
typedef untyped_receiver successor_type
 
- Public Types inherited from tbb::flow::interface11::internal::predecessor_cache< T, M >
typedef M mutex_type
 
typedef T output_type
 
typedef untyped_sender predecessor_type
 
typedef untyped_receiver successor_type
 
- Public Types inherited from tbb::flow::interface11::internal::node_cache< untyped_sender, M >
typedef size_t size_type
 

Public Member Functions

 reservable_predecessor_cache ()
 
bool try_reserve (output_type &v)
 
bool try_release ()
 
bool try_consume ()
 
void reset ()
 
void clear ()
 
- Public Member Functions inherited from tbb::flow::interface11::internal::predecessor_cache< T, M >
 predecessor_cache ()
 
void set_owner (successor_type *owner)
 
bool get_item (output_type &v)
 
void reset ()
 
- Public Member Functions inherited from tbb::flow::interface11::internal::node_cache< untyped_sender, M >
bool empty ()
 
void add (untyped_sender &n)
 
void remove (untyped_sender &n)
 
void clear ()
 

Private Attributes

predecessor_typereserved_src
 

Additional Inherited Members

- Protected Types inherited from tbb::flow::interface11::internal::node_cache< untyped_sender, M >
typedef M mutex_type
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::node_cache< untyped_sender, M >
bool internal_empty ()
 
size_type internal_size ()
 
void internal_push (untyped_sender &n)
 
untyped_senderinternal_pop ()
 
- Protected Attributes inherited from tbb::flow::interface11::internal::predecessor_cache< T, M >
successor_typemy_owner
 
- Protected Attributes inherited from tbb::flow::interface11::internal::node_cache< untyped_sender, M >
mutex_type my_mutex
 
std::queue< untyped_sender * > my_q
 

Detailed Description

template<typename T, typename M = spin_mutex>
class tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >

An cache of predecessors that supports requests and reservations.

Definition at line 123 of file flow_graph.h.

Member Typedef Documentation

◆ mutex_type

template<typename T, typename M = spin_mutex>
typedef M tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::mutex_type

Definition at line 200 of file flow_graph.h.

◆ output_type

template<typename T, typename M = spin_mutex>
typedef T tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::output_type

Definition at line 201 of file flow_graph.h.

◆ predecessor_type

template<typename T, typename M = spin_mutex>
typedef untyped_sender tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::predecessor_type

Definition at line 203 of file flow_graph.h.

◆ successor_type

template<typename T, typename M = spin_mutex>
typedef untyped_receiver tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::successor_type

Definition at line 204 of file flow_graph.h.

Constructor & Destructor Documentation

◆ reservable_predecessor_cache()

template<typename T, typename M = spin_mutex>
tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::reservable_predecessor_cache ( )
inline

Definition at line 210 of file flow_graph.h.

210 {

Member Function Documentation

◆ clear()

template<typename T, typename M = spin_mutex>
void tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::clear ( )
inline

Definition at line 261 of file flow_graph.h.

Referenced by tbb::flow::interface11::limiter_node< T, DecrementType >::reset_node().

263  {
264  return static_cast<const void*>(&static_cast<const async_msg<filtered_type>&>(t));
Here is the caller graph for this function:

◆ reset()

template<typename T, typename M = spin_mutex>
void tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::reset ( )
inline

Definition at line 256 of file flow_graph.h.

Referenced by tbb::flow::interface11::limiter_node< T, DecrementType >::reset_node().

256  {
257  typedef T async_type;
258  typedef typename T::async_msg_data_type filtered_type;
259 
Here is the caller graph for this function:

◆ try_consume()

template<typename T, typename M = spin_mutex>
bool tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::try_consume ( )
inline

Definition at line 250 of file flow_graph.h.

Referenced by tbb::flow::interface11::limiter_node< T, DecrementType >::forward_task().

Here is the caller graph for this function:

◆ try_release()

template<typename T, typename M = spin_mutex>
bool tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::try_release ( )
inline

Definition at line 243 of file flow_graph.h.

Referenced by tbb::flow::interface11::limiter_node< T, DecrementType >::forward_task().

248  {
Here is the caller graph for this function:

◆ try_reserve()

template<typename T, typename M = spin_mutex>
bool tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::try_reserve ( output_type v)
inline

Definition at line 213 of file flow_graph.h.

Referenced by tbb::flow::interface11::limiter_node< T, DecrementType >::forward_task().

215  {
216  typedef async_msg<T> async_type;
217  typedef T filtered_type;
218 
219  static const bool is_async_type = false;
220 
221  static const void* to_void_ptr(const T& t) {
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) {
230  return *static_cast<const T*>(p);
231  }
232 
233  static T& from_void_ptr(void* p) {
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
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
void const char const char int ITT_FORMAT __itt_group_sync p
Here is the caller graph for this function:

Member Data Documentation

◆ reserved_src

template<typename T, typename M = spin_mutex>
predecessor_type* tbb::flow::interface11::internal::reservable_predecessor_cache< T, M >::reserved_src
private

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