24 lines
431 B
C
24 lines
431 B
C
|
#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;
|
||
|
};
|