Import CAN generator from low-level-can-service
[src/low-level-can-generator.git] / src / openxc / mapping.hpp
1 #pragma once\r
2 \r
3 #include <string>\r
4 #include <json.hpp>\r
5 \r
6 namespace openxc\r
7 {\r
8         class mapping\r
9         {\r
10         private:\r
11                 std::string             mapping_name_;\r
12                 std::string             bus_;\r
13                 std::string             database_;\r
14                 bool                    bit_numbering_inverted_;\r
15                 bool                    enabled_;\r
16         public:\r
17                 std::string mapping_name() const;\r
18                 std::string bus() const;\r
19                 std::string database() const;\r
20                 bool bit_numbering_inverted() const;\r
21                 bool enabled() const;\r
22                 \r
23                 void from_json(const nlohmann::json& j);\r
24                 nlohmann::json to_json() const;\r
25         };\r
26 \r
27         void to_json(nlohmann::json& j, const mapping& p);\r
28         void from_json(const nlohmann::json& j, mapping& p);\r
29 }\r