UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FIndexPriorityQueue Class Reference

#include <IndexPriorityQueue.h>

Classes

struct  FQueueNode
 

Public Member Functions

 FIndexPriorityQueue ()
 
 FIndexPriorityQueue (int maxID)
 
void Initialize (int MaxNodeID)
 
void Clear (bool bFreeMemory=true)
 
int GetCount () const
 
int GetFirstNodeID () const
 
float GetFirstNodePriority () const
 
bool Contains (int NodeID) const
 
void Insert (int NodeID, float priority)
 
int Dequeue ()
 
void Remove (int NodeID)
 
void Update (int NodeID, float Priority)
 
float GetPriority (int id)
 
bool IsValidQueue () const
 
bool CheckIds ()
 

Public Attributes

bool EnableDebugChecks = false
 
TDynamicVector< FQueueNodenodes
 
int num_nodes
 
TArray< int > id_to_index
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FIndexPriorityQueue() [1/2]

UE::Geometry::FIndexPriorityQueue::FIndexPriorityQueue ( )
inline

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

◆ FIndexPriorityQueue() [2/2]

UE::Geometry::FIndexPriorityQueue::FIndexPriorityQueue ( int  maxID)
inline

Calls Initialize()

Parameters
maxIDmaximum external ID that will be passed to any public functions

Member Function Documentation

◆ CheckIds()

bool UE::Geometry::FIndexPriorityQueue::CheckIds ( )
inline

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

◆ Clear()

void UE::Geometry::FIndexPriorityQueue::Clear ( bool  bFreeMemory = true)
inline

Reset the queue to empty state. if bFreeMemory is false, we don't discard internal data structures, so there will be less allocation next time

◆ Contains()

bool UE::Geometry::FIndexPriorityQueue::Contains ( int  NodeID) const
inline
Returns
true if id is already in queue

◆ Dequeue()

int UE::Geometry::FIndexPriorityQueue::Dequeue ( )
inline

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

Returns
ID of node at head of queue

◆ GetCount()

int UE::Geometry::FIndexPriorityQueue::GetCount ( ) const
inline
Returns
current size of queue

◆ GetFirstNodeID()

int UE::Geometry::FIndexPriorityQueue::GetFirstNodeID ( ) const
inline
Returns
id of node at head of queue

◆ GetFirstNodePriority()

float UE::Geometry::FIndexPriorityQueue::GetFirstNodePriority ( ) const
inline
Returns
id of node at head of queue

◆ GetPriority()

float UE::Geometry::FIndexPriorityQueue::GetPriority ( int  id)
inline

Query the priority at node id, assuming it exists in queue. Behavior is undefined if you call w/ id that is not in queue

Returns
priority for node

◆ Initialize()

void UE::Geometry::FIndexPriorityQueue::Initialize ( int  MaxNodeID)
inline

Initialize internal data structures. Internally a fixed-size array is used to track mapping from IDs to internal node indices, so maxID must be provided up-front. If this seems problematic or inefficient, this is not the Priority Queue for you.

Parameters
MaxNodeIDmaximum external ID that will be passed to any public functions

◆ Insert()

void UE::Geometry::FIndexPriorityQueue::Insert ( int  NodeID,
float  priority 
)
inline

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

◆ IsValidQueue()

bool UE::Geometry::FIndexPriorityQueue::IsValidQueue ( ) const
inline

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

◆ Remove()

void UE::Geometry::FIndexPriorityQueue::Remove ( int  NodeID)
inline

Remove node associated with given ID from queue. Behavior is undefined if you call w/ id that is not in queue

◆ Update()

void UE::Geometry::FIndexPriorityQueue::Update ( int  NodeID,
float  Priority 
)
inline

Update priority at node id, and then move it to correct position in queue. Behavior is undefined if you call w/ id that is not in queue

Member Data Documentation

◆ EnableDebugChecks

bool UE::Geometry::FIndexPriorityQueue::EnableDebugChecks = false

set this to true during development to catch issues

◆ id_to_index

TArray<int> UE::Geometry::FIndexPriorityQueue::id_to_index

mapping from external ids to internal node indices

◆ nodes

TDynamicVector<FQueueNode> UE::Geometry::FIndexPriorityQueue::nodes

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

◆ num_nodes

int UE::Geometry::FIndexPriorityQueue::num_nodes

count of active nodes


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