Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
internal::successor_cache< T, M > Class Template Referenceabstract

An abstract cache of successors. More...

#include <_flow_graph_cache_impl.h>

Inheritance diagram for internal::successor_cache< T, M >:
Collaboration diagram for internal::successor_cache< T, M >:

Public Member Functions

 successor_cache ()
 
void set_owner (owner_type *owner)
 
virtual ~successor_cache ()
 
void register_successor (successor_type &r)
 
void remove_successor (successor_type &r)
 
bool empty ()
 
void clear ()
 
virtual tasktry_put_task (const T &t)=0
 

Protected Types

typedef M mutex_type
 
typedef receiver< T > successor_type
 
typedef receiver< T > * pointer_type
 
typedef sender< T > owner_type
 
typedef std::list< pointer_typesuccessors_type
 

Protected Attributes

mutex_type my_mutex
 
successors_type my_successors
 
owner_typemy_owner
 

Additional Inherited Members

- Private Member Functions inherited from tbb::internal::no_copy
 no_copy ()
 Allow default construction. More...
 

Detailed Description

template<typename T, typename M = spin_rw_mutex>
class internal::successor_cache< T, M >

An abstract cache of successors.

Definition at line 277 of file _flow_graph_cache_impl.h.

Member Typedef Documentation

◆ mutex_type

template<typename T, typename M = spin_rw_mutex>
typedef M internal::successor_cache< T, M >::mutex_type
protected

Definition at line 280 of file _flow_graph_cache_impl.h.

◆ owner_type

template<typename T, typename M = spin_rw_mutex>
typedef sender<T> internal::successor_cache< T, M >::owner_type
protected

Definition at line 290 of file _flow_graph_cache_impl.h.

◆ pointer_type

template<typename T, typename M = spin_rw_mutex>
typedef receiver<T>* internal::successor_cache< T, M >::pointer_type
protected

Definition at line 289 of file _flow_graph_cache_impl.h.

◆ successor_type

template<typename T, typename M = spin_rw_mutex>
typedef receiver<T> internal::successor_cache< T, M >::successor_type
protected

Definition at line 288 of file _flow_graph_cache_impl.h.

◆ successors_type

template<typename T, typename M = spin_rw_mutex>
typedef std::list< pointer_type > internal::successor_cache< T, M >::successors_type
protected

Definition at line 292 of file _flow_graph_cache_impl.h.

Constructor & Destructor Documentation

◆ successor_cache()

template<typename T, typename M = spin_rw_mutex>
internal::successor_cache< T, M >::successor_cache ( )
inline

Definition at line 328 of file _flow_graph_cache_impl.h.

328 : my_owner(NULL) {}

◆ ~successor_cache()

template<typename T, typename M = spin_rw_mutex>
virtual internal::successor_cache< T, M >::~successor_cache ( )
inlinevirtual

Definition at line 332 of file _flow_graph_cache_impl.h.

332 {}

Member Function Documentation

◆ clear()

template<typename T, typename M = spin_rw_mutex>
void internal::successor_cache< T, M >::clear ( )
inline

Definition at line 355 of file _flow_graph_cache_impl.h.

355  {
356  my_successors.clear();
357 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
358  my_built_successors.clear();
359 #endif
360  }

Referenced by internal::indexer_node_base< InputTuple, OutputType, StructTypes >::reset_node().

Here is the caller graph for this function:

◆ empty()

template<typename T, typename M = spin_rw_mutex>
bool internal::successor_cache< T, M >::empty ( )
inline

Definition at line 350 of file _flow_graph_cache_impl.h.

350  {
351  typename mutex_type::scoped_lock l(my_mutex, false);
352  return my_successors.empty();
353  }

Referenced by tbb::flow::interface10::continue_node< Output, Policy >::reset_node().

Here is the caller graph for this function:

◆ register_successor()

template<typename T, typename M = spin_rw_mutex>
void internal::successor_cache< T, M >::register_successor ( successor_type r)
inline

Definition at line 334 of file _flow_graph_cache_impl.h.

334  {
335  typename mutex_type::scoped_lock l(my_mutex, true);
336  my_successors.push_back( &r );
337  }

Referenced by internal::indexer_node_base< InputTuple, OutputType, StructTypes >::handle_operations(), and internal::function_output< Output >::register_successor().

Here is the caller graph for this function:

◆ remove_successor()

template<typename T, typename M = spin_rw_mutex>
void internal::successor_cache< T, M >::remove_successor ( successor_type r)
inline

Definition at line 339 of file _flow_graph_cache_impl.h.

339  {
340  typename mutex_type::scoped_lock l(my_mutex, true);
341  for ( typename successors_type::iterator i = my_successors.begin();
342  i != my_successors.end(); ++i ) {
343  if ( *i == & r ) {
344  my_successors.erase(i);
345  break;
346  }
347  }
348  }

Referenced by internal::indexer_node_base< InputTuple, OutputType, StructTypes >::handle_operations(), and internal::function_output< Output >::remove_successor().

Here is the caller graph for this function:

◆ set_owner()

template<typename T, typename M = spin_rw_mutex>
void internal::successor_cache< T, M >::set_owner ( owner_type owner)
inline

◆ try_put_task()

template<typename T, typename M = spin_rw_mutex>
virtual task* internal::successor_cache< T, M >::try_put_task ( const T &  t)
pure virtual

Member Data Documentation

◆ my_mutex

template<typename T, typename M = spin_rw_mutex>
mutex_type internal::successor_cache< T, M >::my_mutex
protected

◆ my_owner

template<typename T, typename M = spin_rw_mutex>
owner_type* internal::successor_cache< T, M >::my_owner
protected

Definition at line 298 of file _flow_graph_cache_impl.h.

◆ my_successors

template<typename T, typename M = spin_rw_mutex>
successors_type internal::successor_cache< T, M >::my_successors
protected

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.