Samchon Framework for CPP  1.0.0
samchon::templates::external::ExternalSystemRole Class Referenceabstract

#include <ExternalSystemRole.hpp>

Collaboration diagram for samchon::templates::external::ExternalSystemRole:

Public Member Functions

 ExternalSystemRole (ExternalSystem *system)
 
virtual ~ExternalSystemRole ()=default
 
virtual auto key () const -> std::string
 
auto getSystem () const -> ExternalSystem *
 
auto getName () const -> std::string
 
virtual void sendData (std::shared_ptr< protocol::Invoke > invoke) override
 
virtual void replyData (std::shared_ptr< protocol::Invoke > invoke)=0
 
- 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
 

Detailed Description

A role of an external system.

The ExternalSystemRole class represents a role, WHAT TO DO. Extends the ExternalSystemRole class and overrides replyData() to define the WHAT TO DO. And assign this ExternalSystemRole object to related ExternalSystem object.

Class Diagram

Proxy Pattern

The ExternalSystemRole class can be an 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 49 of file ExternalSystemRole.hpp.

Constructor & Destructor Documentation

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

Constructor from a system.

Parameters
systemAn external system containing this role.

Definition at line 77 of file ExternalSystemRole.hpp.

References ~ExternalSystemRole().

Here is the call graph for this function:

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

Default Destructor.

Referenced by ExternalSystemRole().

Here is the caller graph for this function:

Member Function Documentation

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

Identifier of ExternalSystemRole is its name.

Reimplemented from samchon::protocol::Entity< std::string >.

Definition at line 98 of file ExternalSystemRole.hpp.

References name.

auto samchon::templates::external::ExternalSystemRole::getSystem ( ) const -> ExternalSystem*
inline

Get parent ExternalSystemRole object.

Definition at line 106 of file ExternalSystemRole.hpp.

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

Get name, who represents and identifies this role.

Definition at line 114 of file ExternalSystemRole.hpp.

References name.

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

Send an Invoke message.

Sends an Invoke message to remote system through the parent ExternalSystem object.

Parameters
invokeAn Invoke message to send to the external system.

Definition at line 129 of file ExternalSystemRole.hpp.

References replyData().

Here is the call graph for this function:

virtual void samchon::templates::external::ExternalSystemRole::replyData ( std::shared_ptr< protocol::Invoke invoke)
pure virtual

Handle replied Invoke message.

ExternalSystemRole.replyData() is an abstract method handling a replied message gotten from remote system via parent ExternalSystem object. Overrides this method and defines the WHAT TO DO with the message.

Parameters
invokeAn Invoke message received from the external system.

Referenced by sendData().

Here is the caller graph for this function:

Member Data Documentation

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

A name, represents and identifies this role.

This name is an identifier represents this role. This name is used in ExternalSystemArray.getRole and ExternalSystem.get, as a key elements. Thus, this name should be unique in an ExternalSystemArray.

Definition at line 66 of file ExternalSystemRole.hpp.

Referenced by getName(), and key().


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