mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
добавил класс очереди microsoft
This commit is contained in:
28
src/classes/QueueBuf.cpp
Normal file
28
src/classes/QueueBuf.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "classes/QueueBuf.h"
|
||||
|
||||
QueueBuf::QueueBuf() {}
|
||||
QueueBuf::~QueueBuf() {}
|
||||
|
||||
//добавим элемент в конец очереди
|
||||
void QueueBuf::push(int element) {
|
||||
queue1.push(element);
|
||||
}
|
||||
|
||||
//удалим элемент из начала очереди
|
||||
void QueueBuf::pop() {
|
||||
if (!queue1.empty()) {
|
||||
queue1.pop();
|
||||
}
|
||||
}
|
||||
|
||||
//вернуть элемент из начала очереди и удалить его
|
||||
int QueueBuf::front() {
|
||||
int ret;
|
||||
if (!queue1.empty()) {
|
||||
ret = queue1.front();
|
||||
queue1.pop();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
QueueBuf* myQueue;
|
||||
Reference in New Issue
Block a user