Samchon Framework for CPP  1.0.0
DistributedSystem.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <samchon/protocol/ExternalSystem.hpp>
5 
6 namespace samchon
7 {
8 namespace protocol
9 {
10 namespace master
11 {
12  class DistributedSystemArray;
13  class DistributedSystemRole;
14 
15  class DSInvokeHistoryArray;
16  class DSRoleHistoryList;
17 
44  class SAMCHON_FRAMEWORK_API DistributedSystem
45  : public virtual ExternalSystem
46  {
47  friend class DistributedSystemArray;
48 
49  private:
50  typedef ExternalSystem super;
51 
52  protected:
53  /* --------------------------------------------------------------------------------
54  VARIABLES FOR ESTIMATING PERFORMANCE
55  -------------------------------------------------------------------------------- */
67  size_t inProgress;
68 
72  size_t processed;
73 
85 
86  /* --------------------------------------------------------------------------------
87  OBJECTS FOR HISTORIES
88  -------------------------------------------------------------------------------- */
103  double performance;
104 
108  DSRoleHistoryList *roleHistoryList;
109 
114 
115  public:
116  /* ------------------------------------------------------------------
117  CONSTRUCTORS
118  ------------------------------------------------------------------ */
123  virtual ~DistributedSystem();
124 
125  virtual void construct(std::shared_ptr<library::XML>) override;
126 
127  protected:
128  virtual auto createChild(std::shared_ptr<library::XML>)->ExternalSystemRole* override;
129 
130  public:
131  // GETTER
132  SHARED_ENTITY_ARRAY_ELEMENT_ACCESSOR_HEADER(DistributedSystemRole)
133 
134  /* ------------------------------------------------------------------
135  CHAIN OF INVOKE MESSAGE
136  ------------------------------------------------------------------ */
137  virtual void sendData(std::shared_ptr<Invoke>) override;
138  virtual void replyData(std::shared_ptr<Invoke>) override;
139 
140  /* ------------------------------------------------------------------
141  EXPORTERS
142  ------------------------------------------------------------------ */
143  virtual auto toXML() const->std::shared_ptr<library::XML> override;
144  };
145 };
146 };
147 };
DSInvokeHistoryArray * invokeHistoryArray
A list of history log for reported Invoke messages.
size_t inProgress
A number of processes running on the distributed system.
size_t processed
A number of processed have runned.
Definition: RWMutex.hpp:4
DSRoleHistoryList * roleHistoryList
A list of history log for role allocations.
An array of distributed system drivers.
An Entity and a container of children Entity objects.
Definition: EntityGroup.hpp:52
A network driver for an external system.
A role of distributed processing system.
A network driver for a distributed system.
Standard message of network I/O.
Definition: Invoke.hpp:47
double avgElapsedTime
Average of elapsed time.
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7