diff options
Diffstat (limited to 'src/rpc-server/trex_rpc_cmd_api.h')
-rw-r--r-- | src/rpc-server/trex_rpc_cmd_api.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/rpc-server/trex_rpc_cmd_api.h b/src/rpc-server/trex_rpc_cmd_api.h index def52fca..c72b3e3b 100644 --- a/src/rpc-server/trex_rpc_cmd_api.h +++ b/src/rpc-server/trex_rpc_cmd_api.h @@ -68,8 +68,15 @@ public: /** * method name and params */ - TrexRpcCommand(const std::string &method_name, int param_count) : m_name(method_name), m_param_count(param_count) { - + TrexRpcCommand(const std::string &method_name, int param_count, bool needs_ownership) : + m_name(method_name), + m_param_count(param_count), + m_needs_ownership(needs_ownership) { + + /* if needs ownership - another field is needed (handler) */ + if (m_needs_ownership) { + m_param_count++; + } } /** @@ -112,6 +119,12 @@ protected: void check_param_count(const Json::Value ¶ms, int expected, Json::Value &result); /** + * verify ownership + * + */ + void verify_ownership(const Json::Value ¶ms, Json::Value &result); + + /** * parse functions * */ @@ -209,6 +222,7 @@ protected: /* RPC command name */ std::string m_name; int m_param_count; + bool m_needs_ownership; }; #endif /* __TREX_RPC_CMD_API_H__ */ |