Samchon Framework for CPP  1.0.0
samchon::templates::external::ExternalSystem Class Reference

#include <ExternalSystem.hpp>

Collaboration diagram for samchon::templates::external::ExternalSystem:

Public Member Functions

 ExternalSystem ()
 
 ExternalSystem (base::ExternalSystemArrayBase *systemArray)
 
 ExternalSystem (base::ExternalSystemArrayBase *systemArray, std::shared_ptr< protocol::ClientDriver > driver)
 
virtual ~ExternalSystem ()=default
 
virtual void construct (std::shared_ptr< library::XML > xml) override
 Construct data of the Entity from an XML object. More...
 
virtual auto key () const -> std::string
 
auto getName () const -> std::string
 
void close ()
 
virtual void sendData (std::shared_ptr< protocol::Invoke > invoke) override
 
virtual void replyData (std::shared_ptr< protocol::Invoke > invoke) override
 
virtual auto CHILD_TAG () const -> std::string override
 A tag name of children. 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::EntityGroup< Container, T, Key >
auto find (const typename child_type::key_type &key) -> typename container_type::iterator
 Get iterator to element. More...
 
auto find (const typename child_type::key_type &key) const -> typename container_type::const_iterator
 Get const iterator to element. More...
 
auto has (const typename child_type::key_type &key) const -> bool
 Indicates whether a container has an object having the specified identifier. More...
 
auto count (const typename child_type::key_type &key) const -> size_t
 Count elements with a specific key. More...
 
auto get (const typename child_type::key_type &key) -> typename container_type::value_type &
 Access the element by specified identifier(key). More...
 
auto get (const typename child_type::key_type &key) const -> const typename container_type::value_type &
 Access the const element by specified identifier(key). More...
 
- 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 Attributes

std::string name
 

Additional Inherited Members

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

Detailed Description

An external system driver.

The ExternalSystem class represents an external system, connected and interact with this system. ExternalSystem takes full charge of network communication with the remote, external system have connected. Replied Invoke messages from the external system is shifted to and processed in, children elements of this class, ExternalSystemRole objects.

Class Diagram

Bridge & Proxy Pattern

The ExternalSystem class can be a bridge for logical proxy. In framework within user, which external system is connected with this system, it's not important. Only interested in user's perspective is which can be done.

By using the logical proxy, user dont't need to know which role is belonged to which system. Just access to a role directly from ExternalSystemArray.getRole. Sends and receives Invoke message via the role.

Templates - External System

Author
Jeongho Nam http://samchon.org

Definition at line 55 of file ExternalSystem.hpp.

Constructor & Destructor Documentation

samchon::templates::external::ExternalSystem::ExternalSystem ( )
inline

Default Constructor.

Definition at line 78 of file ExternalSystem.hpp.

samchon::templates::external::ExternalSystem::ExternalSystem ( base::ExternalSystemArrayBase *  systemArray)
inline

Construct from parent ExternalSystemArray.

Parameters
systemArrayThe parent ExternalSystemArray object.

Definition at line 89 of file ExternalSystem.hpp.

samchon::templates::external::ExternalSystem::ExternalSystem ( base::ExternalSystemArrayBase *  systemArray,
std::shared_ptr< protocol::ClientDriver driver 
)
inline

Constrct from parent ExternalSystemArray and communicator.

Parameters
systemArrayThe parent ExternalSystemArray object.
communicatorCommunicator with the remote, external system.

Definition at line 101 of file ExternalSystem.hpp.

References ~ExternalSystem().

Here is the call graph for this function:

virtual samchon::templates::external::ExternalSystem::~ExternalSystem ( )
virtualdefault

Default Destructor.

The ExternalSystem object is destructed when connection with the remote system is closed or this ExternalSystem object is erased from its parent ExternalSystemArray object.

Referenced by ExternalSystem().

Here is the caller graph for this function:

Member Function Documentation

virtual void samchon::templates::external::ExternalSystem::construct ( std::shared_ptr< library::XML xml)
inlineoverridevirtual

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]

Reimplemented from samchon::protocol::EntityGroup< Container, T, Key >.

Reimplemented in samchon::templates::parallel::ParallelSystem.

Definition at line 115 of file ExternalSystem.hpp.

References samchon::protocol::EntityGroup< Container, T, Key >::construct().

Referenced by samchon::templates::parallel::ParallelSystem::construct().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual auto samchon::templates::external::ExternalSystem::key ( ) const -> std::string
inlinevirtual

Identifier of ExternalSystem is its name.

Returns
name.

Reimplemented from samchon::protocol::Entity< Key >.

Definition at line 138 of file ExternalSystem.hpp.

References name.

auto samchon::templates::external::ExternalSystem::getName ( ) const -> std::string
inline

Get name.

Definition at line 146 of file ExternalSystem.hpp.

References name.

void samchon::templates::external::ExternalSystem::close ( )
inline

Close connection.

Definition at line 158 of file ExternalSystem.hpp.

virtual void samchon::templates::external::ExternalSystem::sendData ( std::shared_ptr< protocol::Invoke invoke)
inlineoverridevirtual

Send Invoke message to external system.

Parameters
invokeAn Invoke message to send.

Definition at line 168 of file ExternalSystem.hpp.

Referenced by samchon::templates::external::ExternalSystemArray< Viewer >::sendData(), and samchon::templates::parallel::ParallelSystemArray< SlaveDriver >::sendPieceData().

Here is the caller graph for this function:

virtual void samchon::templates::external::ExternalSystem::replyData ( std::shared_ptr< protocol::Invoke invoke)
inlineoverridevirtual

Handle an {} message has received.

Parameters
invokeAn Invoke message have received.

Reimplemented in samchon::templates::distributed::DistributedSystem.

Definition at line 178 of file ExternalSystem.hpp.

Referenced by samchon::templates::parallel::ParallelSystem::enforcePerformance(), and samchon::templates::distributed::DistributedSystem::replyData().

Here is the caller graph for this function:

virtual auto samchon::templates::external::ExternalSystem::CHILD_TAG ( ) const -> std::string
inlineoverridevirtual

A tag name of children.

< TAG>
     <CHILD_TAG />
     <CHILD_TAG />
</TAG>

Implements samchon::protocol::EntityGroupBase.

Definition at line 196 of file ExternalSystem.hpp.

virtual auto samchon::templates::external::ExternalSystem::toXML ( ) const -> std::shared_ptr<library::XML>
inlineoverridevirtual

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]

Reimplemented from samchon::protocol::EntityGroup< Container, T, Key >.

Reimplemented in samchon::templates::parallel::ParallelSystem.

Definition at line 201 of file ExternalSystem.hpp.

References samchon::protocol::EntityGroup< Container, T, Key >::toXML().

Referenced by samchon::templates::parallel::ParallelSystem::toXML().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::string samchon::templates::external::ExternalSystem::name
protected

The name represents external system have connected.

Definition at line 69 of file ExternalSystem.hpp.

Referenced by samchon::templates::parallel::ParallelSystem::enforcePerformance(), getName(), and key().


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