Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
internal::queueing_port< T > Class Template Reference

queueing join_port More...

#include <_flow_graph_join_impl.h>

Inheritance diagram for internal::queueing_port< T >:
Collaboration diagram for internal::queueing_port< T >:

Classes

class  queueing_port_operation
 

Public Types

typedef T input_type
 
typedef receiver< input_type >::predecessor_type predecessor_type
 
typedef queueing_port< T > class_type
 
- Public Types inherited from internal::item_buffer< T, A >
enum  buffer_item_state { no_item =0, has_item =1, reserved_item =2 }
 
typedef T item_type
 

Public Member Functions

 queueing_port ()
 Constructor. More...
 
 queueing_port (const queueing_port &)
 copy constructor More...
 
void set_join_node_pointer (forwarding_base *join)
 record parent for tallying available items More...
 
bool get_item (T &v)
 
void reset_port ()
 
void reset_receiver (reset_flags f) __TBB_override
 
- Public Member Functions inherited from internal::item_buffer< T, A >
 item_buffer ()
 Constructor. More...
 
 ~item_buffer ()
 
void reset ()
 

Protected Member Functions

tasktry_put_task (const T &v) __TBB_override
 
graph & graph_reference () __TBB_override
 
- Protected Member Functions inherited from internal::item_buffer< T, A >
bool buffer_empty () const
 
buffer_item_typeitem (size_type i)
 
const buffer_item_typeitem (size_type i) const
 
bool my_item_valid (size_type i) const
 
bool my_item_reserved (size_type i) const
 
const item_typeget_my_item (size_t i) const
 
void set_my_item (size_t i, const item_type &o)
 
void fetch_item (size_t i, item_type &o)
 
void move_item (size_t to, size_t from)
 
bool place_item (size_t here, const item_type &me)
 
void swap_items (size_t i, size_t j)
 
void destroy_item (size_type i)
 
const item_typefront () const
 
const item_typeback () const
 
void reserve_item (size_type i)
 
void release_item (size_type i)
 
void destroy_front ()
 
void destroy_back ()
 
size_type size (size_t new_tail=0)
 
size_type capacity ()
 
bool buffer_full ()
 
void grow_my_array (size_t minimum_size)
 Grows the internal array. More...
 
bool push_back (item_type &v)
 
bool pop_back (item_type &v)
 
bool pop_front (item_type &v)
 
void clean_up_buffer (bool reset_pointers)
 

Private Types

enum  op_type { get__item, res_port, try__put_task }
 
typedef internal::aggregating_functor< class_type, queueing_port_operationhandler_type
 

Private Member Functions

void handle_operations (queueing_port_operation *op_list)
 

Private Attributes

aggregator< handler_type, queueing_port_operationmy_aggregator
 
forwarding_basemy_join
 

Friends

class internal::aggregating_functor< class_type, queueing_port_operation >
 
template<typename R , typename B >
class run_and_put_task
 
template<typename X , typename Y >
class internal::broadcast_cache
 
template<typename X , typename Y >
class internal::round_robin_cache
 

Additional Inherited Members

- Protected Types inherited from internal::item_buffer< T, A >
typedef size_t size_type
 
typedef aligned_pair< item_type, buffer_item_state >::type buffer_item_type
 
typedef A::template rebind< buffer_item_type >::other allocator_type
 
- Protected Attributes inherited from internal::item_buffer< T, A >
buffer_item_typemy_array
 
size_type my_array_size
 
size_type my_head
 
size_type my_tail
 
- Static Protected Attributes inherited from internal::item_buffer< T, A >
static const size_type initial_buffer_size = 4
 

Detailed Description

template<typename T>
class internal::queueing_port< T >

queueing join_port

Definition at line 426 of file _flow_graph_join_impl.h.

Member Typedef Documentation

◆ class_type

template<typename T >
typedef queueing_port<T> internal::queueing_port< T >::class_type

Definition at line 430 of file _flow_graph_join_impl.h.

◆ handler_type

template<typename T >
typedef internal::aggregating_functor<class_type, queueing_port_operation> internal::queueing_port< T >::handler_type
private

Definition at line 471 of file _flow_graph_join_impl.h.

◆ input_type

template<typename T >
typedef T internal::queueing_port< T >::input_type

Definition at line 428 of file _flow_graph_join_impl.h.

◆ predecessor_type

template<typename T >
typedef receiver<input_type>::predecessor_type internal::queueing_port< T >::predecessor_type

Definition at line 429 of file _flow_graph_join_impl.h.

Member Enumeration Documentation

◆ op_type

template<typename T >
enum internal::queueing_port::op_type
private
Enumerator
get__item 
res_port 
try__put_task 

Definition at line 438 of file _flow_graph_join_impl.h.

439 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
440  , add_blt_pred, del_blt_pred, blt_pred_cnt, blt_pred_cpy
441 #endif
442  };

Constructor & Destructor Documentation

◆ queueing_port() [1/2]

template<typename T >
internal::queueing_port< T >::queueing_port ( )
inline

Constructor.

Definition at line 552 of file _flow_graph_join_impl.h.

552  : item_buffer<T>() {
553  my_join = NULL;
554  my_aggregator.initialize_handler(handler_type(this));
555  }
aggregator< handler_type, queueing_port_operation > my_aggregator
internal::aggregating_functor< class_type, queueing_port_operation > handler_type

◆ queueing_port() [2/2]

template<typename T >
internal::queueing_port< T >::queueing_port ( const queueing_port< T > &  )
inline

copy constructor

Definition at line 558 of file _flow_graph_join_impl.h.

558  : receiver<T>(), item_buffer<T>() {
559  my_join = NULL;
560  my_aggregator.initialize_handler(handler_type(this));
561  }
aggregator< handler_type, queueing_port_operation > my_aggregator
internal::aggregating_functor< class_type, queueing_port_operation > handler_type

Member Function Documentation

◆ get_item()

template<typename T >
bool internal::queueing_port< T >::get_item ( T &  v)
inline

Definition at line 568 of file _flow_graph_join_impl.h.

References SUCCEEDED.

568  {
569  queueing_port_operation op_data(&v, get__item);
570  my_aggregator.execute(&op_data);
571  return op_data.status == SUCCEEDED;
572  }
aggregator< handler_type, queueing_port_operation > my_aggregator

◆ graph_reference()

template<typename T >
graph& internal::queueing_port< T >::graph_reference ( )
inlineprotected

Definition at line 545 of file _flow_graph_join_impl.h.

545  {
546  return my_join->graph_ref;
547  }

◆ handle_operations()

template<typename T >
void internal::queueing_port< T >::handle_operations ( queueing_port_operation op_list)
inlineprivate

Definition at line 475 of file _flow_graph_join_impl.h.

References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), internal::queueing_port< T >::queueing_port_operation::bypass_t, FAILED, internal::queueing_port< T >::queueing_port_operation::my_arg, internal::queueing_port< T >::queueing_port_operation::my_val, SUCCEEDED, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, task, internal::queueing_port< T >::queueing_port_operation::type, and void.

475  {
476  queueing_port_operation *current;
477  bool was_empty;
478  while(op_list) {
479  current = op_list;
480  op_list = op_list->next;
481  switch(current->type) {
482  case try__put_task: {
483  task *rtask = NULL;
484  was_empty = this->buffer_empty();
485  this->push_back(current->my_val);
486  if (was_empty) rtask = my_join->decrement_port_count(false);
487  else
488  rtask = SUCCESSFULLY_ENQUEUED;
489  current->bypass_t = rtask;
490  __TBB_store_with_release(current->status, SUCCEEDED);
491  }
492  break;
493  case get__item:
494  if(!this->buffer_empty()) {
495  *(current->my_arg) = this->front();
496  __TBB_store_with_release(current->status, SUCCEEDED);
497  }
498  else {
499  __TBB_store_with_release(current->status, FAILED);
500  }
501  break;
502  case res_port:
503  __TBB_ASSERT(this->my_item_valid(this->my_head), "No item to reset");
504  this->destroy_front();
505  if(this->my_item_valid(this->my_head)) {
507  }
508  __TBB_store_with_release(current->status, SUCCEEDED);
509  break;
510 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
511  case add_blt_pred:
512  my_built_predecessors.add_edge(*(current->pred));
513  __TBB_store_with_release(current->status, SUCCEEDED);
514  break;
515  case del_blt_pred:
516  my_built_predecessors.delete_edge(*(current->pred));
517  __TBB_store_with_release(current->status, SUCCEEDED);
518  break;
519  case blt_pred_cnt:
520  current->cnt_val = my_built_predecessors.edge_count();
521  __TBB_store_with_release(current->status, SUCCEEDED);
522  break;
523  case blt_pred_cpy:
524  my_built_predecessors.copy_edges(*(current->plist));
525  __TBB_store_with_release(current->status, SUCCEEDED);
526  break;
527 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
528  }
529  }
530  }
const item_type & front() const
static tbb::task *const SUCCESSFULLY_ENQUEUED
virtual task * decrement_port_count(bool handle_task)=0
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
bool my_item_valid(size_type i) const
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:716
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
Here is the call graph for this function:

◆ reset_port()

template<typename T >
void internal::queueing_port< T >::reset_port ( )
inline

Definition at line 576 of file _flow_graph_join_impl.h.

References __TBB_override, p, and internal::item_buffer< T, A >::reset().

576  {
577  queueing_port_operation op_data(res_port);
578  my_aggregator.execute(&op_data);
579  return;
580  }
aggregator< handler_type, queueing_port_operation > my_aggregator
Here is the call graph for this function:

◆ reset_receiver()

template<typename T >
void internal::queueing_port< T >::reset_receiver ( reset_flags  f)
inline

Definition at line 615 of file _flow_graph_join_impl.h.

References internal::item_buffer< T, A >::reset(), tbb::flow::interface10::rf_clear_edges, and tbb::internal::suppress_unused_warning().

615  {
618 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
619  if (f & rf_clear_edges)
620  my_built_predecessors.clear();
621 #endif
622  }
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
Definition: tbb_stddef.h:377
Here is the call graph for this function:

◆ set_join_node_pointer()

template<typename T >
void internal::queueing_port< T >::set_join_node_pointer ( forwarding_base join)
inline

record parent for tallying available items

Definition at line 564 of file _flow_graph_join_impl.h.

564  {
565  my_join = join;
566  }

◆ try_put_task()

template<typename T >
task* internal::queueing_port< T >::try_put_task ( const T &  v)
inlineprotected

Definition at line 537 of file _flow_graph_join_impl.h.

References __TBB_ASSERT, internal::queueing_port< T >::queueing_port_operation::bypass_t, SUCCEEDED, and tbb::flow::internal::SUCCESSFULLY_ENQUEUED.

537  {
538  queueing_port_operation op_data(v, try__put_task);
539  my_aggregator.execute(&op_data);
540  __TBB_ASSERT(op_data.status == SUCCEEDED || !op_data.bypass_t, "inconsistent return from aggregator");
541  if(!op_data.bypass_t) return SUCCESSFULLY_ENQUEUED;
542  return op_data.bypass_t;
543  }
aggregator< handler_type, queueing_port_operation > my_aggregator
static tbb::task *const SUCCESSFULLY_ENQUEUED
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165

Friends And Related Function Documentation

◆ internal::aggregating_functor< class_type, queueing_port_operation >

template<typename T >
friend class internal::aggregating_functor< class_type, queueing_port_operation >
friend

Definition at line 472 of file _flow_graph_join_impl.h.

◆ internal::broadcast_cache

template<typename T >
template<typename X , typename Y >
friend class internal::broadcast_cache
friend

Definition at line 535 of file _flow_graph_join_impl.h.

◆ internal::round_robin_cache

template<typename T >
template<typename X , typename Y >
friend class internal::round_robin_cache
friend

Definition at line 536 of file _flow_graph_join_impl.h.

◆ run_and_put_task

template<typename T >
template<typename R , typename B >
friend class run_and_put_task
friend

Definition at line 534 of file _flow_graph_join_impl.h.

Member Data Documentation

◆ my_aggregator

template<typename T >
aggregator<handler_type, queueing_port_operation> internal::queueing_port< T >::my_aggregator
private

Definition at line 473 of file _flow_graph_join_impl.h.

◆ my_join

template<typename T >
forwarding_base* internal::queueing_port< T >::my_join
private

Definition at line 625 of file _flow_graph_join_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.