rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
rsvsjson.hpp
Go to the documentation of this file.
1 
8 #ifndef PARAMETERS2JSON_H_INCLUDED
9 #define PARAMETERS2JSON_H_INCLUDED
10 
11 //=================================
12 // forward declared dependencies
13 // class foo; //when you only need a pointer not the actual object
14 // and to avoid circular dependencies
15 namespace param
16 {
17 template <class T> struct filltype;
18 class outputtemplate;
19 class rsvs;
20 class snaking;
21 class voxel;
22 class voronoi;
23 class grid;
24 class parameters;
25 class ioin;
26 class ioout;
27 class files;
28 
29 namespace dev
30 {
31 class rsvseps;
32 class devparam;
33 } // namespace dev
34 } // namespace param
35 
36 namespace tetgen
37 {
38 class apiparam;
39 }
40 
41 //=================================
42 // included dependencies
43 
44 #include <array>
45 #include <cstdlib>
46 #include <string>
47 
48 #include "json.hpp"
49 
50 //==================================
51 // Code
52 //
53 // This file defines the functions required to convert the
54 // various classes to json
55 
56 namespace rsvsjson
57 {
58 using json = nlohmann::json;
59 }
60 namespace param
61 {
62 
63 template <class T> void to_json(rsvsjson::json &j, const filltype<T> &p);
64 template <class T> void from_json(const rsvsjson::json &j, filltype<T> &p);
65 
66 void to_json(rsvsjson::json &j, const outputtemplate &p);
67 void from_json(const rsvsjson::json &j, outputtemplate &p);
68 
69 void to_json(rsvsjson::json &j, const rsvs &p);
70 void from_json(const rsvsjson::json &j, rsvs &p);
71 
72 void to_json(rsvsjson::json &j, const snaking &p);
73 void from_json(const rsvsjson::json &j, snaking &p);
74 
75 void to_json(rsvsjson::json &j, const voxel &p);
76 void from_json(const rsvsjson::json &j, voxel &p);
77 
78 void to_json(rsvsjson::json &j, const voronoi &p);
79 void from_json(const rsvsjson::json &j, voronoi &p);
80 
81 void to_json(rsvsjson::json &j, const grid &p);
82 void from_json(const rsvsjson::json &j, grid &p);
83 
84 void to_json(rsvsjson::json &j, const parameters &p);
85 void from_json(const rsvsjson::json &j, parameters &p);
86 
87 void to_json(rsvsjson::json &j, const ioin &p);
88 void from_json(const rsvsjson::json &j, ioin &p);
89 
90 void to_json(rsvsjson::json &j, const ioout &p);
91 void from_json(const rsvsjson::json &j, ioout &p);
92 
93 void to_json(rsvsjson::json &j, const files &p);
94 void from_json(const rsvsjson::json &j, files &p);
95 
96 namespace dev
97 {
98 void to_json(rsvsjson::json &j, const devparam &p);
99 void from_json(const rsvsjson::json &j, devparam &p);
100 void to_json(rsvsjson::json &j, const rsvseps &p);
101 void from_json(const rsvsjson::json &j, rsvseps &p);
102 } // namespace dev
103 } // namespace param
104 namespace rsvsjson
105 {
106 void flatupdate(json &jfin, json &jnew, bool isFlatFin, bool isFlatNew);
107 }
108 namespace tetgen
109 {
110 
111 void to_json(rsvsjson::json &j, const apiparam &p);
112 void from_json(const rsvsjson::json &j, apiparam &p);
113 } // namespace tetgen
114 
115 #endif
Namespace containing the parameter classes used to control execution of the 3D-RSVS program.
Definition: main.hpp:15