1 #ifndef GDE_COMMAND_TO_HPP
2 #define GDE_COMMAND_TO_HPP
11 typedef std::map<std::string, std::string> ParametersMap;
14 CommandTO(int method = -1,
15 std::string data = std::string(),
16 const ParametersMap& parameters=ParametersMap())
17 : _method(method), _data(data), _parameters(parameters) {}
18 CommandTO(const CommandTO&);
21 inline std::string getData() const { return _data; }
22 inline void setData(std::string data) { this->_data = data; }
24 inline int getMethod() const { return _method; }
25 inline void setMethod(int method) { this->_method = method; }
27 template <typename T> T getParameter(std::string name);
28 template <typename T> void setParameter(std::string name, const T& value, bool replaceIfExist=true);
30 static CommandTO fromJson(std::string json);
35 std::string _data; // JSON format
36 ParametersMap _parameters;