-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkerrs.h
47 lines (34 loc) · 833 Bytes
/
workerrs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//This is an open source non-commercial project. Dear PVS-Studio, please check it.
#ifndef WORKERRS_H
#define WORKERRS_H
#include <thread>
#include <string>
#include <fstream>
//#include "interface.h"
#include "iworker.h"
#include "rsinterface.h"
#include "udpinterface.h"
#include "const.h"
#include "paramsrs.h"
class Worker: public IWorker
{
public:
Worker(TypeParams _params, TypeInterface interface);
Worker(const Worker &w) = delete;
~Worker();
void startThread() { isRun = true; }
void stopThread() { isRun = false; }
class WorkerEx
{
public:
string message;
WorkerEx(string message) { this->message = message; }
};
protected:
bool isRun;
private:
void run();
TypeParams params;
std::unique_ptr <std::thread> run_thread;
};
#endif // WORKERRS_H