Samchon Framework for CPP  1.0.0
samchon::protocol::master::ParallelServer Class Reference

A network driver for a parallel server. More...

#include <ParallelServer.hpp>

Collaboration diagram for samchon::protocol::master::ParallelServer:

Public Member Functions

 ParallelServer ()
 Default Constructor. More...
 
virtual void construct (std::shared_ptr< library::XML >) override
 Construct data of the Entity from an XML object. More...
 
virtual auto toXML () const -> std::shared_ptr< library::XML > override
 Get an XML object represents the EntityGroup. More...
 
- Public Member Functions inherited from samchon::protocol::master::ParallelSystem
 ParallelSystem ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::ExternalSystem
 ExternalSystem ()
 Default Constructor. More...
 
virtual auto key () const -> std::string override
 Get a key that can identify the Entity uniquely. More...
 
virtual void replyData (std::shared_ptr< Invoke >) override
 Handling replied message from an external system. More...
 
virtual auto TAG () const -> std::string override
 A tag name when represented by XML. More...
 
virtual auto CHILD_TAG () const -> std::string override
 A tag name of children. More...
 
- Public Member Functions inherited from samchon::protocol::EntityGroup< _Container, _ETy, T >
 EntityGroup ()
 Default Constructor. More...
 
auto has (const std::string &key) const -> bool
 Indicates whether a container has an object having the specified identifier. More...
 
auto get (const std::string &key) -> value_type &
 Access the element by specified identifier(key). More...
 
auto get (const std::string &key) const -> const value_type &
 Access the const element by specified identifier(key). More...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::IEntityGroup
 IEntityGroup ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::IClient
 IClient ()
 Default Constructor. More...
 
virtual void listen ()
 Listens message from a related system. More...
 
virtual void sendData (std::shared_ptr< Invoke >)
 Sends message to a related system. More...
 
- Public Member Functions inherited from samchon::protocol::IProtocol
 IProtocol ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::ExternalServer
 ExternalServer ()
 Default Constructor. More...
 
virtual void start () override
 Start interaction. More...
 
virtual auto getIP () const -> std::string override
 Destinatio IP. More...
 
virtual auto getPort () const -> int override
 Destination port. More...
 
virtual auto getMyIP () const -> std::string override
 (optional) My IP, if you want to bind More...
 
- Public Member Functions inherited from samchon::protocol::ServerConnector
 ServerConnector ()
 Default Constructor. More...
 
virtual void connect ()
 Connect to a server. More...
 

Additional Inherited Members

- Protected Member Functions inherited from samchon::protocol::master::ParallelSystem
virtual auto createChild (std::shared_ptr< library::XML >) -> ExternalSystemRole *override
 Factory method of a child Entity. More...
 
virtual void _replyData (std::shared_ptr< Invoke >) override
 A method for pre-processing replied Invoke message. More...
 
- Protected Member Functions inherited from samchon::protocol::IClient
virtual auto BUFFER_SIZE () const -> size_t
 Buffer size of network I/O. More...
 
- Protected Attributes inherited from samchon::protocol::master::ParallelSystem
ParallelSystemArraysystemArray
 A master that the system is belonged to. More...
 
PRInvokeHistoryArrayhistoryArray
 A list of history log for reported Invoke messages. More...
 
PRInvokeHistoryArrayprogressArray
 A list of invoke messages on progress. More...
 
double performance
 A performance index. More...
 
- Protected Attributes inherited from samchon::protocol::ExternalSystem
std::string name
 A name can identify an external system. More...
 
std::string ip
 An ip address of an external system. More...
 
int port
 A port number of an external system. More...
 
- Protected Attributes inherited from samchon::protocol::IClient
Socket * socket
 Socket for network I/O. More...
 
std::mutex * sendMtx
 A mutex for sending message. More...
 
- Protected Attributes inherited from samchon::protocol::ExternalServer
std::string myIP
 A custom ip address of my system to bind. More...
 
- Protected Attributes inherited from samchon::protocol::ServerConnector
boost::asio::io_service * ioService
 An io_service of Boost.Asio's own. More...
 
EndPoint * endPoint
 An endpoint directing a server. More...
 
EndPoint * localEndPoint
 (Optional) An local endpoint of the client (my system) More...
 

Detailed Description

A network driver for a parallel server.

ParallelServer is an ParallelSystem specialized in server driver.

[Inherited]

ParallelSystem class is an ExternalSystem having performance index and history logs of handled Invoke messages with those elapsed times. Those performance index and history logs are used to determine how much segmentation to be allocated.

Each segmentation in requested process (Invoke message) is equivalent. Thus, role of ParallelSystem objects in a ParallelSystemArray are almost same and does not need to specify ExternalSystemRole on ParallelSystem.

protocol_master_parallel_system.png
[Inherited]

Definition at line 22 of file ParallelServer.hpp.

Constructor & Destructor Documentation

ParallelServer::ParallelServer ( )

Default Constructor.

Definition at line 8 of file ParallelServer.cpp.

Member Function Documentation

void ParallelServer::construct ( std::shared_ptr< library::XML xml)
overridevirtual

Construct data of the Entity from an XML object.

Constructs the EntityGroup's own member variables only from the input XML object.

Do not consider about constructing children Entity objects' data in EntityGroup::construct(). Those children Entity objects' data will constructed by their own construct() method. Even insertion of XML objects representing children are done by abstract method of EntityGroup::toXML().

Constructs only data of EntityGroup's own.

[Inherited]
Construct data of the Entity from an XML object.

Overrides the construct() method and fetch data of member variables from the XML.

By recommended guidance, data representing member variables are contained in properties of the put XML object.

Parameters
xmlAn xml used to construct data of entity

Reimplemented from samchon::protocol::ExternalServer.

Definition at line 14 of file ParallelServer.cpp.

References samchon::protocol::master::ParallelSystem::construct(), and samchon::protocol::ExternalServer::myIP.

Here is the call graph for this function:

auto ParallelServer::toXML ( ) const -> std::shared_ptr<library::XML>
overridevirtual

Get an XML object represents the EntityGroup.

Archives the EntityGroup's own member variables only to the returned XML object.

Do not consider about archiving children Entity objects' data in EntityGroup::toXML(). Those children Entity objects will converted to XML object by their own toXML() method. The insertion of XML objects representing children are done by abstract method of EntityGroup::toXML().

Archives only data of EntityGroup's own.

[Inherited]
Get an XML object represents the Entity.

Returns an XML object that can represents the Entity containing member variables into properties.

A member variable (not object, but atomic value like number, string or date) is categorized as a property within the framework of entity side. Thus, when overriding a toXML() method and archiving member variables to an XML object to return, puts each variable to be a property belongs to only an XML object.

Don't archive the member variable of atomic value to XML::value causing enormouse creation of XML objects to number of member variables. An Entity must be represented by only an XML instance (tag).

Standard Usage Non-standard usage abusing value
<memberList>
     <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' />
     <member id='master' name='Administartor' birthdate='2011-07-28' />
</memberList>
<member>
     <id>jhnam88</id>
     <name>Jeongho+Nam</name>
     <birthdate>1988-03-11</birthdate>
</member>
Returns
An XML object representing the Entity.

Reimplemented from samchon::protocol::ExternalServer.

Definition at line 24 of file ParallelServer.cpp.

References samchon::protocol::ExternalServer::myIP, and samchon::protocol::master::ParallelSystem::toXML().

Here is the call graph for this function:


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