packio
msgpack_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_MSGPACK_RPC_MSGPACK_RPC_H
6 #define PACKIO_MSGPACK_RPC_MSGPACK_RPC_H
7 
10 
11 #include "../client.h"
12 #include "../server.h"
13 #include "rpc.h"
14 
17 namespace packio {
18 namespace msgpack_rpc {
19 
22 
24 template <template <class...> class Map = default_map, typename Lockable = default_mutex>
26 
28 template <typename Socket, template <class...> class Map = default_map>
30 
32 template <typename Socket, template <class...> class Map = default_map>
33 auto make_client(Socket&& socket)
34 {
35  return std::make_shared<client<Socket, Map>>(std::forward<Socket>(socket));
36 }
37 
39 template <typename Acceptor, typename Dispatcher = dispatcher<>>
41 
43 template <typename Acceptor, typename Dispatcher = dispatcher<>>
44 auto make_server(Acceptor&& acceptor)
45 {
46  return std::make_shared<server<Acceptor, Dispatcher>>(
47  std::forward<Acceptor>(acceptor));
48 }
49 
50 } // msgpack_rpc
51 } // packio
52 
53 #endif // PACKIO_MSGPACK_RPC_MSGPACK_RPC_H
The client class.
Definition: client.h:34
The server class.
Definition: server.h:28
auto make_client(Socket &&socket)
The make_client function for msgpack-RPC.
Definition: msgpack_rpc.h:33
auto make_server(Acceptor &&acceptor)
The make_server function for msgpack-RPC.
Definition: msgpack_rpc.h:44
completion_handler< rpc > completion_handler
The completion_handler for msgpack-RPC.
Definition: msgpack_rpc.h:21
dispatcher< rpc, Map, Lockable > dispatcher
The dispatcher for msgpack-RPC.
Definition: msgpack_rpc.h:25
The packio namespace.
Definition: arg.h:14