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