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

queueing join_port More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::internal::queueing_port< T >:
Collaboration diagram for tbb::flow::interface11::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::interface11::internal::untyped_receiver
typedef untyped_sender predecessor_type
 The predecessor type for this node. More...
 
- Public Types inherited from tbb::flow::interface11::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::interface11::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::interface11::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::interface11::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 () const __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::receiver< T >
virtual tasktry_put_task_wrapper (const void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_receiver
template<typename X >
tasktry_put_task (const X &t)
 
virtual bool is_continue_receiver ()
 
- Protected Member Functions inherited from tbb::flow::interface11::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 }
 
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

- Public Attributes inherited from tbb::flow::interface11::receiver< T >
__TBB_DEPRECATED typedef T input_type
 The input type of this receiver. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type filtered_type
 
- Protected Types inherited from tbb::flow::interface11::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::interface11::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::interface11::internal::item_buffer< T >
static const size_type initial_buffer_size
 

Detailed Description

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

queueing join_port

Definition at line 431 of file flow_graph.h.

Member Typedef Documentation

◆ class_type

Definition at line 435 of file flow_graph.h.

◆ handler_type

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

Definition at line 476 of file flow_graph.h.

◆ input_type

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

Definition at line 433 of file flow_graph.h.

◆ predecessor_type

Member Enumeration Documentation

◆ op_type

Enumerator
get__item 
res_port 
try__put_task 

Definition at line 443 of file flow_graph.h.

443  {
444  return try_reserve( internal::async_helpers<T>::from_void_ptr(p) );
445  }
446  // Else: this (T) is async OR incoming 't' is async
447  __TBB_ASSERT(false, "async_msg interface does not support 'pull' protocol in try_reserve()");
static const T & from_void_ptr(const void *p)
Definition: flow_graph.h:229
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
void const char const char int ITT_FORMAT __itt_group_sync p

Constructor & Destructor Documentation

◆ queueing_port() [1/2]

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

Constructor.

Definition at line 557 of file flow_graph.h.

560  { return false; }

◆ queueing_port() [2/2]

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

copy constructor

Definition at line 563 of file flow_graph.h.

563  { return false; }
564 
565 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
566  __TBB_DEPRECATED typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
#define __TBB_DEPRECATED
Definition: tbb_config.h:639

Member Function Documentation

◆ get_item()

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

Definition at line 573 of file flow_graph.h.

575  :
577  virtual void reset_receiver(reset_flags f = rf_reset_protocol) = 0;
void reset_receiver(reset_flags f) __TBB_override
put receiver back in initial state
Definition: flow_graph.h:620

◆ graph_reference()

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

Implements tbb::flow::interface11::internal::untyped_receiver.

Definition at line 550 of file flow_graph.h.

550  :
551  template< typename R, typename B > friend class run_and_put_task;
552  template< typename X, typename Y > friend class internal::broadcast_cache;
A cache of successors that are broadcast to.

◆ handle_operations()

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

Definition at line 480 of file flow_graph.h.

486  {
487 public:
489  __TBB_DEPRECATED typedef T output_type;
490 
492  __TBB_DEPRECATED typedef receiver<T> successor_type;
493 
494  virtual ~sender() {}
495 
496  // NOTE: Following part of PUBLIC section is partly copy-pasted in sender<T> under #if __TBB_PREVIEW_ASYNC_MSG
497 
499  __TBB_DEPRECATED virtual bool register_successor( successor_type &r ) = 0;
500 
502  __TBB_DEPRECATED virtual bool remove_successor( successor_type &r ) = 0;
503 
505  virtual bool try_get( T & ) { return false; }
506 
508  virtual bool try_reserve( T & ) { return false; }
509 
511  virtual bool try_release( ) { return false; }
512 
514  virtual bool try_consume( ) { return false; }
515 
516 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
517  __TBB_DEPRECATED typedef typename internal::edge_container<successor_type> built_successors_type;
519  __TBB_DEPRECATED typedef typename built_successors_type::edge_list_type successor_list_type;
520  __TBB_DEPRECATED virtual built_successors_type &built_successors() = 0;
521  __TBB_DEPRECATED virtual void internal_add_built_successor( successor_type & ) = 0;
522  __TBB_DEPRECATED virtual void internal_delete_built_successor( successor_type & ) = 0;
523  __TBB_DEPRECATED virtual void copy_successors( successor_list_type &) = 0;
524  __TBB_DEPRECATED virtual size_t successor_count() = 0;
525 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
526 }; // class sender<T>
527 
529 template< typename T >
530 class receiver {
531 public:
533  __TBB_DEPRECATED typedef T input_type;
534 
void register_successor(successor_type &r)
void remove_successor(successor_type &r)
#define __TBB_DEPRECATED
Definition: tbb_config.h:639

◆ reset_port()

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

◆ reset_receiver()

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

put receiver back in initial state

Implements tbb::flow::interface11::internal::untyped_receiver.

Definition at line 620 of file flow_graph.h.

626  {
627  spin_mutex::scoped_lock l(my_mutex);
friend class scoped_lock
Definition: spin_mutex.h:179

◆ set_join_node_pointer()

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

record parent for tallying available items

Definition at line 569 of file flow_graph.h.

575  :

◆ try_put_task()

template<typename T >
task* tbb::flow::interface11::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::interface11::receiver< T >.

Definition at line 542 of file flow_graph.h.

542  {
543  task *res = try_put_task(t);
544  if (!res) return false;
546  return true;
547  }
548 
static tbb::task *const SUCCESSFULLY_ENQUEUED
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
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:550
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:542
void spawn_in_graph_arena(tbb::flow::interface10::graph &g, tbb::task &arena_task)
Spawns a task inside graph arena.

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 477 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 540 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 541 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 539 of file flow_graph.h.

Member Data Documentation

◆ my_aggregator

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

Definition at line 478 of file flow_graph.h.

◆ my_join

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

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