-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.h
39 lines (29 loc) · 1.2 KB
/
output.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
#pragma once
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
struct GeometryEngineOutput {
struct Result {
struct Marginline {
int num_original_points; // number of original points
int num_samples; // number of samples
std::vector<std::vector<double>> points; // 3ŽŸŒ³À•W‚Ì”z—ñ
};
std::string type; // Operation data type, like 'marginline'
Marginline marginline; // output data to generate initial margin line
};
int return_code; // Return code
std::string message;// Message
Result result; // Result data
};
void Initialize(GeometryEngineOutput& output);
// serialize functions
void to_json(nlohmann::json& j, const GeometryEngineOutput::Result::Marginline& ml);
void to_json(nlohmann::json& j, const GeometryEngineOutput::Result& r);
void to_json(nlohmann::json& j, const GeometryEngineOutput& geo);
// deserialize functions
void from_json(const nlohmann::json& j, GeometryEngineOutput::Result::Marginline& ml);
void from_json(const nlohmann::json& j, GeometryEngineOutput::Result& r);
void from_json(const nlohmann::json& j, GeometryEngineOutput& geo);
// testing
void test_output_json_00();