FIndexPriorityQueue

This is a min-heap priority queue class that does not use an object for each queue node.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Util/IndexPriorityQueue.h

Include

#include "Util/IndexPriorityQueue.h"

Syntax

class FIndexPriorityQueue

Remarks

This is a min-heap priority queue class that does not use an object for each queue node. Integer IDs must be provided by the user to identify unique nodes. Internally an array is used to keep track of the mapping from ids to internal indices, so the max ID must also be provided.

Variables

Name Description

Public variable

bool

 

EnableDebugChecks

Set this to true during development to catch issues

Public variable

TArray< int >

 

id_to_index

Mapping from external ids to internal node indices

Public variable

TDynamicVector<...

 

nodes

Tree of allocated nodes, stored linearly. active up to num_nodes (allocated may be larger)

Public variable

int

 

num_nodes

Count of active nodes

Constructors

Name Description

Public function

FIndexPriorityQueue()

This constructor is provided for convenience, you must call Initialize()

Public function

FIndexPriorityQueue

(
    int maxID
)

Calls Initialize()

Functions

Name Description

Public function

void

 

Clear

(
    bool bFreeMemory
)

Reset the queue to empty state.

Public function Const

bool

 

Contains

(
    int NodeID
)

Public function

int

 

Dequeue()

Remove node at head of queue, update queue, and return id for that node

Public function Const

int

 

GetCount()

Public function Const

int

 

GetFirstNodeID()

Public function Const

float

 

GetFirstNodePriority()

Public function

float

 

GetPriority

(
    int id
)

Query the priority at node id, assuming it exists in queue.

Public function

void

 

Initialize

(
    int MaxNodeID
)

Initialize internal data structures.

Public function

void

 

Insert

(
    int NodeID,
    float priority
)

Add id to list w/ given priority. Do not call with same id twice!

Public function Const

bool

 

IsValidQueue()

Check if node ordering is correct (for debugging/testing)

Public function

void

 

Remove

(
    int NodeID
)

Remove node associated with given ID from queue.

Public function

void

 

Update

(
    int NodeID,
    float Priority
)

Update priority at node id, and then move it to correct position in queue.

Classes

Name

Description

Public struct

FQueueNode

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss