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

Member Typedef Documentation

◆ class_type

Definition at line 432 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 474 of file flow_graph.h.

◆ input_type

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

Definition at line 430 of file flow_graph.h.

◆ predecessor_type

Member Enumeration Documentation

◆ op_stat

Enumerator
WAIT 
SUCCEEDED 
FAILED 

Definition at line 445 of file flow_graph.h.

445 {

◆ op_type

Enumerator
get__item 
res_port 
try__put_task 

Definition at line 440 of file flow_graph.h.

441  {
443  }
444 
bool try_put(const X &t)
Put an item to the receiver.
Definition: flow_graph.h:346

Constructor & Destructor Documentation

◆ queueing_port() [1/2]

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

Constructor.

Definition at line 555 of file flow_graph.h.

558  { 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 561 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 571 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 548 of file flow_graph.h.

552  :

◆ handle_operations()

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

Definition at line 478 of file flow_graph.h.

482  { return false; }
483 
485  virtual bool try_reserve( T & ) { return false; }
486 
488  virtual bool try_release( ) { return false; }
489 
491  virtual bool try_consume( ) { return false; }
492 
493 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
494  typedef typename internal::edge_container<successor_type> built_successors_type;
496  typedef typename built_successors_type::edge_list_type successor_list_type;
497  virtual built_successors_type &built_successors() = 0;
498  virtual void internal_add_built_successor( successor_type & ) = 0;
499  virtual void internal_delete_built_successor( successor_type & ) = 0;
500  virtual void copy_successors( successor_list_type &) = 0;
501  virtual size_t successor_count() = 0;
502 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
503 }; // class sender<T>
504 
506 template< typename T >
507 class receiver {
508 public:
510  typedef T input_type;
511 
513  typedef sender<T> predecessor_type;
514 
516  virtual ~receiver() {}
517 
519  bool try_put( const T& t ) {
520  task *res = try_put_task(t);
521  if (!res) return false;
523  return true;
524  }
525 
527 protected:
528  template< typename R, typename B > friend class run_and_put_task;
529  template< typename X, typename Y > friend class internal::broadcast_cache;
530  template< typename X, typename Y > friend class internal::round_robin_cache;
531  virtual task *try_put_task(const T& t) = 0;
532  virtual graph& graph_reference() = 0;
533 public:
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.
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:441
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:540
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:431
A cache of successors that are put in a round-robin fashion.

◆ reset_port()

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

Definition at line 579 of file flow_graph.h.

580  {
581  my_predecessor_count = my_initial_predecessor_count = number_of_predecessors;
582  my_current_count = 0;
583  __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 618 of file flow_graph.h.

620  {
622  my_built_predecessors.delete_edge(s);
623  }
624 
625  void copy_predecessors( predecessor_list_type &v) __TBB_override {
void const char const char int ITT_FORMAT __itt_group_sync s
#define __TBB_override
Definition: tbb_stddef.h:240
friend class scoped_lock
Definition: spin_mutex.h:176

◆ 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 567 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 540 of file flow_graph.h.

540  { return false; }
541 
542 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
543  typedef typename internal::edge_container<predecessor_type> built_predecessors_type;
544  typedef typename built_predecessors_type::edge_list_type predecessor_list_type;
545  virtual built_predecessors_type &built_predecessors() = 0;
546  virtual void internal_add_built_predecessor( predecessor_type & ) = 0;
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:431

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 475 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 538 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 539 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 537 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 476 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 628 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.