Samchon Framework for CPP  1.0.0
Service.cpp
1 #include <samchon/protocol/service/Service.hpp>
2 # include <samchon/protocol/service/Server.hpp>
3 # include <samchon/protocol/service/User.hpp>
4 # include <samchon/protocol/service/Client.hpp>
5 
6 #include <samchon/library/SQLi.hpp>
7 #include <samchon/library/SQLStatement.hpp>
8 
9 using namespace std;
10 using namespace samchon;
11 using namespace samchon::library;
12 using namespace samchon::protocol;
13 using namespace samchon::protocol::service;
14 
15 /* --------------------------------------------------------
16  CONSTRUCTORS
17 -------------------------------------------------------- */
18 Service::Service(Client *client)
19  : super()
20 {
21  this->client = client;
22 }
23 
24 auto Service::__keepAlive() -> ServiceKeeper
25 {
26  return ServiceKeeper((User*)getClient()->getUser(), (Client*)getClient());
27 }
28 
29 /* --------------------------------------------------------
30  GETTERS
31 -------------------------------------------------------- */
32 auto Service::getClient() const -> Client*
33 {
34  return client;
35 }
36 
37 /* --------------------------------------------------------
38  SOCKET
39 -------------------------------------------------------- */
40 void Service::sendData(shared_ptr<Invoke> invoke)
41 {
42  client->sendData(invoke);
43 }
void sendData(std::shared_ptr< Invoke >)
Send Invoke message to (physical) client.
Definition: Client.cpp:64
Definition: RWMutex.hpp:4
Package of libraries.
Definition: library.hpp:84
User containing Client(s) with session-id.
Definition: User.hpp:56
Client * client
Client object Service is belonged to.
Definition: Service.hpp:62
auto getClient() const -> Client *
Get Client.
Definition: Service.cpp:32
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
An interface of Invoke message chain.
Definition: IProtocol.hpp:31
virtual void sendData(std::shared_ptr< Invoke >)
Shift the responsibility of sending an Invoke message to Client.
Definition: Service.cpp:40
A keeper blocking destrunction of User and Client.
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7