packio
msgpack.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_MSGPACK_H
6 #define PACKIO_MSGPACK_MSGPACK_H
7 
10 
11 #include "../client.h"
12 #include "../server.h"
13 #include "rpc.h"
14 
17 namespace packio {
18 namespace msgpack {
19 
23 template <typename Socket, template <class...> class Map = default_map>
25 
29 template <typename Socket, template <class...> class Map = default_map>
30 auto make_client(Socket&& socket)
31 {
32  return std::make_shared<client<Socket, Map>>(std::forward<Socket>(socket));
33 }
34 
38 template <typename Acceptor, typename Dispatcher = dispatcher<rpc>>
40 
44 template <typename Acceptor, typename Dispatcher = dispatcher<rpc>>
45 auto make_server(Acceptor&& acceptor)
46 {
47  return std::make_shared<server<Acceptor, Dispatcher>>(
48  std::forward<Acceptor>(acceptor));
49 }
50 
58 
59 } // msgpack
60 } // packio
61 
62 #endif // PACKIO_MSGPACK_MSGPACK_H
packio::msgpack::completion_handler
completion_handler< rpc > completion_handler
The completion_handler class.
Definition: msgpack.h:57
packio::msgpack::make_server
auto make_server(Acceptor &&acceptor)
Create a msgpack server from an acceptor.
Definition: msgpack.h:45
packio::client
The client class.
Definition: client.h:34
packio::msgpack::make_client
auto make_client(Socket &&socket)
Create a msgpack client from a socket.
Definition: msgpack.h:30
packio::server
The server class.
Definition: server.h:27
packio
Definition: arg.h:14