16 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCCLIENT_H_ 17 #define INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCCLIENT_H_ 20 #include "nn/nlib/Swap.h" 24 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS) 25 #undef NLIB_VIS_PUBLIC 26 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 34 class JsonRpcResponseHandler;
42 static void Shutdown();
49 handle_ = rhs.handle_;
57 typedef ::nlib_ns::threading::Future<UniquePtr<JsonRpcResponse> >
FutureType;
59 errno_t ResolveResponse(
const void* buf,
size_t nbytes);
61 errno_t SetNoTargetResponseHandler(NoTargetResponseHandler handler);
72 friend class JsonRpcClientImpl;
79 NLIB_DEFINE_STD_SWAP(::nlib_ns::msgpack::jsonrpc::JsonRpcClient)
81 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS) 82 #undef NLIB_VIS_PUBLIC 83 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 86 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCCLIENT_H_ Class for representing the JSON-RPC response.
bool operator==(const JsonRpcClient &rhs) const
Returns true if the client is the same.
#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 false if the client is the same.
In the C++11 environment (which supports alias templates), std::unique_ptr is made an alias template...
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.
An empty structure indicating that an argument to a function needs to be moved.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
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.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
constexpr JsonRpcClient() noexcept
Instantiates the object with default parameters (default constructor).