Samchon Framework for CPP  1.0.0
DistributedSystemArray.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <samchon/protocol/ExternalSystemArray.hpp>
5 
6 #include <samchon/Dictionary.hpp>
7 #include <samchon/library/GAParameters.hpp>
8 
9 namespace samchon
10 {
11 namespace protocol
12 {
13 namespace master
14 {
15  class DistributedSystem;
16  class DistributedSystemRole;
17 
39  class SAMCHON_FRAMEWORK_API DistributedSystemArray
40  : public virtual ExternalSystemArray
41  {
42  private:
43  typedef ExternalSystemArray super;
44 
45  protected:
50 
54  struct library::GAParameters gaParameters;
55 
56  public:
57  /* ------------------------------------------------------------------
58  CONSTRUCTORS
59  ------------------------------------------------------------------ */
64  virtual ~DistributedSystemArray() = default;
65 
66  virtual void construct(std::shared_ptr<library::XML>) override;
67 
68  protected:
75  virtual auto createRole(std::shared_ptr<library::XML>)->DistributedSystemRole* = 0;
76 
77  public:
78  /* ------------------------------------------------------------------
79  PROCESS
80  ------------------------------------------------------------------ */
81  virtual void start() override;
82 
95  virtual void allocateRoles();
96 
97  /* ------------------------------------------------------------------
98  GETTERS
99  ------------------------------------------------------------------ */
100  SHARED_ENTITY_ARRAY_ELEMENT_ACCESSOR_HEADER(DistributedSystem)
101 
102 
108  auto hasRole(const std::string &) const -> bool;
109 
116  auto getRole(const std::string &) const->std::shared_ptr<DistributedSystemRole>;
117 
118  /* ------------------------------------------------------------------
119  EXPORTERS
120  ------------------------------------------------------------------ */
121  virtual auto toXML() const->std::shared_ptr<library::XML> override;
122  };
123 };
124 };
125 };
Customized std::map.
Definition: Map.hpp:88
An array of ExternalSystem(s).
Definition: RWMutex.hpp:4
An array of distributed system drivers.
Dictionary< std::shared_ptr< DistributedSystemRole > > roleDictionary
A dictionary of role objects.
An Entity and a container of children Entity objects.
Definition: EntityGroup.hpp:52
A role of distributed processing system.
A network driver for a distributed system.
A structure containing parameters of genetic algorithm.
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7