Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Priority queue implemented as an unsorted array. More...
#include <PriorityQueue.h>
Classes | |
struct | Item |
Public Member Functions | |
void | push (const Item &item) |
Item * | find (ID id) |
void | promote (ID id, R oldrank, R newrank, H newh) |
Item | pop () |
bool | empty () |
size_t | size () |
void | clear () |
Public Attributes | |
std::vector< Item > | m_List |
Priority queue implemented as an unsorted array.
This means pop() is O(n), but push and promote are O(1), and n is typically small (average around 50-100 in some rough tests). It seems fractionally slower than a binary heap in optimised builds, but is much simpler and less susceptible to MSVC's painfully slow debug STL.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::vector<Item> PriorityQueueList< ID, R, H, CMP >::m_List |