-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventBase.h
63 lines (51 loc) · 1.85 KB
/
EventBase.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
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef EVENTBASE_H
#define EVENTBASE_H
#include "IDbClient.h"
#include <string>
#include <map>
#include <vector>
#include <inttypes.h>
#include <json/TBaseJsonWork.h>
struct FieldForFilterEvent
{
int pidNode = 0;
std::string sensorToken = "";
int limit = -1;
bool isThumb = true;
std::string orderDirection = "ASC";
std::string timeBegin;
std::string timeEnd;
std::string statusView = "*";
std::map<std::string, std::string> tables; // key = псевдонимТаблицы , value = название_таблицы
std::map<std::string, std::string> needColumns; // key = псевдонимТаблицы , value = нужные столбцы
};
struct InfoAboutAnalytic_t
{
int32_t type = 0;
std::string description = "";
//std::string state;
bool stateBool = false;
std::string nameTable;
friend std::ostream& operator<< (std::ostream &out, const InfoAboutAnalytic_t &res)
{
out << "\n Print InfoAboutAnalytic:\n";
out << "type == " << res.type << " ;\n"
<< "description == " << res.description << " ;\n"
<< "stateBool == " << res.stateBool << " ;\n"
<< "nameTable == " << res.nameTable << " ;\n";
return out;
}
};
class EventBase
{
public:
EventBase(IDBClient* pdbCli);
std::string fillNodesStrForEvent(const JSON::array_t &cams, FieldForFilterEvent &fEv,
std::string &pidNodesStr, std::string &sensorIdsStr);
IDBClient::ErrStatus fillInfoAboutAnalytic(int32_t numType, InfoAboutAnalytic_t &infoAboutAnalytic);
IDBClient::ErrStatus fillInfoAboutAllAnalytics(std::vector<InfoAboutAnalytic_t> &infoAboutAllAnalytics,
std::map<std::string, std::string> &tables);
protected:
IDBClient* p_dbCli = nullptr;
};
#endif // EVENTBASE_H