Import CAN generator from low-level-can-service
[src/low-level-can-generator.git] / src / openxc / command.hpp
diff --git a/src/openxc/command.hpp b/src/openxc/command.hpp
new file mode 100755 (executable)
index 0000000..2c05226
--- /dev/null
@@ -0,0 +1,25 @@
+#pragma once\r
+\r
+#include <string>\r
+#include <json.hpp>\r
+\r
+namespace openxc\r
+{\r
+       class command\r
+       {\r
+       private:\r
+               std::string             name_;\r
+               bool                    enabled_;\r
+               std::string             handler_;\r
+       public:\r
+               std::string name() const;\r
+               bool enabled() const;\r
+               std::string handler() const;\r
+               \r
+               void from_json(const nlohmann::json& j);\r
+               nlohmann::json to_json() const;\r
+       };\r
+\r
+       void to_json(nlohmann::json& j, const command& p);\r
+       void from_json(const nlohmann::json& j, command& p);\r
+}\r