packio
nl_json_rpc.h
Go to the documentation of this file.
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4 
5 #ifndef PACKIO_NL_JSON_RPC_NL_JSON_RPC_H
6 #define PACKIO_NL_JSON_RPC_NL_JSON_RPC_H
7 
11 
12 #include "../client.h"
13 #include "../server.h"
14 #include "rpc.h"
15 
19 namespace packio {
20 namespace nl_json_rpc {
21 
24 
26 template <template <class...> class Map = default_map, typename Lockable = default_mutex>
28 
30 template <typename Socket, template <class...> class Map = default_map>
32 
34 template <typename Socket, template <class...> class Map = default_map>
35 auto make_client(Socket&& socket)
36 {
37  return std::make_shared<client<Socket, Map>>(std::forward<Socket>(socket));
38 }
39 
41 template <typename Acceptor, typename Dispatcher = dispatcher<>>
43 
45 template <typename Acceptor, typename Dispatcher = dispatcher<>>
46 auto make_server(Acceptor&& acceptor)
47 {
48  return std::make_shared<server<Acceptor, Dispatcher>>(
49  std::forward<Acceptor>(acceptor));
50 }
51 
52 } // nl_json_rpc
53 } // packio
54 
55 #endif // PACKIO_NL_JSON_RPC_NL_JSON_RPC_H
The client class.
Definition: client.h:34
The server class.
Definition: server.h:28
completion_handler< rpc > completion_handler
The completion_handler for JSON-RPC.
Definition: nl_json_rpc.h:23
dispatcher< rpc, Map, Lockable > dispatcher
The dispatcher for JSON-RPC.
Definition: nl_json_rpc.h:27
auto make_server(Acceptor &&acceptor)
The make_server function for JSON-RPC.
Definition: nl_json_rpc.h:46
auto make_client(Socket &&socket)
The make_client function for JSON-RPC.
Definition: nl_json_rpc.h:35
The packio namespace.
Definition: arg.h:14