Samchon Framework for CPP  1.0.0
ParallelSystemArrayBase.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <samchon/templates/external/base/ExternalSystemArrayBase.hpp>
5 
6 namespace samchon
7 {
8 namespace templates
9 {
10 namespace slave
11 {
12  class InvokeHistory;
13 };
14 
15 namespace parallel
16 {
17 namespace base
18 {
19  class ParallelSystemArrayBase
20  {
21  private:
22  size_t history_sequence_{0};
23 
24  public:
25  /* ---------------------------------------------------------
26  CONSTRUCTORS
27  --------------------------------------------------------- */
28  ParallelSystemArrayBase()
29  {
30  history_sequence_ = 0;
31  };
32  virtual ~ParallelSystemArrayBase() = default;
33 
34  /* ---------------------------------------------------------
35  ACCESSORS
36  --------------------------------------------------------- */
37  auto _Get_history_sequence() const -> size_t
38  {
39  return history_sequence_;
40  };
41  auto _Fetch_history_sequence() -> size_t
42  {
43  return ++history_sequence_;
44  };
45 
46  void _Set_history_sequence(size_t val)
47  {
48  history_sequence_ = val;
49  };
50 
51  public:
52  /* ---------------------------------------------------------
53  INVOKE MESSAGE CHAIN
54  --------------------------------------------------------- */
55  virtual auto sendPieceData(std::shared_ptr<protocol::Invoke> invoke, size_t first, size_t last) -> size_t = 0;
56 
57  virtual auto _Complete_history(std::shared_ptr<slave::InvokeHistory> history) -> bool = 0;
58  };
59 };
60 };
61 };
62 };