2 #include <samchon/templates/parallel/MediatorClient.hpp> 4 #include <samchon/examples/interaction/base/MasterBase.hpp> 14 class MasterDriver :
public templates::parallel::MediatorClient
17 typedef templates::parallel::MediatorClient super;
22 MasterDriver(Mediator *mediator,
int port)
23 : super((templates::external::base::ExternalSystemArrayBase*)mediator,
"127.0.0.1", port)
27 virtual ~MasterDriver() =
default;
29 virtual void sendData(std::shared_ptr<protocol::Invoke> invoke)
override 31 super::sendData(invoke);
34 getSystemArray<base::MasterBase>()->getMonitor()->reportSendData(uid, invoke);
36 virtual void replyData(std::shared_ptr<protocol::Invoke> invoke)
override 38 if (invoke->getListener() ==
"set_master_uid")
39 uid = invoke->front()->getValue<
int>();
41 super::replyData(invoke);
virtual void replyData(std::shared_ptr< Invoke >)=0
virtual void sendData(std::shared_ptr< Invoke >)=0