FARGOS/VISTA Object Management Environment Core
..
|
Encapsulation class for a priority queue. More...
#include <OrderedInput.hpp>
Classes | |
struct | ltOrderedInputBlockPtr |
Less-than operator for OrderedInputBlock pointers. More... | |
Public Member Functions | |
OrderedInputPriorityQueue () | |
~OrderedInputPriorityQueue () | |
size_t | getQueueLength () const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") |
Returns the number of entries in the queue. More... | |
OrderedInputBlock * | popNextBlock (uint_fast8_t decrementBy=1) OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") NONNULL_RETURN |
Removes the first element from the queue and returns it. More... | |
void | removeNextBlock (uint_fast8_t decrementBy=1) OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") |
Specialized routine that does the equivalent of popNextBlock(), but does not intend to examine the block. More... | |
OrderedInputBlock * | peekNextBlock () const OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") NONNULL_RETURN |
Similar to popNextBlock() but does not remove the entry from the queue. More... | |
void | pushBlock (OrderedInputBlock *block, uint_fast8_t incrementBy=1) OME_ALWAYS_INLINE OME_ALWAYS_OPTIMIZE("-O3") |
Add a new entry to the queue. More... | |
Protected Types | |
typedef std::vector< OrderedInputBlock * > | pQueueContainer_t |
Protected Attributes | |
std::priority_queue< OrderedInputBlock *, pQueueContainer_t, ltOrderedInputBlockPtr > | pQueue |
size_t | pQueueSize |
Encapsulation class for a priority queue.
The interface provided by this class allows the OrderedMultipleInputFilter logic to be separated from the actual implementation selected to realize a priority queue.
There are 5 functions implemented, which could be abstracted as an interface if a cost was not incurred. For the time being, these are not virtual functions.
The getQueueLength() function returns how many elements are in the queue. A value of 0 serves to indicate an empty queue. The count is maintained as a variable that can be retrieved using a single load instruction, so the cost is O(1).
The peekNextBlock() function gets the next element without affecting the queue, whereas removeNextBlock() simply removes the next element without examining it. The popNextBlock() function combines both to retrieve the next block and remove it from the queue. New elements are added via pushBlock().
|
protected |
|
inline |
|
inline |
References OrderedInputBlock::inputFile.
|
inline |
Returns the number of entries in the queue.
Referenced by OrderedInputSourceProxyWithReordering::getNextInputBlock(), OrderedMultipleInputFilter::inputSourceTotal(), OrderedMultipleInputFilter::isQueueEmpty(), OrderedMultipleInputFilter::processInputFiles(), OrderedMultipleInputFilter::processQueue(), OrderedMultipleInputFilter::purgeQueue(), and OrderedInputSourceProxyWithReordering::totalBlocksPending().
|
inline |
Similar to popNextBlock() but does not remove the entry from the queue.
References OME_PREFETCH.
Referenced by OrderedMultipleInputFilter::processQueue().
|
inline |
Removes the first element from the queue and returns it.
decrementBy | is an optional parameter that can be set to 0 if the client knows it will do an immediate pushBlock() with an increment of 0. This special scenario enables the increment/decrement instructions to be optimized away. |
References OME_PREFETCH.
Referenced by OrderedInputSourceProxyWithReordering::getNextInputBlock(), and OrderedMultipleInputFilter::purgeQueue().
|
inline |
Add a new entry to the queue.
block | specifies the block to be added. |
incrementBy | is an optional parameter that can be set to 0 if the client knows it just did a removeNextBlock() call with a decrement of 0. This usage enables the increment/decrement instructions to be optimized away. |
Referenced by OrderedInputSourceProxyWithReordering::getNextInputBlock(), OrderedInputSourceProxyWithReordering::OrderedInputSourceProxyWithReordering(), OrderedMultipleInputFilter::preloadQueue(), and OrderedMultipleInputFilter::processQueue().
|
inline |
Specialized routine that does the equivalent of popNextBlock(), but does not intend to examine the block.
decrementBy | is an optional parameter that can be set to 0 if the client knows it will do an immediate pushBlock() with an increment of 0. This sequence enables the increment/decrement instructions to be optimized away. |
Referenced by OrderedMultipleInputFilter::processQueue().
|
protected |
|
protected |
![]() | Generated: Fri Jul 31 2020 18:19:16
Support Information |