Samchon Framework for CPP
1.0.0
|
A role of distributed processing system. More...
#include <DistributedSystemRole.hpp>
Public Member Functions | |
DistributedSystemRole () | |
Default Constructor. More... | |
virtual void | construct (std::shared_ptr< library::XML >) override |
Construct data of the Entity from an XML object. More... | |
auto | getSystem () const -> ExternalSystem *=delete |
Get an external system -> deprecated. More... | |
auto | getPerformance () const -> double |
Get performance. More... | |
auto | getAllocationHistoryList () const -> DSRoleHistoryList * |
Get allocation histories. More... | |
auto | getInvokeHistoryArray () const -> DSInvokeHistoryArray * |
Get invoke histories. More... | |
virtual void | sendData (std::shared_ptr< Invoke >) override |
Send a message. More... | |
virtual auto | toXML () const -> std::shared_ptr< library::XML > override |
Get an XML object represents the Entity. More... | |
![]() | |
ExternalSystemRole (ExternalSystem *) | |
Construct from external system driver. More... | |
auto | getSystem () const -> ExternalSystem * |
Get an external system driver. More... | |
virtual auto | key () const -> std::string override |
Get a key that can identify the Entity uniquely. More... | |
auto | hasSendListener (const std::string &) const -> bool |
Test whether has a listener for send in the role. More... | |
auto | hasReplyListener (const std::string &) const -> bool |
Test whether has a listener for reply in the role. More... | |
virtual auto | TAG () const -> std::string override |
A tag name when represented by XML. More... | |
![]() | |
Entity () | |
Default Constructor. More... | |
![]() | |
IProtocol () | |
Default Constructor. More... | |
virtual void | replyData (std::shared_ptr< Invoke >) |
Reply a message. More... | |
Protected Attributes | |
std::set< DistributedSystem * > | allocatedSystems |
Allocated systems of about the role, at now. More... | |
double | performance |
A required performance index. More... | |
DSRoleHistoryList * | allocationHistoryList |
A history log for archiving role allocation to a system. More... | |
DSInvokeHistoryArray * | invokeHistoryArray |
A history log for archiving elapsed time for each process. More... | |
![]() | |
std::string | name |
A name representing the role. More... | |
std::set< std::string > | replyListeners |
Listeners to reply in the role. More... | |
std::set< std::string > | sendListeners |
Listeners to send in the role. More... | |
A role of distributed processing system.
DistributedSystemRole is an ExternalSystemRole allocates for distributed processing system(s). Unlike the ExternalSystemRole, DistributedSystemRole can belonged to multiple DistributedSystem(s).
ExternalSystemRole is a 'control' class groupping methods, handling Invoke messages interacting with an external system that the ExternalSystemRole is belonged to, by a subject or unit of a module.
ExternalSystemRole can be a "logical proxy" for an ExternalSystem which is containing the ExternalSystemRole. Of course, the ExternalSystemRole is belonged to an ExternalSystem. However, if you access an ExternalSystemRole from an ExternalSystemArray directly, not passing by a belonged ExternalSystem, and send an Invoke message even you're not knowing which ExternalSystem is related in, the ExternalSystemRole acted a role of proxy.
It's called as "Proxy pattern". With the pattern, you can only concentrate on ExternalSystemRole itself, what to do with Invoke message, irrespective of the ExternalSystemRole is belonged to which ExternalSystem.
Definition at line 34 of file DistributedSystemRole.hpp.
DistributedSystemRole::DistributedSystemRole | ( | ) |
Default Constructor.
Definition at line 20 of file DistributedSystemRole.cpp.
References invokeHistoryArray.
|
overridevirtual |
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.
xml | An xml used to construct data of entity |
Reimplemented from samchon::protocol::ExternalSystemRole.
Definition at line 30 of file DistributedSystemRole.cpp.
References samchon::protocol::ExternalSystemRole::construct(), and performance.
|
delete |
Get an external system -> deprecated.
Unlike ExternalSysemRole, DistributedSystemRole can be belonged to multiple DistributedSystem(s). By that reason, the getSystem(), a getter of a single ExternalSystem is deprecated.
auto DistributedSystemRole::getPerformance | ( | ) | const -> double |
auto DistributedSystemRole::getAllocationHistoryList | ( | ) | const -> DSRoleHistoryList* |
Get allocation histories.
Definition at line 40 of file DistributedSystemRole.cpp.
References allocationHistoryList.
auto DistributedSystemRole::getInvokeHistoryArray | ( | ) | const -> DSInvokeHistoryArray* |
Get invoke histories.
Definition at line 44 of file DistributedSystemRole.cpp.
References invokeHistoryArray.
|
overridevirtual |
Send a message.
Sends Invoke message to a network system or shifts the responsibility to related chain.
invoke | An Invoke message to send to a network system |
Reimplemented from samchon::protocol::ExternalSystemRole.
Definition at line 57 of file DistributedSystemRole.cpp.
|
overridevirtual |
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> |
Reimplemented from samchon::protocol::ExternalSystemRole.
Definition at line 66 of file DistributedSystemRole.cpp.
References invokeHistoryArray, performance, samchon::protocol::ExternalSystemRole::toXML(), and samchon::protocol::EntityGroup< _Container, _ETy, T >::toXML().
|
protected |
Allocated systems of about the role, at now.
Definition at line 47 of file DistributedSystemRole.hpp.
|
protected |
A required performance index.
Definition at line 52 of file DistributedSystemRole.hpp.
Referenced by construct(), getPerformance(), and toXML().
|
protected |
A history log for archiving role allocation to a system.
Definition at line 57 of file DistributedSystemRole.hpp.
Referenced by getAllocationHistoryList().
|
protected |
A history log for archiving elapsed time for each process.
Definition at line 62 of file DistributedSystemRole.hpp.
Referenced by DistributedSystemRole(), getInvokeHistoryArray(), and toXML().