Samchon Framework for CPP  1.0.0
MasterDriver.hpp
1 #pragma once
2 #include <samchon/protocol/ExternalServer.hpp>
3 
4 namespace samchon
5 {
6 namespace example
7 {
8 namespace interaction
9 {
10  using namespace std;
11 
12  using namespace library;
13  using namespace protocol;
14 
36  : public protocol::ExternalServer
37  {
38  private:
39  typedef protocol::ExternalServer super;
40 
47 
48  public:
57  MasterDriver(IProtocol *chief, const string &name, const string &ip, int port)
58  : super()
59  {
60  this->chief = chief;
61  this->name = name;
62 
63  this->ip = ip;
64  this->port = port;
65  };
66  virtual ~MasterDriver() = default;
67 
68  protected:
69  virtual auto createChild(shared_ptr<XML>) -> ExternalSystemRole* override
70  {
71  return nullptr;
72  };
73 
74  public:
75  virtual void replyData(shared_ptr<Invoke> invoke) override
76  {
77  chief->replyData(invoke);
78  };
79  };
80 };
81 };
82 };
A driver for each system, master.
virtual void replyData(std::shared_ptr< Invoke >)=0
MasterDriver(IProtocol *chief, const string &name, const string &ip, int port)
Construct from parent(master), name, ip and port.
IProtocol * chief
A chief, containing the driver object.