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

A chief system managing master systems. More...

#include <Chief.hpp>

Collaboration diagram for samchon::example::interaction::Chief:

Public Member Functions

 Chief (const string &ip)
 Construct from ip address. More...
 
virtual void start ()
 Start interaction. More...
 
- Public Member Functions inherited from samchon::protocol::ExternalSystemArray
 ExternalSystemArray ()
 Default Constructor. More...
 
auto hasRole (const std::string &) const -> bool
 Test whether has a role. More...
 
auto getRole (const std::string &) const -> std::shared_ptr< ExternalSystemRole >
 Get a role. More...
 
virtual void sendData (std::shared_ptr< Invoke >) override
 Sends an Invoke message to related ExternalSystem(s). More...
 
virtual void replyData (std::shared_ptr< Invoke >) override
 Handle replied Invoke message. 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...
 
virtual void construct (std::shared_ptr< library::XML > xml)
 Construct data of the Entity from an XML object. 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...
 
virtual auto toXML () const -> std::shared_ptr< library::XML >
 Get an XML object represents the EntityGroup. More...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
virtual auto key () const -> std::string
 Get a key that can identify the Entity uniquely. More...
 
- Public Member Functions inherited from samchon::protocol::IEntityGroup
 IEntityGroup ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::IProtocol
 IProtocol ()
 Default Constructor. More...
 

Static Public Member Functions

static void main ()
 Main function. More...
 

Private Member Functions

void callPacker ()
 Call packer master system. More...
 
void callTSP ()
 Call tsp master system. More...
 

Additional Inherited Members

- Protected Member Functions inherited from samchon::protocol::EntityGroup< _Container, _ETy, T >
virtual auto createChild (std::shared_ptr< library::XML >) -> entity_type *=0
 Factory method of a child Entity. More...
 

Detailed Description

A chief system managing master systems.

A chief system manages master systems. The chief system orders optimization processes to each master system and get reports of the optimization results from those master systems.

The chief system and Chief class is built for providing a guidance for external system module. You can study how to intergrate a system with external network system following the example, the chief system and Chief class.

example_interaction.png
example_interaction_network_diagram.png
[Inherited]
Author
Jeongho Nam http://samchon.org

Definition at line 46 of file Chief.hpp.

Constructor & Destructor Documentation

samchon::example::interaction::Chief::Chief ( const string &  ip)
inline

Construct from ip address.

Parameters
ipIP address of master systems.

Definition at line 61 of file Chief.hpp.

Member Function Documentation

virtual void samchon::example::interaction::Chief::start ( )
inlinevirtual

Start interaction.

An abstract method starting interaction with external systems.

If external systems are servers, starts connection to them, else clients, opens a server and accepts the external systems. You can addict your own procudures of starting drivers, but if you directly override method of abstract ExternalSystemArray, be careful about virtual inheritance.

  • DistributedClientArray::start() calls DistributedSystemArray::start() and ExternalClientArray:start()

Reimplemented from samchon::protocol::ExternalServerArray.

Definition at line 69 of file Chief.hpp.

Referenced by main().

Here is the caller graph for this function:

void samchon::example::interaction::Chief::callPacker ( )
inlineprivate

Call packer master system.

Sends a message to packer system for ordering find the best solution of packaging with its basic data. The packer system who got the ordering message will find and reply the best optimization result about the basic data.

Definition at line 116 of file Chief.hpp.

References samchon::example::packer::Packer::toXML().

Here is the call graph for this function:

void samchon::example::interaction::Chief::callTSP ( )
inlineprivate

Call tsp master system.

Sends a message to tsp system for ordering find the best solution of tsp with its basic data. The tsp system who got the ordering message will find and reply the best optimization result about the basic data.

Definition at line 158 of file Chief.hpp.

References samchon::example::tsp::Scheduler::toXML().

Here is the call graph for this function:

static void samchon::example::interaction::Chief::main ( )
inlinestatic

Main function.

Definition at line 179 of file Chief.hpp.

References start().

Here is the call graph for this function:


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