-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModuleADT.h
50 lines (39 loc) · 1.16 KB
/
ModuleADT.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
48
49
50
/**
* @file ModuleADT.h
* @Author Martin Cechmanek
* @date December, 2015
* @brief Abstract Data Type class for common interface for all modules.
*/
#ifndef MODULEADT_H
#define MODULEADT_H
#include <memory>
#include <thread>
#include <Poco/AutoPtr.h>
#include <Poco/Logger.h>
#include <Poco/Runnable.h>
#include <Poco/Util/IniFileConfiguration.h>
#include "device_table.h"
#include "utils.h"
class Aggregator;
class ModuleADT {
public:
ModuleADT(std::shared_ptr<Aggregator> agg_, std::string logger_name, std::string MODULE, IOTMessage msg_);
ModuleADT(const ModuleADT& orig) = delete; // Forced disabling copy constructor
virtual ~ModuleADT();
virtual void parseCmdFromServer(const Command& cmd) = 0;
virtual bool belongTo(euid_t sensor_id);
void start();
void stop();
virtual void threadFunction() = 0; // this is thread function for running module service - makes whole class abstract
protected:
Poco::AutoPtr<Poco::Util::IniFileConfiguration> cfg;
std::shared_ptr<Aggregator> agg;
bool inicialized = false;
Poco::Logger& log;
IOTMessage msg;
std::thread module_thread;
Device sensor;
TT_Table tt;
private:
};
#endif /* MODULEADT_H */