2 #include <samchon/API.hpp> 4 #include <samchon/protocol/SharedEntityDeque.hpp> 5 # include <samchon/templates/external/ExternalSystemRole.hpp> 6 #include <samchon/templates/external/base/ExternalSystemBase.hpp> 7 #include <samchon/protocol/IProtocol.hpp> 9 #include <samchon/templates/external/base/ExternalSystemArrayBase.hpp> 10 #include <samchon/templates/external/base/ExternalServerBase.hpp> 12 #include <samchon/protocol/ClientDriver.hpp> 57 public base::ExternalSystemBase,
64 std::shared_ptr<protocol::Communicator> communicator_;
81 this->system_array_ =
nullptr;
92 this->system_array_ = systemArray;
101 ExternalSystem(base::ExternalSystemArrayBase *systemArray, std::shared_ptr<protocol::ClientDriver> driver)
103 this->communicator_ = driver;
115 virtual void construct(std::shared_ptr<library::XML> xml)
override 117 name = xml->fetchProperty(
"name");
119 base::ExternalServerBase *server =
dynamic_cast<base::ExternalServerBase*
>(
this);
120 if (server !=
nullptr)
122 server->ip = xml->getProperty<std::string>(
"ip");
123 server->port = xml->getProperty<
int>(
"port");
160 communicator_->close();
168 virtual void sendData(std::shared_ptr<protocol::Invoke> invoke)
override 170 communicator_->sendData(invoke);
178 virtual void replyData(std::shared_ptr<protocol::Invoke> invoke)
override 181 for (
size_t i = 0; i < size(); i++)
182 at(i)->replyData(invoke);
185 ((IProtocol*)system_array_)->replyData(invoke);
192 virtual auto TAG()
const -> std::string
override 201 virtual auto toXML() const ->
std::shared_ptr<library::XML>
override 204 xml->setProperty(
"name", name);
206 const base::ExternalServerBase *server =
dynamic_cast<const base::ExternalServerBase*
>(
this);
207 if (server !=
nullptr)
209 xml->setProperty(
"ip", server->ip);
210 xml->setProperty(
"port", server->port);
virtual auto CHILD_TAG() const -> std::string override
A tag name of children.
virtual void construct(std::shared_ptr< library::XML > xml)
Construct data of the Entity from an XML object.
ExternalSystem(base::ExternalSystemArrayBase *systemArray, std::shared_ptr< protocol::ClientDriver > driver)
virtual void construct(std::shared_ptr< library::XML > xml) override
Construct data of the Entity from an XML object.
virtual auto toXML() const -> std::shared_ptr< library::XML > override
Get an XML object represents the EntityGroup.
An Entity and a container of children Entity objects.
virtual void replyData(std::shared_ptr< protocol::Invoke > invoke) override
virtual auto key() const -> std::string
virtual ~ExternalSystem()=default
ExternalSystem(base::ExternalSystemArrayBase *systemArray)
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the EntityGroup.
auto getName() const -> std::string
virtual void sendData(std::shared_ptr< protocol::Invoke > invoke) override