Header file for the priority queue implementation. More...
#include "../shared/shared.h"
Go to the source code of this file.
Data Structures | |
struct | priorityQueueElement_s |
struct | priorityQueue_s |
the priority queue struct the actual data is stored in priorityQueueElement_t More... | |
Defines | |
#define | PQueueIsEmpty(pq) ((pq)->currentSize == 0) |
Typedefs | |
typedef int | priorityQueueRating_t |
typedef struct priorityQueueElement_s | priorityQueueElement_t |
typedef struct priorityQueue_s | priorityQueue_t |
the priority queue struct the actual data is stored in priorityQueueElement_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, 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 |
Header file for the priority queue implementation.
Definition in file pqueue.h.
#define PQueueIsEmpty | ( | pq | ) | ((pq)->currentSize == 0) |
Definition at line 49 of file pqueue.h.
Referenced by Grid_MoveCalc(), and PQueuePop().
typedef struct priorityQueue_s priorityQueue_t |
the priority queue struct the actual data is stored in priorityQueueElement_t
typedef struct priorityQueueElement_s priorityQueueElement_t |
typedef int priorityQueueRating_t |
void PQueueFree | ( | priorityQueue_t * | pq | ) |
free up memory for pqueue
Definition at line 87 of file pqueue.c.
References priorityQueue_s::elements.
Referenced by Grid_MoveCalc().
void PQueueInitialise | ( | priorityQueue_t * | pq, | |
uint32_t | maxElements | |||
) |
initialise the priority queue with a maximum size of maxelements.
Definition at line 38 of file pqueue.c.
References priorityQueue_s::currentSize, priorityQueue_s::elements, priorityQueue_s::maxSize, and Sys_Error().
Referenced by Grid_MoveCalc().
void PQueuePop | ( | priorityQueue_t * | pq, | |
pos4_t | item | |||
) |
remove the first node from the pqueue and provide a pointer to it
Definition at line 95 of file pqueue.c.
References priorityQueue_s::currentSize, priorityQueue_s::elements, i, priorityQueueElement_s::item, PQ_FIRST_ENTRY, PQ_LEFT_CHILD_INDEX, PQueueIsEmpty, and priorityQueueElement_s::rating.
Referenced by Grid_MoveCalc().
void PQueuePush | ( | priorityQueue_t * | pq, | |
pos4_t | item, | |||
priorityQueueRating_t | rating | |||
) |
Definition at line 49 of file pqueue.c.
References priorityQueue_s::currentSize, priorityQueue_s::elements, i, priorityQueueElement_s::item, priorityQueue_s::maxSize, PQ_FIRST_ENTRY, PQ_PARENT_INDEX, and priorityQueueElement_s::rating.
Referenced by Grid_MoveCalc(), and Grid_SetMoveData().