2 #include <samchon/API.hpp> 4 #include <samchon/protocol/SharedEntityDeque.hpp> 5 # include <samchon/templates/external/ExternalSystem.hpp> 6 #include <samchon/templates/external/base/ExternalSystemArrayBase.hpp> 7 #include <samchon/protocol/IProtocol.hpp> 67 template <
class System = ExternalSystem>
70 public base::ExternalSystemArrayBase,
106 for (
size_t i = 0; i < size(); i++)
107 for (
size_t j = 0; j < at(i)->size(); j++)
108 if (at(i)->at(j)->key() ==
key)
121 auto getRole(
const std::string &
key)
const -> std::shared_ptr<ExternalSystemRole>
123 for (
size_t i = 0; i < size(); i++)
124 for (
size_t j = 0; j < at(i)->size(); j++)
125 if (at(i)->at(j)->key() ==
key)
128 throw std::out_of_range(
"No such key.");
131 virtual auto _Get_children()
const -> std::vector<std::shared_ptr<ExternalSystem>>
133 std::vector<std::shared_ptr<ExternalSystem>> children(begin(), end());
145 virtual void sendData(std::shared_ptr<protocol::Invoke> invoke)
147 std::vector<std::thread> threads;
150 threads.reserve(this->size());
151 for (
size_t i = 0; i < size(); i++)
155 for (
auto it = threads.begin(); it != threads.end(); it++)
164 virtual void replyData(std::shared_ptr<protocol::Invoke> invoke) = 0;
169 virtual auto TAG()
const -> std::string
override 171 return "systemArray";
virtual void replyData(std::shared_ptr< protocol::Invoke > invoke)=0
auto hasRole(const std::string &key) const -> bool
virtual auto CHILD_TAG() const -> std::string override
A tag name of children.
void unlock() const
Unlock of read.
An Entity and a container of children Entity objects.
virtual void sendData(std::shared_ptr< protocol::Invoke > invoke)
auto getRole(const std::string &key) const -> std::shared_ptr< ExternalSystemRole >
virtual auto key() const -> Key
Get a key that can identify the Entity uniquely.
virtual void sendData(std::shared_ptr< protocol::Invoke > invoke) override
virtual ~ExternalSystemArray()=default