nlib
JsonRpcServerExec.h
[詳解]
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCSERVEREXEC_H_
17 #define INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCSERVEREXEC_H_
18 
19 #include "nn/nlib/Config.h"
20 #include "nn/nlib/Nlist.h"
21 #include "nn/nlib/OutputStream.h"
22 #include "nn/nlib/UniquePtr.h"
26 
27 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
28 #undef NLIB_VIS_PUBLIC
29 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
30 #endif
31 
32 NLIB_NAMESPACE_BEGIN
33 namespace msgpack {
34 namespace jsonrpc {
35 
43  JSONSERVER_OK = kJsonServerOk,
44  JSONSERVER_PARSE_ERROR = kJsonServerParseError,
45  JSONSERVER_INVALID_REQUEST = kJsonServerInvalidRequest,
46  JSONSERVER_METHOD_NOT_FOUND = kJsonServerMethodNotFound,
47  JSONSERVER_INVALID_PARAMS = kJsonServerInvalidParams,
48  JSONSERVER_INTERNAL_ERROR = kJsonServerInternalError
49 };
50 
52  JsonRpcResponse& response) NLIB_NOEXCEPT_FUNCPTR; // NOLINT
53 
57 
58 NLIB_VIS_PUBLIC size_t JsonRpcServerExec(const void* p, size_t n,
60 
61 } // namespace jsonrpc
62 } // namespace msgpack
63 NLIB_NAMESPACE_END
64 
65 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
66 #undef NLIB_VIS_PUBLIC
67 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
68 #endif
69 
70 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONRPC_JSONRPCSERVEREXEC_H_
JsonRpcServerFuncCallError
サーバー側のJSON-RPCメソッドハンドラの戻り値です。
JSON-RPCのレスポンスを表すクラスです。
void ClearJsonRpcServerMethodTable()
登録されているJSON-RPCのメソッドハンドラを全て削除します。
JsonRpcServerFuncCallError(* JsonRpcServerFunc)(MpObject &param, JsonRpcResponse &response) NLIB_NOEXCEPT_FUNCPTR
JSON-RPCのメソッドハンドラです。
JSON-RPC2.0の-32700エラーを設定します。 JSON-RPCのメソッドハンドラが呼ばれている場合は、既にJSON-RPC...
UniquePtrはポインタの所有権を保持し、UniquePtrがスコープから出るときにデストラクタでポインタをDELで指...
Definition: UniquePtr.h:109
std::unique_ptrに相当するクラスが定義されています。
#define NLIB_VIS_PUBLIC
関数やクラス等のシンボルをライブラリの外部に公開します。
Definition: Platform_unix.h:89
MessagePack又はJSONを読み込むことで作成されるオブジェクトです。
Definition: MpObject.h:95
std::vectorに似ていますが、コピーできないオブジェクトを格納可能なクラスが定義されています。 ...
MessagePack, JSON及びCSVを読み込むと作成されるオブジェクトです。
JSON-RPC2.0の-32602エラーを設定します。 JSON-RPCリクエストのパラメータがハンドラの処理すべき形式でな...
errno_t AddJsonRpcServerMethod(const char *method, JsonRpcServerFunc func)
JSON-RPCのメソッドハンドラを登録します。
開発環境別の設定が書かれるファイルです。
関数の処理が成功した場合に返します。 また、サーバー実装独自のエラーを返す場合も、レスポンスを設定し...
size_t JsonRpcServerExec(const void *p, size_t n, ReallocOutputStream::UniquePtrType *ptr)
JSON-RPCリクエストを処理してJSON-RPCレスポンスのバイト列を作成します。
JsonRpcServerFunc GetJsonRpcServerMethod(const char *method)
メソッド名を指定して登録されているJSON-RPCのメソッドハンドラを取得します。
出力ストリームの基底クラスを定義しています。
JSON-RPC2.0の-32601エラーを設定します。 JSON-RPCのメソッドハンドラが呼ばれている場合は、既にメソッド...
JSON-RPC2.0の-32603エラーを設定します。 JSON-RPCメソッドハンドラ内部でのエラーが発生した場合に、この...
JSON-RPC2.0の-32600エラーを設定します。 JSON-RPCのメソッドハンドラが呼ばれている場合は、既に有効なJS...
int errno_t
intのtypedefで、戻り値としてPOSIXのエラー値を返すことを示します。
Definition: NMalloc.h:37