-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqueue.h
42 lines (33 loc) · 871 Bytes
/
queue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* File : queue.h
* Author : Ahmad Naufal (049) - Tifani Warnita (055) - Asanilta Fahda (079)
* Description : Header of queue
*/
#ifndef _QUEUE_H_
#define _QUEUE_H_
#include "frame.h"
#define MaxSizeQueue 5
using namespace std;
class Queue {
public:
Queue(); //Ctor
Queue(int size); //Ctor with param
Queue(const Queue& q); //Cctor
Queue& operator=(const Queue& q); //Operator assignment
~Queue(); //Dtor
bool isEmpty(); //Return true if the queue is empty
bool isFull(); //Return true if the queue is full
unsigned int getHead();
unsigned int getTail();
unsigned int getCount();
Frame getElement(int x);
void add(Frame f); //Add element to the end of queue
Frame del(); //Delete element from the front of the queue
private:
unsigned int count;
unsigned int front;
unsigned int rear;
unsigned int maxSize;
Frame *data;
};
#endif