15 #ifndef PKG_RPC_JSON_RPC_H_INCLUDED
16 #define PKG_RPC_JSON_RPC_H_INCLUDED
20 #include <jsonrpccpp/client/iclientconnector.h>
21 #include <jsonrpccpp/server/abstractserverconnector.h>
36 #ifndef PKGRPC_NO_TOSTRING
55 static a_util::result::Result json_to_result(const Json::Value& oValue);
61 static uint64_t
stoull(
const std::string& strValue);
67 static int64_t
stoll(
const std::string& strValue);
76 template <
typename Stub,
typename Connector,
typename ConnectorInitializer>
101 template <
typename Stub,
typename Interface,
typename Connector,
typename ConnectorInitializer>
158 template <
typename ServerStub,
typename Connector = cServerConnector>
160 protected ServerStub,
A common result class usable as return value throughout.
Interface of an object that support remote calls.
Interface for returning a response to a remote call.
Utility base class to facilitate JSON conversions.
static std::string to_string(uint64_t nValue)
Convert an unsigned integer to a string.
static Json::Value result_to_json(a_util::result::Result nResult)
Get the Json::Value representation of an object of type a_util::result::Result.
static int64_t stoll(const std::string &strValue)
Convert a string to a signed integer.
static std::string to_string(int64_t nValue)
Convert a signed integer to a string.
static uint64_t stoull(const std::string &strValue)
Convert a string to an unsigned integer.
Connector that sends responses via IResponse.
bool StopListening()
Currently not implemented, returns always true.
bool OnRequest(const std::string &request, IResponse *response)
Called on request.
bool SendResponse(const std::string &response, void *addInfo)
Sets the response to addInfo which must be of type IResponse.
bool StartListening()
Currently not implemented, returns always true.
Template to implement an RPC object.
virtual a_util::result::Result HandleCall(const char *strRequest, size_t nRequestSize, IResponse &oResponse)
Handles an RPC call.
jsonrpc_object_server()
CTOR.
Template for mapping interfaces to a client stub.
Stub & GetStub() const
Access the rpc stub.
jsonrpc_remote_interface(const ConnectorInitializer &oInitializer)
Constructor.
Template for direct usage of the stub methods.
Stub & GetStub() const
Access the rpc stub.
jsonrpc_remote_object(const ConnectorInitializer &oInitializer)
Constructor.
RPC Protocol declaration.
RPC Protocol declaration.