Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority > Class Template Reference

Detailed Description

An abstract data-type in which each element additionally has a "priority" associated with it. An element with high priority is served before an element with low priority.

Template Parameters
TElementSpecifies the type of elements in the queue.
TPrioritySpecifies the type of priority measure in the queue.
Inheritance diagram for Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >:
Collaboration diagram for Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >:

Public Member Functions

 PriorityQueue ()
 Initializes a new instance of the PriorityQueue<TElement, TPriority> class that uses a default comparer.
 
 PriorityQueue (int initialCapacity)
 Initializes a new instance of the PriorityQueue<TElement, TPriority> class that has the specified initial capacity. More...
 
 PriorityQueue (IComparer< TPriority > comparer)
 Initializes a new instance of the PriorityQueue<TElement, TPriority> class that uses a specified comparer. More...
 
 PriorityQueue (int initialCapacity, IComparer< TPriority > comparer)
 Initializes a new instance of the PriorityQueue<TElement, TPriority> class that is empty, has the specified initial capacity, and uses a specified comparer. More...
 
 PriorityQueue (IEnumerable<(TElement Element, TPriority Priority)> values)
 Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a default comparer. More...
 
 PriorityQueue (IEnumerable<(TElement Element, TPriority Priority)> values, IComparer< TPriority > comparer)
 Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a specified comparer. More...
 
void Enqueue (TElement element, TPriority priority)
 Adds an object to the into the PriorityQueue<TElement, TPriority> by its priority. More...
 
TElement Peek ()
 Returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>. More...
 
bool TryPeek (out TElement element, out TPriority priority)
 Attempts to Peek the element with the lowest priority from the PriorityQueue<TElement, TPriority>. More...
 
TElement Dequeue ()
 Removes and returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>. More...
 
bool TryDequeue (out TElement element, out TPriority priority)
 Attempts to Dequeue the object with the lowest priority from the PriorityQueue<TElement, TPriority>. More...
 
void Clear ()
 Removes all elements from the PriorityQueue<TElement, TPriority>.
 
void CopyTo (Array array, int index)
 Copies the elements of the PriorityQueue<TElement, TPriority> to an Array, starting at a particular Array index. More...
 
TElement TPriority Priority[] ToArray ()
 

Public Attributes

TElement Element
 Copies the elements stored in the PriorityQueue<TElement, TPriority> to a new array. More...
 

Properties

int Count [get]
 Gets the number of elements contained in the PriorityQueue<TElement, TPriority>. More...
 
IComparer< TPriority > Comparer [get]
 Gets the IComparer<T> for the PriorityQueue<TElement, TPriority>. More...
 
bool IsSynchronized [get]
 Gets a value that indicates whether access to the ICollection is synchronized with the SyncRoot. More...
 
object SyncRoot [get]
 Gets an object that can be used to synchronize access to the ICollection. More...
 

Constructor & Destructor Documentation

◆ PriorityQueue() [1/5]

Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue ( int  initialCapacity)

Initializes a new instance of the PriorityQueue<TElement, TPriority> class that has the specified initial capacity.

Parameters
initialCapacityThe initial number of elements that the PriorityQueue<TElement, TPriority> can contain.
Exceptions
ArgumentOutOfRangeExceptioninitialCapacity is less than zero.

◆ PriorityQueue() [2/5]

Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue ( IComparer< TPriority >  comparer)

Initializes a new instance of the PriorityQueue<TElement, TPriority> class that uses a specified comparer.

Parameters
comparerThe IComparer<T> to use when comparing elements.

◆ PriorityQueue() [3/5]

Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue ( int  initialCapacity,
IComparer< TPriority >  comparer 
)

Initializes a new instance of the PriorityQueue<TElement, TPriority> class that is empty, has the specified initial capacity, and uses a specified comparer.

Parameters
initialCapacityThe initial number of elements that the PriorityQueue<TElement, TPriority> can contain.
comparerThe IComparer<T> to use when comparing elements.
Exceptions
ArgumentOutOfRangeExceptioninitialCapacity is less than zero.

◆ PriorityQueue() [4/5]

Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue ( IEnumerable<(TElement Element, TPriority Priority)>  values)

Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a default comparer.

Parameters
valuesThe collection whose elements are copied to the new PriorityQueue<TElement, TPriority>.

◆ PriorityQueue() [5/5]

Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.PriorityQueue ( IEnumerable<(TElement Element, TPriority Priority)>  values,
IComparer< TPriority >  comparer 
)

Initializes a new instance of the PriorityQueue<TElement, TPriority> class that contains elements copied from the specified collection and uses a specified comparer.

Parameters
valuesThe collection whose elements are copied to the new PriorityQueue<TElement, TPriority>.
comparerThe IComparer<T> to use when comparing elements.

Member Function Documentation

◆ CopyTo()

void Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.CopyTo ( Array  array,
int  index 
)

Copies the elements of the PriorityQueue<TElement, TPriority> to an Array, starting at a particular Array index.

Parameters
arrayThe one-dimensional Array that is the destination of the elements copied from the PriorityQueue<TElement, TPriority>. The Array must have zero-based indexing.
indexThe zero-based index in array at which copying begins.
Exceptions
ArgumentNullExceptionarray is null.
ArgumentOutOfRangeExceptionindex is less than zero. -or- index is equal to or greater than the length of the array
ArgumentNullExceptionarray is null.
ArgumentExceptionThe number of elements in the source ICollection is greater than the available space from index to the end of the destination array .

◆ Dequeue()

TElement Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Dequeue ( )

Removes and returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>.

Returns
The object with the lowest priority that is removed from the PriorityQueue<TElement, TPriority>.
Exceptions
InvalidOperationExceptionThe PriorityQueue<TElement, TPriority> is empty.

◆ Enqueue()

void Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Enqueue ( TElement  element,
TPriority  priority 
)

Adds an object to the into the PriorityQueue<TElement, TPriority> by its priority.

Parameters
elementThe object to add to the PriorityQueue<TElement, TPriority>. The value can be null for reference types.
priorityThe priority of the object at the queue.

◆ Peek()

TElement Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Peek ( )

Returns the object with the lowest priority in the PriorityQueue<TElement, TPriority>.

Exceptions
InvalidOperationExceptionThe PriorityQueue<TElement, TPriority> is empty.

◆ TryDequeue()

bool Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.TryDequeue ( out TElement  element,
out TPriority  priority 
)

Attempts to Dequeue the object with the lowest priority from the PriorityQueue<TElement, TPriority>.

Parameters
elementDequeued element.
priorityDequeued element's priority.
Returns
Operation result.

◆ TryPeek()

bool Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.TryPeek ( out TElement  element,
out TPriority  priority 
)

Attempts to Peek the element with the lowest priority from the PriorityQueue<TElement, TPriority>.

Parameters
elementDequeued element.
priorityDequeued element's priority.
Returns
Operation result.

Member Data Documentation

◆ Element

TElement Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Element

Copies the elements stored in the PriorityQueue<TElement, TPriority> to a new array.

Returns
A new array containing a snapshot of elements copied from the PriorityQueue<TElement, TPriority>.

Property Documentation

◆ Comparer

IComparer<TPriority> Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Comparer
get

Gets the IComparer<T> for the PriorityQueue<TElement, TPriority>.

The IComparer<T> that is used when comparing elements in the PriorityQueue<TElement, TPriority>.

◆ Count

int Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.Count
get

Gets the number of elements contained in the PriorityQueue<TElement, TPriority>.

The number of elements contained in the PriorityQueue<TElement, TPriority>.

◆ IsSynchronized

bool Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.IsSynchronized
get

Gets a value that indicates whether access to the ICollection is synchronized with the SyncRoot.

true if access to the ICollection is synchronized with the SyncRoot; otherwise, false. For PriorityQueue<TElement, TPriority>, this property always returns false.

◆ SyncRoot

object Doloro.DataManagement.Collections.Generic.PriorityQueue< TElement, TPriority >.SyncRoot
get

Gets an object that can be used to synchronize access to the ICollection.

An object that can be used to synchronize access to the ICollection.


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