Home ⌂Doc Index ◂Up ▴
Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
internal::successor_cache< continue_msg, M > Class Template Referenceabstract

An abstract cache of successors, specialized to continue_msg. More...

#include <_flow_graph_cache_impl.h>

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

Public Member Functions

 successor_cache ()
 
void set_owner (sender< continue_msg > *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 continue_msg &t)=0
 

Protected Types

typedef M mutex_type
 
typedef receiver< continue_msg > successor_type
 
typedef receiver< continue_msg > * pointer_type
 
typedef std::list< pointer_typesuccessors_type
 

Protected Attributes

mutex_type my_mutex
 
successors_type my_successors
 
sender< continue_msg > * my_owner
 

Additional Inherited Members

- Private Member Functions inherited from tbb::internal::no_copy
 no_copy (const no_copy &)=delete
 
 no_copy ()=default
 

Detailed Description

template<typename M>
class internal::successor_cache< continue_msg, M >

An abstract cache of successors, specialized to continue_msg.

Definition at line 365 of file _flow_graph_cache_impl.h.

Member Typedef Documentation

◆ mutex_type

template<typename M >
typedef M internal::successor_cache< continue_msg, M >::mutex_type
protected

Definition at line 368 of file _flow_graph_cache_impl.h.

◆ pointer_type

template<typename M >
typedef receiver<continue_msg>* internal::successor_cache< continue_msg, M >::pointer_type
protected

Definition at line 376 of file _flow_graph_cache_impl.h.

◆ successor_type

template<typename M >
typedef receiver<continue_msg> internal::successor_cache< continue_msg, M >::successor_type
protected

Definition at line 375 of file _flow_graph_cache_impl.h.

◆ successors_type

template<typename M >
typedef std::list< pointer_type > internal::successor_cache< continue_msg, M >::successors_type
protected

Definition at line 378 of file _flow_graph_cache_impl.h.

Constructor & Destructor Documentation

◆ successor_cache()

template<typename M >
internal::successor_cache< continue_msg, M >::successor_cache ( )
inline

Definition at line 415 of file _flow_graph_cache_impl.h.

415 : my_owner(NULL) {}

◆ ~successor_cache()

template<typename M >
virtual internal::successor_cache< continue_msg, M >::~successor_cache ( )
inlinevirtual

Definition at line 419 of file _flow_graph_cache_impl.h.

419 {}

Member Function Documentation

◆ clear()

template<typename M >
void internal::successor_cache< continue_msg, M >::clear ( )
inline

Definition at line 449 of file _flow_graph_cache_impl.h.

449  {
450  my_successors.clear();
451 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
452  my_built_successors.clear();
453 #endif
454  }

◆ empty()

template<typename M >
bool internal::successor_cache< continue_msg, M >::empty ( )
inline

Definition at line 444 of file _flow_graph_cache_impl.h.

444  {
445  typename mutex_type::scoped_lock l(my_mutex, false);
446  return my_successors.empty();
447  }

References internal::node_cache< sender< T >, M >::my_mutex.

◆ register_successor()

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

Definition at line 421 of file _flow_graph_cache_impl.h.

421  {
422  typename mutex_type::scoped_lock l(my_mutex, true);
423  my_successors.push_back( &r );
424  if ( my_owner && r.is_continue_receiver() ) {
425  r.register_predecessor( *my_owner );
426  }
427  }

References internal::node_cache< sender< T >, M >::my_mutex, and internal::predecessor_cache< T, M >::my_owner.

◆ remove_successor()

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

Definition at line 429 of file _flow_graph_cache_impl.h.

429  {
430  typename mutex_type::scoped_lock l(my_mutex, true);
431  for ( successors_type::iterator i = my_successors.begin();
432  i != my_successors.end(); ++i ) {
433  if ( *i == & r ) {
434  // TODO: Check if we need to test for continue_receiver before
435  // removing from r.
436  if ( my_owner )
437  r.remove_predecessor( *my_owner );
438  my_successors.erase(i);
439  break;
440  }
441  }
442  }

References internal::node_cache< sender< T >, M >::my_mutex, and internal::predecessor_cache< T, M >::my_owner.

◆ set_owner()

template<typename M >
void internal::successor_cache< continue_msg, M >::set_owner ( sender< continue_msg > *  owner)
inline

Definition at line 417 of file _flow_graph_cache_impl.h.

417 { my_owner = owner; }

References internal::predecessor_cache< T, M >::my_owner.

◆ try_put_task()

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

Member Data Documentation

◆ my_mutex

template<typename M >
mutex_type internal::successor_cache< continue_msg, M >::my_mutex
protected

Definition at line 369 of file _flow_graph_cache_impl.h.

◆ my_owner

template<typename M >
sender<continue_msg>* internal::successor_cache< continue_msg, M >::my_owner
protected

Definition at line 385 of file _flow_graph_cache_impl.h.

◆ my_successors

template<typename M >
successors_type internal::successor_cache< continue_msg, M >::my_successors
protected

Definition at line 379 of file _flow_graph_cache_impl.h.


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

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.