SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChatServer_client.hpp
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #ifndef MPRPC_ChatServer_client_d8ace49b_HPP__
9 #define MPRPC_ChatServer_client_d8ace49b_HPP__
10 
11 #include "ChatServer.hpp"
12 
13 namespace StickWorld {
14 
15 namespace ChatServer {
16 
17 
18 class client : public msgpack::rpc::client::base {
19 public:
20  client(const msgpack::rpc::address& addr, msgpack::rpc::loop lo = msgpack::rpc::loop()) :
21  msgpack::rpc::client::base(addr, lo) { }
22 
23  client(const std::string& host, uint16_t port, msgpack::rpc::loop lo = msgpack::rpc::loop()) :
24  msgpack::rpc::client::base(host, port, lo) { }
25 
26  ~client() { }
27 
29  const ChatServer::subscribe& message) {
30  instance.call_apply("subscribe", message).get<void>();
31  }
32 
33  void subscribe(
34  const int64_t& my_id) {
35  ChatServer::subscribe _Message;
36  _Message.my_id = my_id;
37  return subscribe_apply(_Message);
38  }
39 
40  msgpack::rpc::future::type<void> subscribe_async_apply(
41  const ChatServer::subscribe& message) {
42  return instance.call_apply("subscribe", message);
43  }
44 
45  msgpack::rpc::future::type<void> subscribe_async(
46  const int64_t& my_id) {
47  ChatServer::subscribe _Message;
48  _Message.my_id = my_id;
49  return subscribe_async_apply(_Message);
50  }
52  const ChatServer::publish& message) {
53  instance.call_apply("publish", message).get<void>();
54  }
55 
56  void publish(
57  const ChatMessage& x) {
58  ChatServer::publish _Message;
59  _Message.x = x;
60  return publish_apply(_Message);
61  }
62 
63  msgpack::rpc::future::type<void> publish_async_apply(
64  const ChatServer::publish& message) {
65  return instance.call_apply("publish", message);
66  }
67 
68  msgpack::rpc::future::type<void> publish_async(
69  const ChatMessage& x) {
70  ChatServer::publish _Message;
71  _Message.x = x;
72  return publish_async_apply(_Message);
73  }
75  const ChatServer::unsubscribe& message) {
76  instance.call_apply("unsubscribe", message).get<void>();
77  }
78 
80  const int64_t& my_id) {
81  ChatServer::unsubscribe _Message;
82  _Message.my_id = my_id;
83  return unsubscribe_apply(_Message);
84  }
85 
86  msgpack::rpc::future::type<void> unsubscribe_async_apply(
87  const ChatServer::unsubscribe& message) {
88  return instance.call_apply("unsubscribe", message);
89  }
90 
91  msgpack::rpc::future::type<void> unsubscribe_async(
92  const int64_t& my_id) {
93  ChatServer::unsubscribe _Message;
94  _Message.my_id = my_id;
95  return unsubscribe_async_apply(_Message);
96  }
97 };
98 
99 
100 } // namespace ChatServer
101 
102 
103 } // namespace StickWorld
104 #endif
void publish_apply(const ChatServer::publish &message)
Definition: ChatServer_client.hpp:51
client(const std::string &host, uint16_t port, msgpack::rpc::loop lo=msgpack::rpc::loop())
Definition: ChatServer_client.hpp:23
msgpack::rpc::future::type< void > subscribe_async_apply(const ChatServer::subscribe &message)
Definition: ChatServer_client.hpp:40
Definition: ChatServer.hpp:18
Definition: ChatServer.hpp:53
int64_t my_id
Definition: ChatServer.hpp:26
Definition: ChatServer.hpp:86
Definition: types.hpp:18
void unsubscribe_apply(const ChatServer::unsubscribe &message)
Definition: ChatServer_client.hpp:74
~client()
Definition: ChatServer_client.hpp:26
int64_t my_id
Definition: ChatServer.hpp:94
Definition: stickworld_server.idl:10
void subscribe_apply(const ChatServer::subscribe &message)
Definition: ChatServer_client.hpp:28
msgpack::rpc::future::type< void > subscribe_async(const int64_t &my_id)
Definition: ChatServer_client.hpp:45
msgpack::rpc::future::type< void > publish_async_apply(const ChatServer::publish &message)
Definition: ChatServer_client.hpp:63
Definition: ChatServer_client.hpp:18
void publish(const ChatMessage &x)
Definition: ChatServer_client.hpp:56
msgpack::rpc::future::type< void > unsubscribe_async_apply(const ChatServer::unsubscribe &message)
Definition: ChatServer_client.hpp:86
msgpack::rpc::future::type< void > publish_async(const ChatMessage &x)
Definition: ChatServer_client.hpp:68
void subscribe(const int64_t &my_id)
Definition: ChatServer_client.hpp:33
ChatMessage x
Definition: ChatServer.hpp:59
client(const msgpack::rpc::address &addr, msgpack::rpc::loop lo=msgpack::rpc::loop())
Definition: ChatServer_client.hpp:20
void unsubscribe(const int64_t &my_id)
Definition: ChatServer_client.hpp:79
msgpack::rpc::future::type< void > unsubscribe_async(const int64_t &my_id)
Definition: ChatServer_client.hpp:91