UFO: Alien Invasion
Loading...
Searching...
No Matches
pqueue.h File Reference

Header file for the priority queue implementation. More...

#include "../shared/shared.h"
Include dependency graph for pqueue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  priorityQueueElement_t
struct  priorityQueue_t
 the priority queue struct the actual data is stored in priorityQueueElement_t More...

Macros

#define PQueueIsEmpty(pq)

Typedefs

typedef int priorityQueueRating_t

Functions

void PQueueInitialise (priorityQueue_t *pq, uint32_t maxElements)
 initialise the priority queue with a maximum size of maxelements.
void PQueueFree (priorityQueue_t *pq)
 free up memory for pqueue
void PQueuePush (priorityQueue_t *pq, const pos4_t item, priorityQueueRating_t rating)
void PQueuePop (priorityQueue_t *pq, pos4_t item)
 remove the first node from the pqueue and provide a pointer to it

Detailed Description

Header file for the priority queue implementation.

Definition in file pqueue.h.

Macro Definition Documentation

◆ PQueueIsEmpty

#define PQueueIsEmpty ( pq)
Value:
((pq)->currentSize == 0)

Definition at line 48 of file pqueue.h.

Referenced by Grid_CalcPathing(), Grid_FindPath(), and PQueuePop().

Typedef Documentation

◆ priorityQueueRating_t

Definition at line 28 of file pqueue.h.

Function Documentation

◆ PQueueFree()

void PQueueFree ( priorityQueue_t * pq)

free up memory for pqueue

Definition at line 83 of file pqueue.cpp.

References priorityQueue_t::elements, and Mem_Free.

Referenced by Grid_CalcPathing(), and Grid_FindPath().

◆ PQueueInitialise()

void PQueueInitialise ( priorityQueue_t * pq,
uint32_t maxElements )

initialise the priority queue with a maximum size of maxelements.

Definition at line 36 of file pqueue.cpp.

References priorityQueue_t::currentSize, priorityQueue_t::elements, priorityQueue_t::maxSize, Mem_AllocTypeN, and Sys_Error().

Referenced by Grid_CalcPathing(), and Grid_FindPath().

◆ PQueuePop()

void PQueuePop ( priorityQueue_t * pq,
pos4_t item )

remove the first node from the pqueue and provide a pointer to it

Definition at line 91 of file pqueue.cpp.

References priorityQueue_t::currentSize, priorityQueue_t::elements, i, priorityQueueElement_t::item, PQ_FIRST_ENTRY, PQ_LEFT_CHILD_INDEX, PQueueIsEmpty, and priorityQueueElement_t::rating.

Referenced by Grid_CalcPathing(), and Grid_FindPath().

◆ PQueuePush()