39 lines
2.0 KiB
C++
39 lines
2.0 KiB
C++
#pragma once
|
|
#include "Psc_Cpp_Core/Base/JSON.h"
|
|
#include "Psc_Cpp_Core/socket/export.h"
|
|
#include "SSR/export.h"
|
|
#include <SQLiteCpp/SQLiteCpp.h>
|
|
#include <cstring>
|
|
#include <iostream>
|
|
#include <mutex>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
// 用于debug 散乱的飞机从何而来
|
|
// #define Cache_Some_Mode_S
|
|
#ifdef Cache_Some_Mode_S
|
|
#define Cache_Some_Mode_S_Num 20
|
|
#endif
|
|
|
|
|
|
|
|
#define Parse(t, Field) \
|
|
auto& _##t = info.Field.value; \
|
|
info.Field.time = info.timestamp; \
|
|
if (!_##t.has_value()) _##t = std::remove_reference_t<decltype(_##t)>::ValueType(); \
|
|
_##t.value().parse(msg); \
|
|
auto& t = _##t.value();
|
|
// ret.append(NAME.value.has_value()? Psc::Json(STRINGIFY(NAME##_time), NAME.time) : Psc::Json(STRINGIFY(NAME##_time), nullptr));
|
|
#define STRINGIFY(x) #x
|
|
#define ADD_Json(NAME) ret.children.emplace_back(STRINGIFY(NAME), NAME);
|
|
#define ADD_Json_RET(NAME) \
|
|
if (NAME.has_value()) \
|
|
{ \
|
|
ret.children.emplace_back(STRINGIFY(NAME), NAME.value()); \
|
|
} else \
|
|
{ \
|
|
ret.children.emplace_back(STRINGIFY(NAME), nullptr); \
|
|
}
|
|
|