Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
internal::successor_cache< continue_msg > 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 >:
Collaboration diagram for internal::successor_cache< continue_msg >:

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 spin_rw_mutex 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 ()
 Allow default construction. More...
 

Detailed Description

template<>
class internal::successor_cache< continue_msg >

An abstract cache of successors, specialized to continue_msg.

Definition at line 369 of file _flow_graph_cache_impl.h.

Member Typedef Documentation

◆ mutex_type

typedef spin_rw_mutex internal::successor_cache< continue_msg >::mutex_type
protected

Definition at line 372 of file _flow_graph_cache_impl.h.

◆ pointer_type

typedef receiver<continue_msg>* internal::successor_cache< continue_msg >::pointer_type
protected

Definition at line 380 of file _flow_graph_cache_impl.h.

◆ successor_type

typedef receiver<continue_msg> internal::successor_cache< continue_msg >::successor_type
protected

Definition at line 379 of file _flow_graph_cache_impl.h.

◆ successors_type

typedef std::list< pointer_type > internal::successor_cache< continue_msg >::successors_type
protected

Definition at line 382 of file _flow_graph_cache_impl.h.

Constructor & Destructor Documentation

◆ successor_cache()

internal::successor_cache< continue_msg >::successor_cache ( )
inline

Definition at line 419 of file _flow_graph_cache_impl.h.

419 : my_owner(NULL) {}

◆ ~successor_cache()

virtual internal::successor_cache< continue_msg >::~successor_cache ( )
inlinevirtual

Definition at line 423 of file _flow_graph_cache_impl.h.

423 {}

Member Function Documentation

◆ clear()

void internal::successor_cache< continue_msg >::clear ( )
inline

Definition at line 453 of file _flow_graph_cache_impl.h.

453  {
454  my_successors.clear();
455 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
456  my_built_successors.clear();
457 #endif
458  }

◆ empty()

bool internal::successor_cache< continue_msg >::empty ( )
inline

Definition at line 448 of file _flow_graph_cache_impl.h.

448  {
449  mutex_type::scoped_lock l(my_mutex, false);
450  return my_successors.empty();
451  }

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

◆ register_successor()

void internal::successor_cache< continue_msg >::register_successor ( successor_type r)
inline

Definition at line 425 of file _flow_graph_cache_impl.h.

425  {
426  mutex_type::scoped_lock l(my_mutex, true);
427  my_successors.push_back( &r );
428  if ( my_owner && r.is_continue_receiver() ) {
429  r.register_predecessor( *my_owner );
430  }
431  }

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

◆ remove_successor()

void internal::successor_cache< continue_msg >::remove_successor ( successor_type r)
inline

Definition at line 433 of file _flow_graph_cache_impl.h.

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

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

◆ set_owner()

void internal::successor_cache< continue_msg >::set_owner ( sender< continue_msg > *  owner)
inline

Definition at line 421 of file _flow_graph_cache_impl.h.

421 { my_owner = owner; }

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

◆ try_put_task()

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

Member Data Documentation

◆ my_mutex

mutex_type internal::successor_cache< continue_msg >::my_mutex
protected

Definition at line 373 of file _flow_graph_cache_impl.h.

◆ my_owner

sender<continue_msg>* internal::successor_cache< continue_msg >::my_owner
protected

Definition at line 389 of file _flow_graph_cache_impl.h.

◆ my_successors

successors_type internal::successor_cache< continue_msg >::my_successors
protected

Definition at line 383 of file _flow_graph_cache_impl.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.