Samchon Framework for CPP  1.0.0
Service.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <samchon/protocol/IProtocol.hpp>
5 
6 #include <string>
7 #include <samchon/protocol/service/ServiceKeeper.hpp>
8 
12 #define KEEP_SERVICE_ALIVE auto &ucPair = __keepAlive();
13 
14 namespace samchon
15 {
16 namespace library
17 {
18  class XML;
19  class SQLi;
20 };
21 namespace protocol
22 {
23 namespace service
24 {
25  class Client;
26 
44  class SAMCHON_FRAMEWORK_API Service
45  : public IProtocol
46  {
47  friend class Client;
48 
49  private:
50  typedef IProtocol super;
51 
52  protected:
56  virtual auto REQUIRE_AUTHORITY() const -> int = NULL;
57 
58  private:
63 
67  std::string name;
68 
69  public:
75  Service(Client*);
76  virtual ~Service() = default;
77 
81  auto getClient() const->Client*;
82 
83  protected:
84  auto __keepAlive()->ServiceKeeper;
85 
86  public:
92  virtual void sendData(std::shared_ptr<Invoke>);
93  };
94 };
95 };
96 };
Definition: RWMutex.hpp:4
Client * client
Client object Service is belonged to.
Definition: Service.hpp:62
A network boundary with the client in an User.
Definition: Client.hpp:46
An interface of Invoke message chain.
Definition: IProtocol.hpp:31
Standard message of network I/O.
Definition: Invoke.hpp:47
A keeper blocking destrunction of User and Client.
std::string name
A name represents a Service.
Definition: Service.hpp:67
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7