Samchon Framework for CPP  1.0.0
MasterBase.hpp
1 #pragma once
2 #include <samchon/templates/parallel/ParallelSystemArray.hpp>
3 #include <samchon/examples/interaction/base/SystemBase.hpp>
4 
5 #include <queue>
6 #include <samchon/templates/PInvoke.hpp>
7 #include <samchon/examples/interaction/MonitorDriver.hpp>
8 
9 namespace samchon
10 {
11 namespace examples
12 {
13 namespace interaction
14 {
15  class SlaveDriver;
16  class TSPRequest;
17  class PackerRequest;
18 
19 namespace base
20 {
21  class MasterBase
22  : public virtual templates::parallel::ParallelSystemArray<SlaveDriver>,
23  public SystemBase
24  {
25  protected:
26  std::unique_ptr<MonitorDriver> monitor;
27  std::unique_ptr<TSPRequest> tsp;
28  std::unique_ptr<PackerRequest> packer;
29 
30  std::queue<std::shared_ptr<templates::PInvoke>> p_invoke_queue;
31 
32  public:
33  virtual auto getParent() const -> protocol::IProtocol* = 0;
34  auto getMonitor() const -> MonitorDriver*
35  {
36  return monitor.get();
37  };
38 
39  auto getTSP() const -> TSPRequest*
40  {
41  return tsp.get();
42  };
43  auto getPacker() const -> PackerRequest*
44  {
45  return packer.get();
46  };
47 
48  auto _Get_p_invoke_queue() -> std::queue<std::shared_ptr<templates::PInvoke>>&
49  {
50  return p_invoke_queue;
51  };
52  };
53 };
54 };
55 };
56 };