Class DynamicPriorityQueue<T>
Inheritance
DynamicPriorityQueue<T>
Namespace: g3
Assembly: cs.temp.dll.dll
Syntax
public class DynamicPriorityQueue<T> : IEnumerable<T>, IEnumerable where T : DynamicPriorityQueueNode
Type Parameters
Constructors
DynamicPriorityQueue()
Declaration
public DynamicPriorityQueue()
Fields
EnableDebugChecks
Declaration
public bool EnableDebugChecks
Field Value
Properties
Count
number of nodes currently in queue
Declaration
public int Count { get; }
Property Value
First
Declaration
Property Value
FirstPriority
Priority of node at head of queue
Declaration
public float FirstPriority { get; }
Property Value
Methods
Clear(Boolean)
reset the queue to empty state.
if bFreeMemory is false, we don't discard internal data structures, so there will be less allocation next time
(this does not make a huge difference...)
Declaration
public void Clear(bool bFreeMemory = true)
Parameters
Type |
Name |
Description |
Boolean |
bFreeMemory |
|
Contains(T)
constant-time check to see if node is already in queue
Declaration
public bool Contains(T node)
Parameters
Type |
Name |
Description |
T |
node |
|
Returns
DebugPrint()
Declaration
Dequeue()
remove node at head of queue, update queue, and return that node
Declaration
Returns
Enqueue(T, Single)
Add node to list w/ given priority
Behavior is undefined if you call w/ same node twice
Declaration
public void Enqueue(T node, float priority)
Parameters
Type |
Name |
Description |
T |
node |
|
Single |
priority |
|
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
IsValidQueue()
Check if queue has been corrupted
Declaration
public bool IsValidQueue()
Returns
Remove(T)
remove this node from queue. Undefined behavior if called w/ same node twice!
Behavior is undefined if you call w/ node that is not in queue
Declaration
public void Remove(T node)
Parameters
Type |
Name |
Description |
T |
node |
|
Update(T, Single)
update priority at node, and then move it to correct position in queue
Behavior is undefined if you call w/ node that is not in queue
Declaration
public void Update(T node, float priority)
Parameters
Type |
Name |
Description |
T |
node |
|
Single |
priority |
|
Implements