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

Forwards messages in priority order. More...

`#include <flow_graph.h>`

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

## Public Types

typedef T | input_type
typedef T | output_type
typedef buffer_node< T, Allocator > | 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, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
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, __TBB_DEFAULT_NODE_ALLOCATOR(T) > | class_type
Public Types inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
enum | buffer_item_state
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_STATIC_ASSERT ((tbb::internal::is_same_type< Allocator, null_type >::value), "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. " "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR.")
__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, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
| __TBB_STATIC_ASSERT ((tbb::internal::is_same_type< __TBB_DEFAULT_NODE_ALLOCATOR(T), null_type >::value), "__TBB_DEFAULT_NODE_ALLOCATOR(T) template parameter for flow graph nodes is deprecated and will be removed. " "Specify TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to temporary enable the deprecated interface.")
__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, cache_aligned_allocator< T > >
| reservable_item_buffer ()
void | reset ()
Public Member Functions inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
| 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, Allocator >::size_type | size_type
typedef buffer_node< T, Allocator >::item_type | item_type
typedef buffer_node< T, Allocator >::buffer_operation | prio_operation
Protected Types inherited from tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
enum | op_type
typedef size_t | size_type
typedef internal::aggregating_functor< class_type, buffer_operation > | handler_type
Protected Types inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
typedef size_t | size_type
typedef aligned_pair< item_type, buffer_item_state >::type | buffer_item_type
typedef tbb::internal::allocator_rebind< cache_aligned_allocator< T >, buffer_item_type >::type | 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, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
virtual void | handle_operations (buffer_operation *op_list)
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...
virtual void | internal_forward_task (buffer_operation *op)
| Tries to forward valid items to successors. More...
void | internal_forward_task_impl (buffer_operation *op, derived_type *derived)
virtual bool | internal_push (buffer_operation *op)
virtual void | internal_pop (buffer_operation *op)
virtual void | internal_reserve (buffer_operation *op)
virtual void | internal_consume (buffer_operation *op)
virtual void | internal_release (buffer_operation *op)
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...
void | reset_node (reset_flags f) __TBB_override
Protected Member Functions inherited from internal::reservable_item_buffer< T, cache_aligned_allocator< T > >
bool | reserve_front (T &v)
void | consume_front ()
void | release_front ()
Protected Member Functions inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
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, __TBB_DEFAULT_NODE_ALLOCATOR(T) >
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, cache_aligned_allocator< T > >
bool | my_reserved
Protected Attributes inherited from internal::item_buffer< T, cache_aligned_allocator< T > >
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, cache_aligned_allocator< T > >
static const size_type | initial_buffer_size

## Detailed Description

### template<typename T, typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
class tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >

Forwards messages in priority order.

Definition at line 2749 of file flow_graph.h.

## Member Typedef Documentation

## base_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

Definition at line 2760 of file flow_graph.h.

## class_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

Definition at line 2761 of file flow_graph.h.

## input_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

Definition at line 2758 of file flow_graph.h.

## item_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

protected

Definition at line 2804 of file flow_graph.h.

## output_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

Definition at line 2759 of file flow_graph.h.

## predecessor_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

Definition at line 2762 of file flow_graph.h.

## prio_operation

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

protected

Definition at line 2805 of file flow_graph.h.

## size_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

protected

Definition at line 2803 of file flow_graph.h.

## successor_type

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

Definition at line 2763 of file flow_graph.h.

## Constructor & Destructor Documentation

## priority_queue_node() [1/2]

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline explicit

Constructor.

Definition at line 2766 of file flow_graph.h.

: buffer_node<T, Allocator>(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) );
}
CODEPTR
#define CODEPTR()
Definition: _flow_graph_trace_impl.h:297
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::mark
size_type mark
Definition: flow_graph.h:2885
tbb::flow::interface11::priority_queue_node::compare
Compare compare
Definition: flow_graph.h:2884
tbb::flow::interface11::graph_node::my_graph
graph & my_graph
Definition: _flow_graph_impl.h:464

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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline

Copy constructor.

Definition at line 2782 of file flow_graph.h.

: buffer_node<T, Allocator>(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

## __TBB_STATIC_ASSERT()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::__TBB_STATIC_ASSERT | ( | (tbb::internal::is_same_type< Allocator, null_type >::value) | ,
|  | "Allocator template parameter for flow graph nodes is deprecated and will removed in the future. " "To temporary enable the deprecated interface specify TBB_ENABLE_DEPRECATED_NODE_ALLOCATOR." |
| ) |  |

## handle_operations()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Definition at line 2812 of file flow_graph.h.

{
this->handle_operations_impl(op_list, this);
}
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::handle_operations_impl
void handle_operations_impl(buffer_operation *op_list, derived_type *derived)
Definition: flow_graph.h:2134

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

Here is the call graph for this function:

## heapify()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2934 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);
}
}
void
void
Definition: ittnotify_static.h:91
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::input_type
T input_type
Definition: flow_graph.h:2758
tbb::flow::interface11::priority_queue_node::size_type
buffer_node< T, Allocator >::size_type size_type
Definition: flow_graph.h:2803
internal::item_buffer< T, cache_aligned_allocator< T > >::move_item
void move_item(size_t to, size_t from)
Definition: _flow_graph_item_buffer_impl.h:97
internal::item_buffer< T, cache_aligned_allocator< T > >::get_my_item
const item_type & get_my_item(size_t i) const
Definition: _flow_graph_item_buffer_impl.h:72
internal::item_buffer< T, cache_aligned_allocator< T > >::my_tail
size_type my_tail
Definition: _flow_graph_item_buffer_impl.h:52
internal::item_buffer< T, cache_aligned_allocator< T > >::place_item
bool place_item(size_t here, const item_type &me)
Definition: _flow_graph_item_buffer_impl.h:106
internal::item_buffer< T, cache_aligned_allocator< T > >::fetch_item
void fetch_item(size_t i, item_type &o)
Definition: _flow_graph_item_buffer_impl.h:88

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

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Definition at line 2848 of file flow_graph.h.

{
__TBB_store_with_release(op->status, internal::SUCCEEDED);
this->my_reserved = false;
reserved_item = input_type();
}
tbb::internal::__TBB_store_with_release
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:716
internal::SUCCEEDED
@ SUCCEEDED
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::priority_queue_node::reserved_item
input_type reserved_item
Definition: flow_graph.h:2887
internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::my_reserved
bool my_reserved
Definition: _flow_graph_item_buffer_impl.h:278

References tbb::internal::__TBB_store_with_release(), internal::reservable_item_buffer< T, cache_aligned_allocator< T > >::my_reserved, tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Tries to forward valid items to successors.

Definition at line 2808 of file flow_graph.h.

{
this->internal_forward_task_impl(op, this);
}
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::internal_forward_task_impl
void internal_forward_task_impl(buffer_operation *op, derived_type *derived)
Definition: flow_graph.h:2299

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

Here is the call graph for this function:

## internal_pop()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Definition at line 2822 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();
}
internal::FAILED
@ FAILED
Definition: _flow_graph_types_impl.h:719
tbb::flow::interface11::priority_queue_node::prio
const T & prio()
Definition: flow_graph.h:2929
tbb::flow::interface11::priority_queue_node::prio_pop
void prio_pop()
Definition: flow_graph.h:2907

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

Here is the call graph for this function:

## internal_push()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Definition at line 2816 of file flow_graph.h.

{
prio_push(*(op->elem));
__TBB_store_with_release(op->status, internal::SUCCEEDED);
return true;
}
tbb::flow::interface11::priority_queue_node::prio_push
void prio_push(const T &src)
Definition: flow_graph.h:2896

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

Here is the call graph for this function:

## internal_release()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Definition at line 2854 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, cache_aligned_allocator< T > >::my_reserved, tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::prio_push(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::reserved_item, and internal::SUCCEEDED.

Here is the call graph for this function:

## internal_reserve()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected

Definition at line 2836 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, cache_aligned_allocator< T > >::my_reserved, internal::item_buffer< T, cache_aligned_allocator< T > >::my_tail, tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::prio(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::prio_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2869 of file flow_graph.h.

{
return this->my_tail > 0;
}

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

## order()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2864 of file flow_graph.h.

{
if (mark < this->my_tail) heapify();
__TBB_ASSERT(mark == this->my_tail, "mark unequal after heapify");
}
__TBB_ASSERT
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:165
tbb::flow::interface11::priority_queue_node::heapify
void heapify()
Definition: flow_graph.h:2934

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

Here is the call graph for this function:

## prio()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2929 of file flow_graph.h.

{
return this->get_my_item(prio_use_tail() ? this->my_tail-1 : 0);
}
tbb::flow::interface11::priority_queue_node::prio_use_tail
bool prio_use_tail()
Definition: flow_graph.h:2890

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

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::internal_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::internal_reserve(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2907 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");
}
tbb::flow::interface11::priority_queue_node::reheap
void reheap()
Definition: flow_graph.h:2956
internal::item_buffer< T, cache_aligned_allocator< T > >::destroy_item
void destroy_item(size_type i)
Definition: _flow_graph_item_buffer_impl.h:122
internal::item_buffer< T, cache_aligned_allocator< T > >::my_item_valid
bool my_item_valid(size_type i) const
Definition: _flow_graph_item_buffer_impl.h:68

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

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::internal_pop(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::internal_reserve(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2896 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");
}
internal::item_buffer< T, cache_aligned_allocator< T > >::grow_my_array
void grow_my_array(size_t minimum_size)
Grows the internal array.
Definition: _flow_graph_item_buffer_impl.h:158
internal::item_buffer< T, cache_aligned_allocator< T > >::my_array_size
size_type my_array_size
Definition: _flow_graph_item_buffer_impl.h:49

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

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::internal_push(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2890 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, Allocator >::compare, internal::item_buffer< T, cache_aligned_allocator< T > >::get_my_item(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::mark, and internal::item_buffer< T, cache_aligned_allocator< T > >::my_tail.

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::prio(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2956 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;
}
}
internal::item_buffer< T, cache_aligned_allocator< T > >::swap_items
void swap_items(size_t i, size_t j)
Definition: _flow_graph_item_buffer_impl.h:115

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

Referenced by tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline protected virtual

Implements tbb::flow::interface11::graph_node.

Definition at line 2798 of file flow_graph.h.

{
mark = 0;
base_type::reset_node(f);
}
tbb::flow::interface11::buffer_node::reset_node
void reset_node(reset_flags f) __TBB_override
Definition: flow_graph.h:2553

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

Here is the call graph for this function:

## try_put_and_add_task()

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

inline private

Definition at line 2873 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();
}
}
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
tbb::flow::interface11::combine_tasks
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:199
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::graph_reference
graph & graph_reference() const __TBB_override
Definition: flow_graph.h:2538
tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::my_successors
internal::round_robin_cache< T, null_rw_mutex > my_successors
Definition: flow_graph.h:2077
tbb::flow::interface11::graph_node::graph
friend class graph
Definition: _flow_graph_impl.h:455

References tbb::flow::interface11::combine_tasks(), tbb::flow::interface11::buffer_node< T, __TBB_DEFAULT_NODE_ALLOCATOR(T) >::graph_reference(), tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::prio(), and tbb::flow::interface11::priority_queue_node< T, Compare, Allocator >::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 Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>
template<typename , typename >

friend class buffer_node

friend

Definition at line 2862 of file flow_graph.h.

## Member Data Documentation

## compare

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

private

Definition at line 2884 of file flow_graph.h.

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

## mark

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

private

Definition at line 2885 of file flow_graph.h.

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

## reserved_item

template<typename T , typename Compare = std::less<T>, typename Allocator = __TBB_DEFAULT_NODE_ALLOCATOR(T)>

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

private

Definition at line 2887 of file flow_graph.h.

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

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

- flow_graph.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.