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

Member Typedef Documentation

◆ class_type

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

◆ input_type

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

Definition at line 429 of file flow_graph.h.

◆ predecessor_type

Member Enumeration Documentation

◆ op_type

Enumerator
get__item 
res_port 
try__put_task 

Definition at line 439 of file flow_graph.h.

Constructor & Destructor Documentation

◆ queueing_port() [1/2]

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

Constructor.

Definition at line 553 of file flow_graph.h.

555  :

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

560  { return false; }
561 
562 #if __TBB_PREVIEW_OPENCL_NODE

Member Function Documentation

◆ get_item()

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

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

555  :

◆ handle_operations()

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

Definition at line 476 of file flow_graph.h.

485  { return false; }
486 
488  virtual bool try_reserve( T & ) { return false; }
489 
491  virtual bool try_release( ) { return false; }
492 
494  virtual bool try_consume( ) { return false; }
495 
496 #if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
497  typedef typename internal::edge_container<successor_type> built_successors_type;
499  typedef typename built_successors_type::edge_list_type successor_list_type;
500  virtual built_successors_type &built_successors() = 0;
501  virtual void internal_add_built_successor( successor_type & ) = 0;
502  virtual void internal_delete_built_successor( successor_type & ) = 0;
503  virtual void copy_successors( successor_list_type &) = 0;
504  virtual size_t successor_count() = 0;
505 #endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
506 }; // class sender<T>
507 
509 template< typename T >
510 class receiver {
511 public:
513  typedef T input_type;
514 
516  typedef sender<T> predecessor_type;
517 
519  virtual ~receiver() {}
520 
522  bool try_put( const T& t ) {
523  task *res = try_put_task(t);
524  if (!res) return false;
526  return true;
527  }
528 
530 protected:
531  template< typename R, typename B > friend class run_and_put_task;
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:538
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:444
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
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:430

◆ reset_port()

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

Definition at line 577 of file flow_graph.h.

582  {

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

617  {
618  spin_mutex::scoped_lock l(my_mutex);
619  my_built_predecessors.add_edge( s );
620  }
621 
622  void internal_delete_built_predecessor( predecessor_type &s) __TBB_override {
623  spin_mutex::scoped_lock l(my_mutex);
friend class scoped_lock
Definition: spin_mutex.h:176
#define __TBB_override
Definition: tbb_stddef.h:240
void const char const char int ITT_FORMAT __itt_group_sync s
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:430

◆ 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 565 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 538 of file flow_graph.h.

540  { return false; }
541 
543  virtual bool remove_predecessor( predecessor_type & ) { return false; }
544 
virtual bool remove_predecessor(predecessor_type &)
Remove a predecessor from the node.
Definition: flow_graph.h:364
receiver< input_type >::predecessor_type predecessor_type
Definition: flow_graph.h:430

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 473 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 536 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 537 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 535 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 474 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 626 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.