Samchon Framework for CPP  1.0.0
samchon::example::interaction::Slave Class Reference

A slave system for optimizing something. More...

#include <Slave.hpp>

Public Member Functions

 Slave (const string &ip, int port)
 Construct from ip address and port number of master. More...
 

Protected Member Functions

virtual void optimize (shared_ptr< XML > xml, size_t index, size_t size)
 Optimize something and report the result. More...
 
void sendOptimization (shared_ptr< XML > xml)
 Send (report) optimization result to its master system. More...
 

Detailed Description

A slave system for optimizing something.

Slave is an abstract and example class, for providing guidance of realizing parallel processsing system for useres, within framework of slave. The Slave class represents a slave system literally. You can study how to utilize the slave module in protocol.

A slave system (represented by Slave and SlaveDriver) is associated with a master (represented by Master and MasterSlave) or mediator (PackerMediator) system. When slave system gets order of optimization with its basic data, slave system calculates and derives the best solution and reports it to the master system.

example_interaction.png
example_interaction_network_diagram.png
[Inherited]
See also
protocol::slave
Author
Jeongho Nam http://samchon.org

Definition at line 43 of file Slave.hpp.

Constructor & Destructor Documentation

samchon::example::interaction::Slave::Slave ( const string &  ip,
int  port 
)
inline

Construct from ip address and port number of master.

Parameters
ipIP address of master.
portPort number of master.

Definition at line 59 of file Slave.hpp.

Member Function Documentation

virtual void samchon::example::interaction::Slave::optimize ( shared_ptr< XML xml,
size_t  index,
size_t  size 
)
inlineprotectedvirtual

Optimize something and report the result.

Parameters
xmlXML object representing a Travel.
indexStarting index of a segmentation allocated to the Slave.
sizeSize of the segmentation.

Reimplemented in samchon::example::interaction::PackerSlave, and samchon::example::interaction::TSPSlave.

Definition at line 89 of file Slave.hpp.

void samchon::example::interaction::Slave::sendOptimization ( shared_ptr< XML xml)
inlineprotected

Send (report) optimization result to its master system.

Parameters
xmlXML object representing the best solution.

Definition at line 101 of file Slave.hpp.


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