12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /**
- * This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
- */
- #ifndef JSONRPC_CPP_STUB_STUBCLIENT_H_
- #define JSONRPC_CPP_STUB_STUBCLIENT_H_
- #include <jsonrpccpp/client.h>
- class StubClient : public jsonrpc::Client
- {
- public:
- StubClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}
- std::string sayHello(const std::string& name) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p["name"] = name;
- Json::Value result = this->CallMethod("sayHello",p);
- if (result.isString())
- return result.asString();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- void notifyServer() throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p = Json::nullValue;
- this->CallNotification("notifyServer",p);
- }
- int addNumbers(int param1, int param2) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- p.append(param2);
- Json::Value result = this->CallMethod("addNumbers",p);
- if (result.isIntegral())
- return result.asInt();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- double addNumbers2(double param1, double param2) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- p.append(param2);
- Json::Value result = this->CallMethod("addNumbers2",p);
- if (result.isDouble())
- return result.asDouble();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- bool isEqual(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- p.append(param2);
- Json::Value result = this->CallMethod("isEqual",p);
- if (result.isBool())
- return result.asBool();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- Json::Value buildObject(const std::string& param1, int param2) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- p.append(param2);
- Json::Value result = this->CallMethod("buildObject",p);
- if (result.isObject())
- return result;
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- std::string methodWithoutParameters() throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p = Json::nullValue;
- Json::Value result = this->CallMethod("methodWithoutParameters",p);
- if (result.isString())
- return result.asString();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- };
- #endif //JSONRPC_CPP_STUB_STUBCLIENT_H_
|