DBFace.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
  3. */
  4. #ifndef JSONRPC_CPP_STUB_DEV_RPC_DBFACE_H_
  5. #define JSONRPC_CPP_STUB_DEV_RPC_DBFACE_H_
  6. #include "ModularServer.h"
  7. namespace dev {
  8. namespace rpc {
  9. class DBFace : public ServerInterface<DBFace>
  10. {
  11. public:
  12. DBFace()
  13. {
  14. this->bindAndAddMethod(jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &dev::rpc::DBFace::db_putI);
  15. this->bindAndAddMethod(jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &dev::rpc::DBFace::db_getI);
  16. }
  17. inline virtual void db_putI(const Json::Value &request, Json::Value &response)
  18. {
  19. response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString());
  20. }
  21. inline virtual void db_getI(const Json::Value &request, Json::Value &response)
  22. {
  23. response = this->db_get(request[0u].asString(), request[1u].asString());
  24. }
  25. virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0;
  26. virtual std::string db_get(const std::string& param1, const std::string& param2) = 0;
  27. };
  28. }
  29. }
  30. #endif //JSONRPC_CPP_STUB_DEV_RPC_DBFACE_H_