-
Notifications
You must be signed in to change notification settings - Fork 1
/
IDataAbstract.hpp
58 lines (46 loc) · 1.39 KB
/
IDataAbstract.hpp
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
51
52
53
54
55
56
57
58
#ifndef IDATA_ABSTRACT_HPP
#define IDATA_ABSTRACT_HPP
#include <iostream>
#include <typeinfo>
#include <cxxabi.h>
#include <atomic>
#include <memory>
#include <cstdlib>
#include <string>
#include <vector>
#include <sstream>
class IDataAbstract
{
public:
IDataAbstract(std::string name, std::string parentObjectName)
{
// armazena nome da variável para serialização e LOGs.
this->name = parentObjectName + "." + name;
}
virtual ~IDataAbstract(){};
// virtual void serialize(const char *buffer) = 0;
// virtual void deserialize(const char *data) = 0;
virtual void saveData() = 0;
virtual void loadData() = 0;
virtual void setStreamInterval(uint32_t interval) = 0;
virtual uint32_t getStreamInterval() = 0;
virtual void setStreamTime(uint32_t streamTime) = 0;
virtual uint32_t getStreamTime() = 0;
virtual uint32_t getLastChange() = 0;
virtual void setData(std::string data) = 0;
virtual std::string getDataString(std::string ctrl = "") = 0;
std::string getName()
{
return this->name;
};
protected:
std::string name;
std::string demangle(const char *mangled)
{
int status;
std::unique_ptr<char[], void (*)(void *)> result(
abi::__cxa_demangle(mangled, 0, 0, &status), std::free);
return result.get() ? std::string(result.get()) : "error occurred";
};
};
#endif