Vehicle Control Unit 0.01
This is the c library for controlling the car.
|
#include "../../Inc/Scheduler/PriorityQueue.h"
Go to the source code of this file.
Functions | |
void | PQInit (PriorityQueue *pq) |
Initializes the priority queue. More... | |
void | heapifyUp (PriorityQueue *pq, int index) |
Restores the heap property by moving the node at the given index up. More... | |
void | heapifyDown (PriorityQueue *pq, int index) |
Restores the heap property by moving the node at the given index down. More... | |
bool | PQPush (PriorityQueue *pq, Task task, int priority) |
Pushes a task with a given priority onto the priority queue. More... | |
bool | PQPop (PriorityQueue *pq, Task *task) |
Pops the highest priority task from the priority queue. More... | |
bool | PQPeek (PriorityQueue *pq, Task *task) |
Peeks at the highest priority task in the priority queue without removing it. More... | |
bool | PQIsEmpty (PriorityQueue *pq) |
Checks if the priority queue is empty. More... | |
bool | PQIsFull (PriorityQueue *pq) |
Checks if the priority queue is full. More... | |
void heapifyDown | ( | PriorityQueue * | pq, |
int | index | ||
) |
Restores the heap property by moving the node at the given index down.
pq | Pointer to the PriorityQueue structure. |
index | The index of the node to move down. |
Definition at line 29 of file PriorityQueue.c.
void heapifyUp | ( | PriorityQueue * | pq, |
int | index | ||
) |
Restores the heap property by moving the node at the given index up.
pq | Pointer to the PriorityQueue structure. |
index | The index of the node to move up. |
Definition at line 13 of file PriorityQueue.c.
void PQInit | ( | PriorityQueue * | pq | ) |
Initializes the priority queue.
pq | Pointer to the PriorityQueue structure to initialize. |
Definition at line 3 of file PriorityQueue.c.
bool PQIsEmpty | ( | PriorityQueue * | pq | ) |
Checks if the priority queue is empty.
pq | Pointer to the PriorityQueue structure. |
Definition at line 62 of file PriorityQueue.c.
bool PQIsFull | ( | PriorityQueue * | pq | ) |
Checks if the priority queue is full.
pq | Pointer to the PriorityQueue structure. |
Definition at line 66 of file PriorityQueue.c.
bool PQPeek | ( | PriorityQueue * | pq, |
Task * | task | ||
) |
Peeks at the highest priority task in the priority queue without removing it.
pq | Pointer to the PriorityQueue structure. |
task | Pointer to the Task structure to store the peeked task. |
Definition at line 56 of file PriorityQueue.c.
bool PQPop | ( | PriorityQueue * | pq, |
Task * | task | ||
) |
Pops the highest priority task from the priority queue.
pq | Pointer to the PriorityQueue structure. |
task | Pointer to the Task structure to store the popped task. |
Definition at line 48 of file PriorityQueue.c.
bool PQPush | ( | PriorityQueue * | pq, |
Task | task, | ||
int | priority | ||
) |
Pushes a task with a given priority onto the priority queue.
pq | Pointer to the PriorityQueue structure. |
task | The task to push onto the queue. |
priority | The priority of the task. |
Definition at line 41 of file PriorityQueue.c.