Samchon Framework for CPP  1.0.0
samchon::templates::parallel::MediatorWebClient Class Reference

#include <MediatorWebClient.hpp>

Collaboration diagram for samchon::templates::parallel::MediatorWebClient:

Public Member Functions

 MediatorWebClient (external::base::ExternalSystemArrayBase *system_array_, const std::string &ip, int port)
 
 MediatorWebClient (external::base::ExternalSystemArrayBase *system_array_, const std::string &ip, int port, const std::string &path)
 
virtual void start () override
 
- Public Member Functions inherited from samchon::templates::parallel::MediatorClient
 MediatorClient (external::base::ExternalSystemArrayBase *system_array_, const std::string &ip, int port)
 
- Public Member Functions inherited from samchon::templates::parallel::MediatorSystem
 MediatorSystem (external::base::ExternalSystemArrayBase *systemArray)
 
virtual ~MediatorSystem ()=default
 
template<class SystemArray >
auto getSystemArray () const -> SystemArray *
 
- Public Member Functions inherited from samchon::protocol::IProtocol
virtual void replyData (std::shared_ptr< Invoke >)=0
 
virtual void sendData (std::shared_ptr< Invoke >)=0
 

Protected Member Functions

virtual auto createServerConnector () -> protocol::ServerConnector *
 

Detailed Description

A mediator client, driver for the master server.

The MediatorWebClient is a class being a client connecting to the master server, following the web-socket protocol.

[Inherited] MediatorSystem}

A mediator, the master driver.

The MediatorSystem is an abstract class helping ParallelSystemArrayMediator can be a slave system. The MediatorSystem interacts and communicates with the master system as a role of slave.

This MediatorSystem object is created in ParallelSystemArrayMediator.createMediator. Override the method and return one of them, which are derived from this MediatorSystem class, considering which type and protocol the master system follows:

When the master orders a parallel process to this slave, then the MediatorSystem delivers the parallel process to its parent ParallelSystemArrayMediator object. The ParallelSystemArrayMediator object distributes the parallel process to its slaves system, ParallelSystem objects. When the parallel process has completed, then MediatorSystem reports the result to its master.

Class Diagram

Templates - Parallel System, Distributed System

Author
Jeongho Nam http://samchon.org

Definition at line 22 of file MediatorWebClient.hpp.

Constructor & Destructor Documentation

samchon::templates::parallel::MediatorWebClient::MediatorWebClient ( external::base::ExternalSystemArrayBase *  system_array_,
const std::string &  ip,
int  port 
)
inline

Initializer Constructor.

Parameters
systemArrayThe parent ParallelSystemArrayMediator object.
ipIP address to connect.
portPort number to connect.

Definition at line 42 of file MediatorWebClient.hpp.

samchon::templates::parallel::MediatorWebClient::MediatorWebClient ( external::base::ExternalSystemArrayBase *  system_array_,
const std::string &  ip,
int  port,
const std::string &  path 
)
inline

Initializer Constructor.

Parameters
systemArrayThe parent ParallelSystemArrayMediator object.
ipIP address to connect.
portPort number to connect.
pathPath of service which you want.

Definition at line 55 of file MediatorWebClient.hpp.

Member Function Documentation

virtual auto samchon::templates::parallel::MediatorWebClient::createServerConnector ( ) -> protocol::ServerConnector*
inlineprotectedvirtual

Factory method creating ServerConnector object.

The createServerConnector() is an abstract method creating ServerConnector object. Overrides and returns one of them, considering which protocol the master server follows:

Returns
A newly created ServerConnector object.

Reimplemented from samchon::templates::parallel::MediatorClient.

Definition at line 63 of file MediatorWebClient.hpp.

Referenced by start().

Here is the caller graph for this function:

virtual void samchon::templates::parallel::MediatorWebClient::start ( )
inlineoverridevirtual

Start interaction.

The start() is an abstract method starting interaction with the master system. If the master is a server, then connects to the master. Otherwise, the master is client, then this MediatorSystem object wil open a server accepting the master.

Reimplemented from samchon::templates::parallel::MediatorClient.

Definition at line 72 of file MediatorWebClient.hpp.

References samchon::protocol::WebServerConnector::connect(), and createServerConnector().

Here is the call graph for this function:


The documentation for this class was generated from the following file: