GrpcPrint/PrintS/PLC/Command/PLCReceiver.h

24 lines
431 B
C
Raw Normal View History

2024-03-19 17:45:12 +08:00
#pragma once
#include "../../Communication/S7Command.h"
#include <queue>
#include <mutex>
using namespace std;
class PLCReveiver
{
public:
PLCReveiver(){}
virtual ~PLCReveiver(){}
void AddCmd(S7Command* command)
{
unique_lock <std::mutex> lck(m_WirteMutex);
m_RTCommands.push(command);
//m_WriteCV.notify_one();
}
protected:
queue<Command*> m_RTCommands;
std::mutex m_WirteMutex;
//condition_variable m_WriteCV;
};