tbb::flow::interface11::priority_queue_node< T, Compare, A > Class Template Reference

Forwards messages in priority order. More...

`#include <flow_graph.h>`

Inheritance diagram for tbb::flow::interface11::priority_queue_node< T, Compare, A >:
Collaboration diagram for tbb::flow::interface11::priority_queue_node< T, Compare, A >:

## Public Types

typedef T | input_type
typedef T | output_type
typedef buffer_node< T, A > | base_type
typedef priority_queue_node | class_type
typedef receiver< input_type >::predecessor_type | predecessor_type
typedef sender< output_type >::successor_type | successor_type
Public Types inherited from tbb::flow::interface11::buffer_node< T, A >
typedef T | input_type
typedef T | output_type
typedef receiver< input_type >::predecessor_type | predecessor_type
typedef sender< output_type >::successor_type | successor_type
typedef buffer_node< T, A > | 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 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::untyped_sender
typedef untyped_receiver | successor_type
| The successor type for this node. More...

## Public Member Functions

__TBB_NOINLINE_SYM | priority_queue_node (graph &g, const Compare &comp=Compare())
| Constructor. More...
__TBB_NOINLINE_SYM | priority_queue_node (const priority_queue_node &src)
| Copy constructor. More...
Public Member Functions inherited from tbb::flow::interface11::buffer_node< T, A >
__TBB_NOINLINE_SYM | buffer_node (graph &g)
| Constructor. More...
__TBB_NOINLINE_SYM | buffer_node (const buffer_node &src)
| Copy constructor. More...
bool | register_successor (successor_type &r) __TBB_override
| Adds a new successor. More...
bool | remove_successor (successor_type &r) __TBB_override
| Removes a successor. More...
bool | try_get (T &v) __TBB_override
| Request an item from the buffer_node. More...
bool | try_reserve (T &v) __TBB_override
| Reserves an item. More...
bool | try_release () __TBB_override
| Release a reserved item. More...
bool | try_consume () __TBB_override
| Consumes a reserved item. More...
Public Member Functions inherited from tbb::flow::interface11::graph_node
| graph_node (graph &g)
virtual | ~graph_node ()
Public Member Functions inherited from internal::reservable_item_buffer< T, A >
| reservable_item_buffer ()
void | reset ()
Public Member Functions inherited from internal::item_buffer< T, A >
| item_buffer ()
| Constructor. More...
| ~item_buffer ()
void | reset ()
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::untyped_sender
virtual | ~untyped_sender ()

## Protected Types

typedef buffer_node< T, A >::size_type | size_type
typedef buffer_node< T, A >::item_type | item_type
typedef buffer_node< T, A >::buffer_operation | prio_operation
Protected Types inherited from tbb::flow::interface11::buffer_node< T, A >
enum | op_type { reg_succ, rem_succ, req_item, res_item, rel_res, con_res, put_item, try_fwd_task }
typedef size_t | size_type
typedef internal::aggregating_functor< class_type, buffer_operation > | handler_type
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 A::template rebind< buffer_item_type >::other | allocator_type

## Protected Member Functions

void | reset_node (reset_flags f) __TBB_override
void | internal_forward_task (prio_operation *op) __TBB_override
| Tries to forward valid items to successors. More...
void | handle_operations (prio_operation *op_list) __TBB_override
bool | internal_push (prio_operation *op) __TBB_override
void | internal_pop (prio_operation *op) __TBB_override
void | internal_reserve (prio_operation *op) __TBB_override
void | internal_consume (prio_operation *op) __TBB_override
void | internal_release (prio_operation *op) __TBB_override
Protected Member Functions inherited from tbb::flow::interface11::buffer_node< T, A >
template<typename derived_type >
void | handle_operations_impl (buffer_operation *op_list, derived_type *derived)
task * | grab_forwarding_task (buffer_operation &op_data)
bool | enqueue_forwarding_task (buffer_operation &op_data)
virtual task * | forward_task ()
| This is executed by an enqueued task, the "forwarder". More...
virtual void | internal_reg_succ (buffer_operation *op)
| Register successor. More...
virtual void | internal_rem_succ (buffer_operation *op)
| Remove successor. More...
template<typename derived_type >
void | internal_forward_task_impl (buffer_operation *op, derived_type *derived)
task * | try_put_task (const T &t) __TBB_override
| receive an item, return a task *if possible More...
graph & | graph_reference () const __TBB_override
void | reset_receiver (reset_flags) __TBB_override
| put receiver back in initial state More...
Protected Member Functions inherited from internal::reservable_item_buffer< T, A >
bool | reserve_front (T &v)
void | consume_front ()
void | release_front ()
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)
Protected Member Functions inherited from tbb::flow::interface11::receiver< T >
virtual task * | try_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 >
task * | try_put_task (const X &t)
virtual bool | is_continue_receiver ()
Protected Member Functions inherited from tbb::flow::interface11::sender< T >
virtual bool | try_get_wrapper (void *p, bool is_async) __TBB_override
virtual bool | try_reserve_wrapper (void *p, bool is_async) __TBB_override
Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
template<typename X >
bool | try_get (X &t)
| Request an item from the sender. More...
template<typename X >
bool | try_reserve (X &t)
| Reserves an item in the sender. More...

## Private Member Functions

void | order ()
bool | is_item_valid ()
void | try_put_and_add_task (task *&last_task)
bool | prio_use_tail ()
void | prio_push (const T &src)
void | prio_pop ()
const T & | prio ()
void | heapify ()
void | reheap ()

## Private Attributes

Compare | compare
size_type | mark
input_type | reserved_item

## Friends

template<typename , typename >
class | buffer_node

## 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
Public Attributes inherited from tbb::flow::interface11::sender< T >
__TBB_DEPRECATED typedef T | output_type
| The output type of this sender. More...
__TBB_DEPRECATED typedef internal::async_helpers< T >::filtered_type | filtered_type
Protected Attributes inherited from tbb::flow::interface11::buffer_node< T, A >
internal::round_robin_cache< T, null_rw_mutex > | my_successors
bool | forwarder_busy
internal::aggregator< handler_type, buffer_operation > | my_aggregator
Protected Attributes inherited from tbb::flow::interface11::graph_node
graph & | my_graph
graph_node * | next
graph_node * | prev
Protected Attributes inherited from internal::reservable_item_buffer< T, A >
bool | my_reserved
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, typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>
class tbb::flow::interface11::priority_queue_node< T, Compare, A >

Forwards messages in priority order.

Definition at line 2373 of file flow_graph.h.

## Member Typedef Documentation

## base_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef buffer_node<T,A> tbb::flow::interface11::priority_queue_node< T, Compare, A >::base_type

Definition at line 2377 of file flow_graph.h.

## class_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef priority_queue_node tbb::flow::interface11::priority_queue_node< T, Compare, A >::class_type

Definition at line 2378 of file flow_graph.h.

## input_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef T tbb::flow::interface11::priority_queue_node< T, Compare, A >::input_type

Definition at line 2375 of file flow_graph.h.

## item_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef buffer_node<T, A>::item_type tbb::flow::interface11::priority_queue_node< T, Compare, A >::item_type

protected

Definition at line 2419 of file flow_graph.h.

## output_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef T tbb::flow::interface11::priority_queue_node< T, Compare, A >::output_type

Definition at line 2376 of file flow_graph.h.

## predecessor_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef receiver<input_type>::predecessor_type tbb::flow::interface11::priority_queue_node< T, Compare, A >::predecessor_type

Definition at line 2379 of file flow_graph.h.

## prio_operation

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef buffer_node<T, A>::buffer_operation tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_operation

protected

Definition at line 2420 of file flow_graph.h.

## size_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef buffer_node<T, A>::size_type tbb::flow::interface11::priority_queue_node< T, Compare, A >::size_type

protected

Definition at line 2418 of file flow_graph.h.

## successor_type

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

typedef sender<output_type>::successor_type tbb::flow::interface11::priority_queue_node< T, Compare, A >::successor_type

Definition at line 2380 of file flow_graph.h.

## Constructor & Destructor Documentation

## priority_queue_node() [1/2]

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

__TBB_NOINLINE_SYM tbb::flow::interface11::priority_queue_node< T, Compare, A >::priority_queue_node | ( | graph & | g,
|  | const Compare & | comp = `Compare()`
| ) |  |

inline explicit

Constructor.

Definition at line 2383 of file flow_graph.h.

: buffer_node<T, A>(g), compare(comp), mark(0) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_PRIORITY_QUEUE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}

References CODEPTR, tbb::internal::fgt_node(), and tbb::flow::interface11::graph_node::my_graph.

Here is the call graph for this function:

## priority_queue_node() [2/2]

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

__TBB_NOINLINE_SYM tbb::flow::interface11::priority_queue_node< T, Compare, A >::priority_queue_node | ( | const priority_queue_node< T, Compare, A > & | src | ) |

inline

Copy constructor.

Definition at line 2399 of file flow_graph.h.

: buffer_node<T, A>(src), mark(0) {
tbb::internal::fgt_node( CODEPTR(), tbb::internal::FLOW_PRIORITY_QUEUE_NODE, &(this->my_graph),
static_cast<receiver<input_type> *>(this),
static_cast<sender<output_type> *>(this) );
}

References CODEPTR, tbb::internal::fgt_node(), and tbb::flow::interface11::graph_node::my_graph.

Here is the call graph for this function:

## Member Function Documentation

## handle_operations()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::handle_operations | ( | prio_operation * | op_list | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2427 of file flow_graph.h.

{
this->handle_operations_impl(op_list, this);
}

References tbb::flow::interface11::buffer_node< T, A >::handle_operations_impl().

Here is the call graph for this function:

## heapify()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::heapify | ( |  | ) |

inline private

Definition at line 2549 of file flow_graph.h.

{
if(this->my_tail == 0) {
mark = 0;
return;
}
if (!mark) mark = 1;
for (; mark<this->my_tail; ++mark) { // for each unheaped element
size_type cur_pos = mark;
input_type to_place;
this->fetch_item(mark,to_place);
do { // push to_place up the heap
size_type parent = (cur_pos-1)>>1;
if (!compare(this->get_my_item(parent), to_place))
break;
this->move_item(cur_pos, parent);
cur_pos = parent;
} while( cur_pos );
(void) this->place_item(cur_pos, to_place);
}
}

References tbb::flow::interface11::priority_queue_node< T, Compare, A >::compare, internal::item_buffer< T, A >::fetch_item(), internal::item_buffer< T, A >::get_my_item(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark, internal::item_buffer< T, A >::move_item(), internal::item_buffer< T, A >::my_tail, parent, internal::item_buffer< T, A >::place_item(), and void.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::order().

Here is the call graph for this function:
Here is the caller graph for this function:

## internal_consume()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_consume | ( | prio_operation * | op | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2463 of file flow_graph.h.

{
__TBB_store_with_release(op->status, internal::SUCCEEDED);
this->my_reserved = false;
reserved_item = input_type();
}

References tbb::internal::__TBB_store_with_release(), internal::reservable_item_buffer< T, A >::my_reserved, tbb::flow::interface11::priority_queue_node< T, Compare, A >::reserved_item, and internal::SUCCEEDED.

Here is the call graph for this function:

## internal_forward_task()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_forward_task | ( | prio_operation * | op | ) |

inline protected virtual

Tries to forward valid items to successors.

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2423 of file flow_graph.h.

{
this->internal_forward_task_impl(op, this);
}

References tbb::flow::interface11::buffer_node< T, A >::internal_forward_task_impl().

Here is the call graph for this function:

## internal_pop()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_pop | ( | prio_operation * | op | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2437 of file flow_graph.h.

{
// if empty or already reserved, don't pop
if ( this->my_reserved == true || this->my_tail == 0 ) {
__TBB_store_with_release(op->status, internal::FAILED);
return;
}
*(op->elem) = prio();
__TBB_store_with_release(op->status, internal::SUCCEEDED);
prio_pop();
}

References tbb::internal::__TBB_store_with_release(), internal::FAILED, internal::reservable_item_buffer< T, A >::my_reserved, internal::item_buffer< T, A >::my_tail, tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop(), and internal::SUCCEEDED.

Here is the call graph for this function:

## internal_push()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

bool tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_push | ( | prio_operation * | op | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2431 of file flow_graph.h.

{
prio_push(*(op->elem));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
return true;
}

References tbb::internal::__TBB_store_with_release(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_push(), and internal::SUCCEEDED.

Here is the call graph for this function:

## internal_release()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_release | ( | prio_operation * | op | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2469 of file flow_graph.h.

{
__TBB_store_with_release(op->status, internal::SUCCEEDED);
prio_push(reserved_item);
this->my_reserved = false;
reserved_item = input_type();
}

References tbb::internal::__TBB_store_with_release(), internal::reservable_item_buffer< T, A >::my_reserved, tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_push(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::reserved_item, and internal::SUCCEEDED.

Here is the call graph for this function:

## internal_reserve()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_reserve | ( | prio_operation * | op | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2451 of file flow_graph.h.

{
if (this->my_reserved == true || this->my_tail == 0) {
__TBB_store_with_release(op->status, internal::FAILED);
return;
}
this->my_reserved = true;
*(op->elem) = prio();
reserved_item = *(op->elem);
__TBB_store_with_release(op->status, internal::SUCCEEDED);
prio_pop();
}

References tbb::internal::__TBB_store_with_release(), internal::FAILED, internal::reservable_item_buffer< T, A >::my_reserved, internal::item_buffer< T, A >::my_tail, tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::reserved_item, and internal::SUCCEEDED.

Here is the call graph for this function:

## is_item_valid()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

bool tbb::flow::interface11::priority_queue_node< T, Compare, A >::is_item_valid | ( |  | ) |

inline private

Definition at line 2484 of file flow_graph.h.

{
return this->my_tail > 0;
}

References internal::item_buffer< T, A >::my_tail.

## order()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::order | ( |  | ) |

inline private

Definition at line 2479 of file flow_graph.h.

{
if (mark < this->my_tail) heapify();
__TBB_ASSERT(mark == this->my_tail, "mark unequal after heapify");
}

References __TBB_ASSERT, tbb::flow::interface11::priority_queue_node< T, Compare, A >::heapify(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark, and internal::item_buffer< T, A >::my_tail.

Here is the call graph for this function:

## prio()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

const T& tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio | ( |  | ) |

inline private

Definition at line 2544 of file flow_graph.h.

{
return this->get_my_item(prio_use_tail() ? this->my_tail-1 : 0);
}

References internal::item_buffer< T, A >::get_my_item(), internal::item_buffer< T, A >::my_tail, and tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_use_tail().

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_reserve(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::try_put_and_add_task().

Here is the call graph for this function:
Here is the caller graph for this function:

## prio_pop()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop | ( |  | ) |

inline private

Definition at line 2522 of file flow_graph.h.

{
if (prio_use_tail()) {
// there are newly pushed elements; last one higher than top
// copy the data
this->destroy_item(this->my_tail-1);
--(this->my_tail);
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds after pop");
return;
}
this->destroy_item(0);
if(this->my_tail > 1) {
// push the last element down heap
__TBB_ASSERT(this->my_item_valid(this->my_tail - 1), NULL);
this->move_item(0,this->my_tail - 1);
}
--(this->my_tail);
if(mark > this->my_tail) --mark;
if (this->my_tail > 1) // don't reheap for heap of size 1
reheap();
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds after pop");
}

References __TBB_ASSERT, internal::item_buffer< T, A >::destroy_item(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark, internal::item_buffer< T, A >::move_item(), internal::item_buffer< T, A >::my_item_valid(), internal::item_buffer< T, A >::my_tail, tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_use_tail(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::reheap().

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_reserve(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::try_put_and_add_task().

Here is the call graph for this function:
Here is the caller graph for this function:

## prio_push()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_push | ( | const T & | src | ) |

inline private

Definition at line 2511 of file flow_graph.h.

{
if ( this->my_tail >= this->my_array_size )
this->grow_my_array( this->my_tail + 1 );
(void) this->place_item(this->my_tail, src);
++(this->my_tail);
__TBB_ASSERT(mark < this->my_tail, "mark outside bounds after push");
}

References __TBB_ASSERT, internal::item_buffer< T, A >::grow_my_array(), internal::item_buffer< T, A >::my_array_size, internal::item_buffer< T, A >::my_tail, internal::item_buffer< T, A >::place_item(), and void.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_push(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_release().

Here is the call graph for this function:
Here is the caller graph for this function:

## prio_use_tail()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

bool tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_use_tail | ( |  | ) |

inline private

Definition at line 2505 of file flow_graph.h.

{
__TBB_ASSERT(mark <= this->my_tail, "mark outside bounds before test");
return mark < this->my_tail && compare(this->get_my_item(0), this->get_my_item(this->my_tail - 1));
}

References __TBB_ASSERT, tbb::flow::interface11::priority_queue_node< T, Compare, A >::compare, internal::item_buffer< T, A >::get_my_item(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark, and internal::item_buffer< T, A >::my_tail.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop().

Here is the call graph for this function:
Here is the caller graph for this function:

## reheap()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::reheap | ( |  | ) |

inline private

Definition at line 2571 of file flow_graph.h.

{
size_type cur_pos=0, child=1;
while (child < mark) {
size_type target = child;
if (child+1<mark &&
compare(this->get_my_item(child),
this->get_my_item(child+1)))
++target;
// target now has the higher priority child
if (compare(this->get_my_item(target),
this->get_my_item(cur_pos)))
break;
// swap
this->swap_items(cur_pos, target);
cur_pos = target;
child = (cur_pos<<1)+1;
}
}

References tbb::flow::interface11::priority_queue_node< T, Compare, A >::compare, internal::item_buffer< T, A >::get_my_item(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark, and internal::item_buffer< T, A >::swap_items().

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop().

Here is the call graph for this function:
Here is the caller graph for this function:

## reset_node()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::reset_node | ( | reset_flags | f | ) |

inline protected virtual

Reimplemented from tbb::flow::interface11::buffer_node< T, A >.

Definition at line 2413 of file flow_graph.h.

{
mark = 0;
base_type::reset_node(f);
}

References tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark, and tbb::flow::interface11::buffer_node< T, A >::reset_node().

Here is the call graph for this function:

## try_put_and_add_task()

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

void tbb::flow::interface11::priority_queue_node< T, Compare, A >::try_put_and_add_task | ( | task *& | last_task | ) |

inline private

Definition at line 2488 of file flow_graph.h.

{
task * new_task = this->my_successors.try_put_task(this->prio());
if (new_task) {
// workaround for icc bug
graph& graph_ref = this->graph_reference();
last_task = combine_tasks(graph_ref, last_task, new_task);
prio_pop();
}
}

References tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::buffer_node< T, A >::graph_reference(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop().

Here is the call graph for this function:

## Friends And Related Function Documentation

## buffer_node

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>
template<typename , typename >

friend class buffer_node

friend

Definition at line 2477 of file flow_graph.h.

## Member Data Documentation

## compare

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

Compare tbb::flow::interface11::priority_queue_node< T, Compare, A >::compare

private

Definition at line 2499 of file flow_graph.h.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::heapify(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_use_tail(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::reheap().

## mark

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

size_type tbb::flow::interface11::priority_queue_node< T, Compare, A >::mark

private

Definition at line 2500 of file flow_graph.h.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::heapify(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::order(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::prio_use_tail(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::reheap(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::reset_node().

## reserved_item

template<typename T , typename Compare = std::less<T>, typename A = cache_aligned_allocator<T>>

input_type tbb::flow::interface11::priority_queue_node< T, Compare, A >::reserved_item

private

Definition at line 2502 of file flow_graph.h.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_consume(), tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_release(), and tbb::flow::interface11::priority_queue_node< T, Compare, A >::internal_reserve().

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

- flow_graph.h

internal::item_buffer::swap_items
void swap_items(size_t i, size_t j)
Definition: _flow_graph_item_buffer_impl.h:116
tbb::flow::interface11::priority_queue_node::reserved_item
input_type reserved_item
Definition: flow_graph.h:2502
tbb::flow::interface11::buffer_node::internal_forward_task_impl
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
Definition: flow_graph.h:1940
internal::SUCCEEDED
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::priority_queue_node::prio_pop
void prio_pop()
Definition: flow_graph.h:2522
void
void
Definition: ittnotify_static.h:91
tbb::flow::interface11::priority_queue_node::prio
const T & prio()
Definition: flow_graph.h:2544
CODEPTR
#define CODEPTR()
Definition: _flow_graph_trace_impl.h:297
internal::item_buffer::get_my_item
const item_type & get_my_item(size_t i) const
Definition: _flow_graph_item_buffer_impl.h:73
tbb::flow::interface11::priority_queue_node::prio_use_tail
bool prio_use_tail()
Definition: flow_graph.h:2505
internal::item_buffer::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:69
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::flow::interface11::priority_queue_node::reheap
void reheap()
Definition: flow_graph.h:2571
internal::item_buffer::my_tail
size_type my_tail
Definition: _flow_graph_item_buffer_impl.h:53
tbb::flow::interface11::priority_queue_node::size_type
buffer_node< T, A >::size_type size_type
Definition: flow_graph.h:2418
tbb::flow::interface11::combine_tasks
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:191
tbb::flow::interface11::priority_queue_node::compare
Compare compare
Definition: flow_graph.h:2499
tbb::flow::interface11::priority_queue_node::prio_push
void prio_push(const T &src)
Definition: flow_graph.h:2511
internal::item_buffer::fetch_item
void fetch_item(size_t i, item_type &o)
Definition: _flow_graph_item_buffer_impl.h:89
tbb::flow::interface11::graph_node::my_graph
graph & my_graph
Definition: _flow_graph_impl.h:464
internal::item_buffer::my_array_size
size_type my_array_size
Definition: _flow_graph_item_buffer_impl.h:50
tbb::internal::__TBB_store_with_release
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:716
internal::item_buffer::move_item
void move_item(size_t to, size_t from)
Definition: _flow_graph_item_buffer_impl.h:98
internal::item_buffer::destroy_item
void destroy_item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:123
internal::item_buffer::grow_my_array
void grow_my_array(size_t minimum_size)
Grows the internal array.
Definition: _flow_graph_item_buffer_impl.h:159
parent
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 __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id parent
Definition: ittnotify_static.h:176
tbb::flow::interface11::priority_queue_node::mark
size_type mark
Definition: flow_graph.h:2500
tbb::flow::interface11::buffer_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2191
tbb::flow::interface11::graph_node::graph
friend class graph
Definition: _flow_graph_impl.h:455
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
internal::reservable_item_buffer::my_reserved
bool my_reserved
Definition: _flow_graph_item_buffer_impl.h:279
internal::FAILED
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::buffer_node::my_successors
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:1717
tbb::internal::fgt_node
static void fgt_node(void *, string_index, void *, void *)
Definition: _flow_graph_trace_impl.h:326
tbb::flow::interface11::priority_queue_node::input_type
T input_type
Definition: flow_graph.h:2375
tbb::flow::interface11::priority_queue_node::heapify
void heapify()
Definition: flow_graph.h:2549
tbb::flow::interface11::buffer_node::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2176
tbb::flow::interface11::buffer_node::handle_operations_impl
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
Definition: flow_graph.h:1774
internal::item_buffer::place_item
bool place_item(size_t here, const item_type &me)
Definition: _flow_graph_item_buffer_impl.h:107

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.