Samchon Framework for CPP  1.0.0
ChatService.cpp
1 #include "ChatService.hpp"
2 #include "ChatRoom.hpp"
3 
4 #include <samchon/protocol/Invoke.hpp>
5 
6 using namespace std;
7 using namespace samchon::protocol;
8 using namespace samchon::protocol::service;
9 using namespace samchon::example::chat_service;
10 
11 ChatService::ChatService(Client *client)
12  : super(client)
13 {
14 
15 }
16 ChatService::~ChatService()
17 {
18  if(room == nullptr)
19  return;
20 
21  room->eraseClient(this);
22 }
23 
24 void ChatService::replyData(shared_ptr<Invoke> invoke)
25 {
26  if(invoke->getListener() == "sendMessage")
27  room->replyData(invoke);
28 }
A chat service inherited from cloud service.
Definition: ChatClient.hpp:8
Definition: RWMutex.hpp:4
Package of cloud service as a server.
Package of network protocol and libraries.
Definition: protocol.hpp:185
A network boundary with the client in an User.
Definition: Client.hpp:46
void eraseClient(ChatService *)
Erase a participant client.
Definition: ChatRoom.cpp:37