Skip to content

Function (FC): Priority Queue - v1.0

This function implements a Priority Queue using an array to store the data. The function supports enqueue, dequeue, and reading the first element of the queue, with priority based on the buffer_priority parameter.

This Priority Queue is implemented using the Binary Heap algorithm, which is an efficient data structure for maintaining the order of elements based on their priority. The Binary Heap allows inserting elements and removing the highest priority element in logarithmic time, making it suitable for applications where quick access to the highest priority elements is required.

  • Managing tasks or events with different priority levels.
  • Implementing scheduling algorithms or resource management.
  • Any situation where elements need to be processed in order of priority.
TypeNameVersion
data typepriorityQueueInstanceAttributesv1.0
data typepriorityQueueMetadatav1.0
enumerationEPriorityQueueMethodv1.0
enumerationEPriorityQueueStatusv1.0
ParameterDeclarationTypeDescription
methodInputIntMethod to be executed. EPriorityQueueMethod
instanceInOutpriorityQueueInstanceAttributesQueue instance
metadataInOutArray[*] of priorityQueueMetadataArray of metadata of type priorityQueueMetadata
dataInOutVariantArray of data of type <E>
buffer_dataInOutVariantData buffer of type <E>
buffer_priorityInOutDIntAny value within its range: the largest number has the highest priority
-ReturnIntReturn of the status. EPriorityQueueStatus