SplPriorityQueue
class SplPriorityQueue implements Iterator, Countable (View source)
Constants
EXTR_BOTH |
|
EXTR_PRIORITY |
|
EXTR_DATA |
|
Methods
Compare priorities in order to place elements correctly in the heap while sifting up.
Inserts an element in the queue by sifting it up.
Sets the mode of extraction
Peeks at the node from the top of the queue
Extracts a node from top of the heap and sift up.
Counts the number of elements in the queue.
Checks whether the queue is empty.
Rewind iterator back to the start (no-op)
Return current node pointed by the iterator
Return current node index
Move to the next node
Check whether the queue contains more nodes
Recover from the corrupted state and allow further actions on the queue.
No description
No description
No description
Details
int
compare(TPriority $priority1, TPriority $priority2)
Compare priorities in order to place elements correctly in the heap while sifting up.
true
insert(TValue $value, TPriority $priority)
Inserts an element in the queue by sifting it up.
int
setExtractFlags(int $flags)
Sets the mode of extraction
mixed
top()
Peeks at the node from the top of the queue
mixed
extract()
Extracts a node from top of the heap and sift up.
int
count()
Counts the number of elements in the queue.
bool
isEmpty()
Checks whether the queue is empty.
void
rewind()
Rewind iterator back to the start (no-op)
mixed
current()
Return current node pointed by the iterator
mixed
key()
Return current node index
void
next()
Move to the next node
bool
valid()
Check whether the queue contains more nodes
true
recoverFromCorruption()
Recover from the corrupted state and allow further actions on the queue.
bool
isCorrupted()
No description
int
getExtractFlags()
No description
array
__debugInfo()
No description