initialPrefabs logo
  • Home 
  • Blog 
  • Tools 
  • Tags 
  1. Home
  2. Tools
  3. No Alloc Collections Documentation
  4. NoAllocPriorityQueue

NoAllocPriorityQueue

2 min read • 221 words
Tools   API  
Tools   API  
Share via
initialPrefabs
Link copied to clipboard

On this page
  • namespace InitialPrefabs.Collections
  • Summary
  • TypeParam
  • TypeParam
  • TypeParam
  • bool TryEnqueue(TItem item, TPriority priority)
    • Summary
    • Param
    • Returns
  • bool TryDequeue(out TItem item, out TPriority priority)
    • Summary
    • Param
    • Returns
  • bool TryPeek(out TItem item, out TPriority priority)
    • Summary
    • Param
    • Returns

NoAllocPriorityQueue  

namespace InitialPrefabs.Collections  

Summary  

A stack only priority queue is a queue that allows each item stored an assigned priority. The priority determines the order of service when an element is dequed. They can serve the highest priority or lowest priority based on the implementation of TComparer.

TypeParam  

The element to store

TypeParam  

The assigned priority

TypeParam  

The comparison function to determine the service of order.

bool TryEnqueue(TItem item, TPriority priority)  

Summary  

Attempts to enqueue an item to the queue.

Param  

Parameter Description
item The element to store.
priority The assigned priority of the element,

Returns  

bool - True, if successfully stored.

bool TryDequeue(out TItem item, out TPriority priority)  

Summary  

Attempts to dequeue an item from the queue.

Param  

Parameter Description
item The element in the queue
priority The associated priority of the queue

Returns  

bool - True, if there are elements stored in the queue.

bool TryPeek(out TItem item, out TPriority priority)  

Summary  

Attempts to look at the head of queue based on the assigned priority.

Param  

Parameter Description
item The element at the head of the queue.
priority The associated priority of the queue.

Returns  

bool - True, if there is an element at the end.

Go back to API Home

 NoAllocListExtensions
NoAllocQueue 
On this page:
  • namespace InitialPrefabs.Collections
  • Summary
  • TypeParam
  • TypeParam
  • TypeParam
  • bool TryEnqueue(TItem item, TPriority priority)
    • Summary
    • Param
    • Returns
  • bool TryDequeue(out TItem item, out TPriority priority)
    • Summary
    • Param
    • Returns
  • bool TryPeek(out TItem item, out TPriority priority)
    • Summary
    • Param
    • Returns
Follow Us!

Contact us if you want to work with us for your games and art projects!

     
Copyright © 2016-2025 InitialPrefabs
initialPrefabs
Code copied to clipboard