добавил очередь из сущностей

This commit is contained in:
Dmitry Borisenko
2022-01-19 18:03:57 +01:00
parent 629d7b798f
commit 5bdecdda04
6 changed files with 55 additions and 17 deletions

View File

@@ -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
View File

@@ -0,0 +1,10 @@
#include "classes/QueueInst.h"
QueueInstance::QueueInstance(String text) {
_text = text;
}
QueueInstance::~QueueInstance() {}
String QueueInstance::get() {
return _text;
}