3 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCCLIENT_H_
4 #define INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCCLIENT_H_
7 #include "nn/nlib/Swap.h"
11 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
12 #undef NLIB_VIS_PUBLIC
13 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
21 class JsonRpcResponseHandler;
29 static void Shutdown();
36 m_Handle = rhs.m_Handle;
41 swap(m_Handle, rhs.m_Handle);
48 typedef ::nlib_ns::threading::Future<UniquePtr<JsonRpcResponse> >
FutureType;
49 errno_t GetFutureForId(FutureType* future, reqid_t reqid);
50 errno_t ResolveResponse(
const void* buf,
size_t nbytes);
52 errno_t SetNoTargetResponseHandler(NoTargetResponseHandler handler);
63 friend class JsonRpcClientImpl;
70 NLIB_DEFINE_STD_SWAP(::nlib_ns::msgpack::jsonrpc::JsonRpcClient)
72 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
73 #undef NLIB_VIS_PUBLIC
74 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
77 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCCLIENT_H_
JsonRpcClient(const JsonRpcClient &rhs)
Copy constructor.
void swap(JsonRpcClient &rhs)
A swap.
Class for representing the JSON-RPC response.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#define NLIB_SAFE_BOOL(class_name, exp)
Defines a safe operator bool function in the class. Uses the C++11 explicit bool if it is available f...
bool operator==(const JsonRpcClient &rhs) const
Returns true if the client is the same.
UniquePtr owns the pointer, and when it goes out of scope, the pointer is released by the destructor ...
Defines that class that is corresponding to std::unique_ptr.
::nlib_ns::threading::Future< UniquePtr< JsonRpcResponse > > FutureType
A future type set when a response (or timeout) is assigned to each request.
JsonRpcClient()
Instantiates the object with default parameters (default constructor).
JsonRpcClient & operator=(const JsonRpcClient &rhs)
Assignment operator.
A file that contains the configuration information for each development environment.
uint32_t reqid_t
id type for the JSON-RPC request.
Class to manage client side JSON-RPC.
Implements the Future pattern for multithread programming.
bool operator!=(const JsonRpcClient &rhs) const
Returns false if the client is the same.