3 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCREQUEST_H_ 4 #define INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCREQUEST_H_ 15 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS) 16 #undef NLIB_VIS_PUBLIC 17 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 25 class JsonRpcErrorRequestTest;
63 friend class fortest::JsonRpcErrorRequestTest;
72 : prv_(NULL), is_msgpack_(use_msgpack) {}
76 return WriteRequest(method, 0, params);
79 return WriteRequest(req.GetMethod(), req.GetId(), req.GetParams());
84 struct JsonRpcRequestWriterPrivate;
85 JsonRpcRequestWriterPrivate* prv_;
104 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS) 105 #undef NLIB_VIS_PUBLIC 106 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 109 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCREQUEST_H_
JsonRpcRequestWriter() noexcept
Instantiates the object with default parameters (default constructor).
Class for representing the JSON-RPC response.
JsonRpcRequest() noexcept
Instantiates the object with default parameters (default constructor).
errno_t WriteNotification(const char *method, const MpObject ¶ms) noexcept
Writes the JSON-RPC notification.
const char * GetMethod() const noexcept
Gets the method name of the request.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
void SetId(reqid_t id) noexcept
Sets the request ID.
Class to serialize and write the JSON-RPC request to memory.
reqid_t GetId() const noexcept
Get the id of the request. If 0, the request is a notification.
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.
Object created when MessagePack or JSON is read.
JsonRpcRequestWriter(bool use_msgpack) noexcept
Sets the use of msgpack instead of JSON as the JSON description method.
Defines the class that resembles std::vector but can store objects that cannot be copied...
void swap(MpObject &rhs) noexcept
Swaps the content of the object.
Class that reads the JSON-RPC request.
Class for representing a JSON-RPC request.
void MoveParamsFrom(MpObject ¶ms) noexcept
Sets the JSON-RPC parameters.
Object created when MessagePack, JSON, or CSV is read.
Nlist< JsonRpcRequest > ListType
Type used to store the JSON-RPC request sequence restored from the byte string.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
A file that contains the configuration information for each development environment.
uint32_t reqid_t
id type for the JSON-RPC request.
A container-like class similar to std::vector that can store objects that do not have copy constructo...
const MpObject & GetParams() const noexcept
Gets the parameter of the request.
errno_t WriteRequest(const JsonRpcRequest &req) noexcept
Writes the JSON-RPC request.
size_t JsonRpcServerExec(const void *p, size_t n, ReallocOutputStream::UniquePtrType *ptr)
Creates the JSON-RPC response byte string by processing the JSON-RPC request.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
MpObject & GetParams() noexcept
Gets the parameter of the request.