Fledge
An open source edge computing platform for industrial users
common.h
1 #ifndef _COMMON_CONNECTION_H
2 #define _COMMON_CONNECTION_H
3 
4 #include <sql_buffer.h>
5 #include <iostream>
6 #include <sqlite3.h>
7 #include "rapidjson/document.h"
8 #include "rapidjson/writer.h"
9 #include "rapidjson/stringbuffer.h"
10 #include "rapidjson/error/error.h"
11 #include "rapidjson/error/en.h"
12 #include <string>
13 #include <map>
14 #include <stdarg.h>
15 #include <stdlib.h>
16 #include <sstream>
17 #include <logger.h>
18 #include <time.h>
19 #include <unistd.h>
20 #include <chrono>
21 #include <thread>
22 #include <atomic>
23 #include <condition_variable>
24 #include <sys/time.h>
25 #include <connection.h>
26 
27 #define STORAGE_PURGE_RETAIN_ANY 0x0001U
28 #define STORAGE_PURGE_RETAIN_ALL 0x0002U
29 #define STORAGE_PURGE_SIZE 0x0004U
30 
31 static std::map<std::string, std::string> sqliteDateFormat = {
32  {"HH24:MI:SS",
33  F_TIMEH24_S},
34  {"YYYY-MM-DD HH24:MI:SS.MS",
35  F_DATEH24_MS},
36  {"YYYY-MM-DD HH24:MI:SS",
37  F_DATEH24_S},
38  {"YYYY-MM-DD HH24:MI",
39  F_DATEH24_M},
40  {"YYYY-MM-DD HH24",
41  F_DATEH24_H},
42  {"", ""}
43  };
44 #endif