Object Priority Queue

🔗 Store Page

This plugin provides a blueprint type for storing Objects in a queue. The queue is a priority queue, meaning that each Objects is inserted with a corresponding priority, and Objects with a lower Priority value will be removed first.

This data structure can be used to implement event queues, where events must occur in a specific order, or for prioritizing any other kind of object or action.

Blueprint Functions

Make Priority Queue

../_images/make_priority_queue.png

Instantiate a new Object Priority Queue.

Num

../_images/queue_num.png

Get the number of items in the queue.

Contains

../_images/queue_contains.png

Test if the queue contains a particular object.

Enqueue

../_images/enqueue.png

Adds an object to the queue with a given priority. If the object already exists in the queue, the priority is updated. Objects are ordered in the queue according to increasing priority.

The ordering of the priorities are not guaranteed to be stable; i.e. if two objects are enqueued with equal priority, there is no guarantee which order they will be dequeued.

Dequeue

../_images/dequeue.png

Remove an object from the queue. The object with the lowest priority in the queue will be returned. If the queue is empty, an invalid object will be returned.

To check if the queue is empty, you can test the value of Num or Next.

Next

../_images/queue_next.png

Peek at the front of the priority queue to see which one would be dequeued next. If the queue is empty, Next will return an invalid Object.

Clear

../_images/queue_clear.png

Clear all items from the queue and leave it empty.