MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / addCall

Method addCall

src/jsonrpccpp/client/batchcall.cpp:18–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16BatchCall::BatchCall() : id(1) {}
17
18int BatchCall::addCall(const string &methodname, const Json::Value &params, bool isNotification) {
19 Json::Value call;
20 call[RpcProtocolClient::KEY_PROTOCOL_VERSION] = "2.0";
21 call[RpcProtocolClient::KEY_PROCEDURE_NAME] = methodname;
22
23 if (params.isNull() || !params.empty())
24 call[RpcProtocolClient::KEY_PARAMETER] = params;
25
26 if (!isNotification) {
27 call[RpcProtocolClient::KEY_ID] = this->id++;
28 }
29 result.append(call);
30
31 if (isNotification)
32 return -1;
33 return call[RpcProtocolClient::KEY_ID].asInt();
34}
35
36string BatchCall::toString(bool fast) const {
37 string result;

Callers 1

test_client.cppFile · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected