mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
добавление наработок
This commit is contained in:
42
training/QueueFromChar.h
Normal file
42
training/QueueFromChar.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
#include "Global.h"
|
||||
#ifdef QUEUE_FROM_CHAR
|
||||
|
||||
#define MAX_COMMAND_LENGTH 16
|
||||
#define BUFFER 128
|
||||
|
||||
class QueueFromChar;
|
||||
|
||||
class QueueFromChar {
|
||||
public:
|
||||
QueueFromChar();
|
||||
~QueueFromChar();
|
||||
|
||||
void addCommand(const char* command);
|
||||
|
||||
void printCommands();
|
||||
|
||||
String getLastCommand();
|
||||
|
||||
private:
|
||||
struct CharBufferStruct {
|
||||
char command[MAX_COMMAND_LENGTH + 1];
|
||||
};
|
||||
CharBufferStruct* commandList;
|
||||
int commandCount = 0;
|
||||
};
|
||||
|
||||
// extern QueueFromChar* myBuf;
|
||||
|
||||
//========проверка очереди=====================
|
||||
// myBuf = new QueueFromChar;
|
||||
// myBuf->addCommand("zero");
|
||||
// myBuf->addCommand("one");
|
||||
// myBuf->addCommand("two");
|
||||
// myBuf->printCommands();
|
||||
// myBuf->getLastCommand();
|
||||
// myBuf->getLastCommand();
|
||||
// myBuf->getLastCommand();
|
||||
// myBuf->printCommands();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user