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

queueing join_port More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface10::internal::queueing_port< T >:
Collaboration diagram for tbb::flow::interface10::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 tbb::flow::interface10::receiver< T >
typedef T input_type
 The input type of this receiver. More...
 
typedef internal::async_helpers< T >::filtered_type filtered_type
 
- Public Types inherited from tbb::flow::interface10::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 
- Public Types inherited from tbb::flow::interface10::internal::item_buffer< T >
enum  buffer_item_state
 
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
 put receiver back in initial state More...
 
- Public Member Functions inherited from tbb::flow::interface10::receiver< T >
bool try_put (const typename internal::async_helpers< T >::filtered_type &t)
 Put an item to the receiver. More...
 
bool try_put (const typename internal::async_helpers< T >::async_type &t)
 
- Public Member Functions inherited from tbb::flow::interface10::internal::untyped_receiver
virtual ~untyped_receiver ()
 Destructor. More...
 
template<typename X >
bool try_put (const X &t)
 Put an item to the receiver. More...
 
virtual bool register_predecessor (predecessor_type &)
 Add a predecessor to the node. More...
 
virtual bool remove_predecessor (predecessor_type &)
 Remove a predecessor from the node. More...
 
- Public Member Functions inherited from tbb::flow::interface10::internal::item_buffer< T >
 item_buffer ()
 Constructor. More...
 
 ~item_buffer ()
 
void reset ()
 

Protected Member Functions

tasktry_put_task (const T &v) __TBB_override
 Put item to successor; return task to run the successor if possible. More...
 
graphgraph_reference () __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::receiver< T >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual bool is_continue_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface10::internal::item_buffer< T >
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 }
 
enum  op_stat { WAIT =0, SUCCEEDED, FAILED }
 
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 tbb::flow::interface10::internal::item_buffer< T >
typedef size_t size_type
 
typedef aligned_pair< item_type, buffer_item_state >::type buffer_item_type
 
typedef cache_aligned_allocator< T > ::template rebind< buffer_item_type >::other allocator_type
 
- Protected Attributes inherited from tbb::flow::interface10::internal::item_buffer< T >
buffer_item_typemy_array
 
size_type my_array_size
 
size_type my_head
 
size_type my_tail
 
- Static Protected Attributes inherited from tbb::flow::interface10::internal::item_buffer< T >
static const size_type initial_buffer_size
 

Detailed Description

template<typename T>
class tbb::flow::interface10::internal::queueing_port< T >

queueing join_port

Definition at line 432 of file flow_graph.h.

Member Typedef Documentation

◆ class_type

Definition at line 436 of file flow_graph.h.

◆ handler_type

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

Definition at line 478 of file flow_graph.h.

◆ input_type

template<typename T >
typedef T tbb::flow::interface10::internal::queueing_port< T >::input_type

Definition at line 434 of file flow_graph.h.

◆ predecessor_type

Member Enumeration Documentation

◆ op_stat

Enumerator
WAIT 
SUCCEEDED 
FAILED 

Definition at line 449 of file flow_graph.h.

449 {

◆ op_type

Enumerator
get__item 
res_port 
try__put_task 

Definition at line 444 of file flow_graph.h.

445  {
447  }
448 
bool try_put(const X &t)
Put an item to the receiver.
Definition: flow_graph.h:350

Constructor & Destructor Documentation

◆ queueing_port() [1/2]

template<typename T >
tbb::flow::interface10::internal::queueing_port< T >::queueing_port ( )
inline

Constructor.

Definition at line 559 of file flow_graph.h.

562  { return false; }

◆ queueing_port() [2/2]

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

copy constructor

Definition at line 565 of file flow_graph.h.

Member Function Documentation

◆ get_item()

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

Definition at line 575 of file flow_graph.h.

◆ graph_reference()

template<typename T >
graph& tbb::flow::interface10::internal::queueing_port< T >::graph_reference ( )
inlineprotectedvirtual

Implements tbb::flow::interface10::internal::untyped_receiver.

Definition at line 552 of file flow_graph.h.

556  :

◆ handle_operations()

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

Definition at line 482 of file flow_graph.h.

486  { return false; }
487 
489  virtual bool try_reserve( T & ) { return false; }
490 
492  virtual bool try_release( ) { return false; }
493 
495  virtual bool try_consume( ) { return false; }
496 
497 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
498  typedef typename internal::edge_container<successor_type> built_successors_type;
500  typedef typename built_successors_type::edge_list_type successor_list_type;
501  virtual built_successors_type &built_successors() = 0;
502  virtual void internal_add_built_successor( successor_type & ) = 0;
503  virtual void internal_delete_built_successor( successor_type & ) = 0;
504  virtual void copy_successors( successor_list_type &) = 0;
505  virtual size_t successor_count() = 0;
506 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
507 }; // class sender<T>
508 
510 template< typename T >
511 class receiver {
512 public:
514  typedef T input_type;
515 
517  typedef sender<T> predecessor_type;
518 
520  virtual ~receiver() {}
521 
523  bool try_put( const T& t ) {
524  task *res = try_put_task(t);
525  if (!res) return false;
527  return true;
528  }
529 
531 protected:
532  template< typename R, typename B > friend class run_and_put_task;
533  template< typename X, typename Y > friend class internal::broadcast_cache;
534  template< typename X, typename Y > friend class internal::round_robin_cache;
535  virtual task *try_put_task(const T& t) = 0;
536  virtual graph& graph_reference() = 0;
537 public:
static tbb::task *const SUCCESSFULLY_ENQUEUED
bool try_put(const typename internal::async_helpers< T >::filtered_type &t)
Put an item to the receiver.
Definition: flow_graph.h:445
A cache of successors that are put in a round-robin fashion.
task * try_put_task(const T &v) __TBB_override
Put item to successor; return task to run the successor if possible.
Definition: flow_graph.h:544
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:435
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
A cache of successors that are broadcast to.
void spawn_in_graph_arena(graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.

◆ reset_port()

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

Definition at line 583 of file flow_graph.h.

584  {
585  my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
586  my_current_count = 0;
587  __TBB_FLOW_GRAPH_PRIORITY_EXPR( my_priority = priority; )
#define __TBB_FLOW_GRAPH_PRIORITY_EXPR(expr)

◆ reset_receiver()

template<typename T >
void tbb::flow::interface10::internal::queueing_port< T >::reset_receiver ( reset_flags  f)
inlinevirtual

put receiver back in initial state

Implements tbb::flow::interface10::internal::untyped_receiver.

Definition at line 622 of file flow_graph.h.

624  {
626  my_built_predecessors.delete_edge(s);
627  }
628 
629  void copy_predecessors( predecessor_list_type &v) __TBB_override {
#define __TBB_override
Definition: tbb_stddef.h:244
friend class scoped_lock
Definition: spin_mutex.h:180
void const char const char int ITT_FORMAT __itt_group_sync s

◆ set_join_node_pointer()

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

record parent for tallying available items

Definition at line 571 of file flow_graph.h.

◆ try_put_task()

template<typename T >
task* tbb::flow::interface10::internal::queueing_port< T >::try_put_task ( const T &  t)
inlineprotectedvirtual

Put item to successor; return task to run the successor if possible.

Implements tbb::flow::interface10::receiver< T >.

Definition at line 544 of file flow_graph.h.

544  { return false; }
545 
546 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
547  typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
548  typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
549  virtual built_predecessors_type &built_predecessors() = 0;
550  virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:435

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 479 of file flow_graph.h.

◆ internal::broadcast_cache

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

Definition at line 542 of file flow_graph.h.

◆ internal::round_robin_cache

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

Definition at line 543 of file flow_graph.h.

◆ run_and_put_task

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

Definition at line 541 of file flow_graph.h.

Member Data Documentation

◆ my_aggregator

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

Definition at line 480 of file flow_graph.h.

◆ my_join

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

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