Import CAN generator from low-level-can-service
[src/low-level-can-generator.git] / src / openxc / command.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 command\r
9         {\r
10         private:\r
11                 std::string             name_;\r
12                 bool                    enabled_;\r
13                 std::string             handler_;\r
14         public:\r
15                 std::string name() const;\r
16                 bool enabled() const;\r
17                 std::string handler() const;\r
18                 \r
19                 void from_json(const nlohmann::json& j);\r
20                 nlohmann::json to_json() const;\r
21         };\r
22 \r
23         void to_json(nlohmann::json& j, const command& p);\r
24         void from_json(const nlohmann::json& j, command& p);\r
25 }\r