C_Algorithms 2.0.0
Documentation
Loading...
Searching...
No Matches
queue.h
Go to the documentation of this file.
1#ifndef QUEUE_H
2#define QUEUE_H
3
4#include <stdint.h>
5#include <math.h>
6#include <stdbool.h>
7
8
9typedef float queue_value_t;
10#define QUEUE_NO_VALUE (queue_value_t)INFINITY
11
12typedef struct queue
13{
14 u_int32_t front_id;
15 uint32_t back_id;
16 uint32_t size;
17 uint32_t capacity;
20
21
22myqueue_t *CreateQueue(uint32_t capacity);
23
25
27
29
31
33
35
37
39
40void Queue();
41
42#endif //QUEUE_H
queue_value_t BackQueue(myqueue_t *queue)
Last element of the Queue.
Definition queue.c:133
void PrintQueue(myqueue_t *queue)
Print the whole queue.
Definition queue.c:145
void PushQueue(myqueue_t *queue, queue_value_t value)
Put new data in the Queue object.
Definition queue.c:87
myqueue_t * FreeQueue(myqueue_t *queue)
Delete Queue object.
Definition queue.c:44
float queue_value_t
Definition queue.h:9
bool QueueIsEmpty(myqueue_t *queue)
Check if Queue is empty.
Definition queue.c:64
myqueue_t * CreateQueue(uint32_t capacity)
Create a Queue object.
Definition queue.c:13
queue_value_t PopQueue(myqueue_t *queue)
Delete data from Queue object.
Definition queue.c:103
queue_value_t FrontQueue(myqueue_t *queue)
First value of the Queue.
Definition queue.c:120
bool QueueIsFull(myqueue_t *queue)
Check if Queue is full.
Definition queue.c:76
struct queue myqueue_t
void Queue()
Definition queue.c:163
Definition queue.h:13
queue_value_t * data
Definition queue.h:18
u_int32_t front_id
Definition queue.h:14
uint32_t capacity
Definition queue.h:17
uint32_t size
Definition queue.h:16
uint32_t back_id
Definition queue.h:15