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

task * | try_put_task (const T &v) __TBB_override
graph & | graph_reference () const __TBB_override
Protected Member Functions inherited from internal::item_buffer< T, A >
bool | buffer_empty () const
buffer_item_type & | item (size_type i)
const buffer_item_type & | item (size_type i) const
bool | my_item_valid (size_type i) const
bool | my_item_reserved (size_type i) const
const item_type & | get_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_type & | front () const
const item_type & | back () 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_operation > | handler_type

## Private Member Functions

void | handle_operations (queueing_port_operation *op_list)

## Private Attributes

aggregator< handler_type, queueing_port_operation > | my_aggregator
forwarding_base * | my_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 tbb::internal::allocator_rebind< A, buffer_item_type >::type | allocator_type
Protected Attributes inherited from internal::item_buffer< T, A >
buffer_item_type * | my_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 430 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 434 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 475 of file _flow_graph_join_impl.h.

## input_type

template<typename T >

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

Definition at line 432 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 433 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 442 of file _flow_graph_join_impl.h.

{ get__item, res_port, try__put_task
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
, add_blt_pred, del_blt_pred, blt_pred_cnt, blt_pred_cpy
#endif
};
internal::queueing_port::res_port
@ res_port
Definition: _flow_graph_join_impl.h:442
internal::queueing_port::try__put_task
@ try__put_task
Definition: _flow_graph_join_impl.h:442
internal::queueing_port::get__item
@ get__item
Definition: _flow_graph_join_impl.h:442

## Constructor & Destructor Documentation

## queueing_port() [1/2]

template<typename T >

internal::queueing_port< T >::queueing_port | ( |  | ) |

inline

Constructor.

Definition at line 556 of file _flow_graph_join_impl.h.

: item_buffer<T>() {
my_join = NULL;
my_aggregator.initialize_handler(handler_type(this));
}
internal::queueing_port::my_aggregator
aggregator< handler_type, queueing_port_operation > my_aggregator
Definition: _flow_graph_join_impl.h:477
internal::queueing_port::handler_type
internal::aggregating_functor< class_type, queueing_port_operation > handler_type
Definition: _flow_graph_join_impl.h:475
internal::queueing_port::my_join
forwarding_base * my_join
Definition: _flow_graph_join_impl.h:633

References internal::queueing_port< T >::my_aggregator, and internal::queueing_port< T >::my_join.

## queueing_port() [2/2]

template<typename T >

internal::queueing_port< T >::queueing_port | ( | const queueing_port< T > & |  | ) |

inline

copy constructor

Definition at line 562 of file _flow_graph_join_impl.h.

: receiver<T>(), item_buffer<T>() {
my_join = NULL;
my_aggregator.initialize_handler(handler_type(this));
}

References internal::queueing_port< T >::my_aggregator, and internal::queueing_port< T >::my_join.

## Member Function Documentation

## get_item()

template<typename T >

bool internal::queueing_port< T >::get_item | ( | T & | v | ) |

inline

Definition at line 572 of file _flow_graph_join_impl.h.

{
queueing_port_operation op_data(&v, get__item);
my_aggregator.execute(&op_data);
return op_data.status == SUCCEEDED;
}
internal::SUCCEEDED
@ SUCCEEDED
Definition: _flow_graph_types_impl.h:719

References internal::queueing_port< T >::get__item, internal::queueing_port< T >::my_aggregator, tbb::interface6::internal::aggregated_operation< Derived >::status, and internal::SUCCEEDED.

## graph_reference()

template<typename T >

graph& internal::queueing_port< T >::graph_reference | ( |  | ) | const

inline protected

Definition at line 549 of file _flow_graph_join_impl.h.

{
return my_join->graph_ref;
}
internal::forwarding_base::graph_ref
graph & graph_ref
Definition: _flow_graph_join_impl.h:34

References internal::forwarding_base::graph_ref, and internal::queueing_port< T >::my_join.

## handle_operations()

template<typename T >

void internal::queueing_port< T >::handle_operations | ( | queueing_port_operation * | op_list | ) |

inline private

Definition at line 479 of file _flow_graph_join_impl.h.

{
queueing_port_operation *current;
bool was_empty;
while(op_list) {
current = op_list;
op_list = op_list->next;
switch(current->type) {
case try__put_task: {
task *rtask = NULL;
was_empty = this->buffer_empty();
this->push_back(current->my_val);
if (was_empty) rtask = my_join->decrement_port_count(false);
else
rtask = SUCCESSFULLY_ENQUEUED;
current->bypass_t = rtask;
__TBB_store_with_release(current->status, SUCCEEDED);
}
break;
case get__item:
if(!this->buffer_empty()) {
*(current->my_arg) = this->front();
__TBB_store_with_release(current->status, SUCCEEDED);
}
else {
__TBB_store_with_release(current->status, FAILED);
}
break;
case res_port:
__TBB_ASSERT(this->my_item_valid(this->my_head), "No item to reset");
this->destroy_front();
if(this->my_item_valid(this->my_head)) {
(void)my_join->decrement_port_count(true);
}
__TBB_store_with_release(current->status, SUCCEEDED);
break;
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
case add_blt_pred:
my_built_predecessors.add_edge(*(current->pred));
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case del_blt_pred:
my_built_predecessors.delete_edge(*(current->pred));
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case blt_pred_cnt:
current->cnt_val = my_built_predecessors.edge_count();
__TBB_store_with_release(current->status, SUCCEEDED);
break;
case blt_pred_cpy:
my_built_predecessors.copy_edges(*(current->plist));
__TBB_store_with_release(current->status, SUCCEEDED);
break;
#endif /* TBB_DEPRECATED_FLOW_NODE_EXTRACTION */
}
}
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
task
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
Definition: ittnotify_static.h:119
void
void
Definition: ittnotify_static.h:91
tbb::internal::__TBB_store_with_release
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:716
internal::FAILED
@ FAILED
Definition: _flow_graph_types_impl.h:719
tbb::flow::internal::SUCCESSFULLY_ENQUEUED
static tbb::task *const SUCCESSFULLY_ENQUEUED
Definition: _flow_graph_impl.h:61
internal::item_buffer::front
const item_type & front() const
Definition: _flow_graph_item_buffer_impl.h:129
internal::item_buffer::buffer_empty
bool buffer_empty() const
Definition: _flow_graph_item_buffer_impl.h:54
internal::item_buffer::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:68
internal::item_buffer::my_head
size_type my_head
Definition: _flow_graph_item_buffer_impl.h:51
internal::item_buffer::destroy_front
void destroy_front()
Definition: _flow_graph_item_buffer_impl.h:146
internal::item_buffer::push_back
bool push_back(item_type &v)
Definition: _flow_graph_item_buffer_impl.h:185
internal::forwarding_base::decrement_port_count
virtual task * decrement_port_count(bool handle_task)=0

References __TBB_ASSERT, tbb::internal::__TBB_store_with_release(), internal::item_buffer< T, A >::buffer_empty(), internal::queueing_port< T >::queueing_port_operation::bypass_t, internal::forwarding_base::decrement_port_count(), internal::item_buffer< T, A >::destroy_front(), internal::FAILED, internal::item_buffer< T, A >::front(), internal::queueing_port< T >::get__item, internal::queueing_port< T >::queueing_port_operation::my_arg, internal::item_buffer< T, A >::my_head, internal::item_buffer< T, A >::my_item_valid(), internal::queueing_port< T >::my_join, internal::queueing_port< T >::queueing_port_operation::my_val, tbb::interface6::internal::aggregated_operation< Derived >::next, internal::item_buffer< T, A >::push_back(), internal::queueing_port< T >::res_port, tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, task, internal::queueing_port< T >::try__put_task, internal::queueing_port< T >::queueing_port_operation::type, and void.

Here is the call graph for this function:

## reset_port()

template<typename T >

void internal::queueing_port< T >::reset_port | ( |  | ) |

inline

Definition at line 580 of file _flow_graph_join_impl.h.

{
queueing_port_operation op_data(res_port);
my_aggregator.execute(&op_data);
return;
}

References internal::queueing_port< T >::my_aggregator, and internal::queueing_port< T >::res_port.

## reset_receiver()

template<typename T >

void internal::queueing_port< T >::reset_receiver | ( | reset_flags | f | ) |

inline

Definition at line 619 of file _flow_graph_join_impl.h.

{
tbb::internal::suppress_unused_warning(f);
item_buffer<T>::reset();
#if TBB_DEPRECATED_FLOW_NODE_EXTRACTION
if (f & rf_clear_edges)
my_built_predecessors.clear();
#endif
}
tbb::internal::suppress_unused_warning
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
Definition: tbb_stddef.h:398
tbb::flow::interface11::rf_clear_edges
@ rf_clear_edges
Definition: _flow_graph_impl.h:161
internal::item_buffer::reset
void reset()
Definition: _flow_graph_item_buffer_impl.h:239

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

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 568 of file _flow_graph_join_impl.h.

{
my_join = join;
}

References internal::queueing_port< T >::my_join.

## try_put_task()

template<typename T >

task* internal::queueing_port< T >::try_put_task | ( | const T & | v | ) |

inline protected

Definition at line 541 of file _flow_graph_join_impl.h.

{
queueing_port_operation op_data(v, try__put_task);
my_aggregator.execute(&op_data);
__TBB_ASSERT(op_data.status == SUCCEEDED || !op_data.bypass_t, "inconsistent return from aggregator");
if(!op_data.bypass_t) return SUCCESSFULLY_ENQUEUED;
return op_data.bypass_t;
}

References __TBB_ASSERT, internal::queueing_port< T >::queueing_port_operation::bypass_t, internal::queueing_port< T >::my_aggregator, tbb::interface6::internal::aggregated_operation< Derived >::status, internal::SUCCEEDED, tbb::flow::internal::SUCCESSFULLY_ENQUEUED, and internal::queueing_port< T >::try__put_task.

## 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_join_impl.h.

## internal::broadcast_cache

template<typename T >
template<typename X , typename Y >

friend class internal::broadcast_cache

friend

Definition at line 539 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 540 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 538 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 477 of file _flow_graph_join_impl.h.

Referenced by internal::queueing_port< T >::get_item(), internal::queueing_port< T >::queueing_port(), internal::queueing_port< T >::reset_port(), and internal::queueing_port< T >::try_put_task().

## my_join

template<typename T >

forwarding_base* internal::queueing_port< T >::my_join

private

Definition at line 633 of file _flow_graph_join_impl.h.

Referenced by internal::queueing_port< T >::graph_reference(), internal::queueing_port< T >::handle_operations(), internal::queueing_port< T >::queueing_port(), and internal::queueing_port< T >::set_join_node_pointer().

The documentation for this class was generated from the following file:

- _flow_graph_join_impl.h

Copyright © 2005-2020 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.