Samchon Framework for CPP
1.0.0
|
A role belongs to a system. More...
#include <SystemRole.hpp>
Public Member Functions | |
SystemRole () | |
Default Constructor. More... | |
virtual void | construct (std::shared_ptr< library::XML >) override |
Construct data of the Entity from an XML object. More... | |
virtual auto | key () const -> std::string override |
Get a key that can identify the Entity uniquely. More... | |
auto | hasListener (const std::string &) const -> bool |
Test whether has a listener in the role. More... | |
virtual auto | TAG () const -> std::string override |
A tag name when represented by XML. More... | |
virtual auto | toXML () const -> std::shared_ptr< library::XML > override |
Get an XML object represents the Entity. More... | |
![]() | |
Entity () | |
Default Constructor. More... | |
![]() | |
IProtocol () | |
Default Constructor. More... | |
virtual void | replyData (std::shared_ptr< Invoke >) |
Reply a message. More... | |
virtual void | sendData (std::shared_ptr< Invoke >) |
Send a message. More... | |
Protected Attributes | |
std::string | name |
A name representing the role. More... | |
std::set< std::string > | listeners |
Listeners belongs to the role. More... | |
A role belongs to a system.
SystemRole is an abstract and a 'control' class groupping methods, handling Invoke messages interacting with an system that the SystemRole is belonged to, by a subject or unit of a module.
Definition at line 23 of file SystemRole.hpp.
SystemRole::SystemRole | ( | ) |
Default Constructor.
Definition at line 12 of file SystemRole.cpp.
|
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 |
Implements samchon::protocol::Entity.
Definition at line 17 of file SystemRole.cpp.
|
overridevirtual |
Get a key that can identify the Entity uniquely.
If identifier of the Entity is not atomic value, returns a string represents the composite identifier. If identifier of the Entity is not string, converts the identifier to string and returns the string.
Reimplemented from samchon::protocol::Entity.
Definition at line 33 of file SystemRole.cpp.
References name.
auto SystemRole::hasListener | ( | const std::string & | ) | const -> bool |
Test whether has a listener in the role.
Definition at line 38 of file SystemRole.cpp.
|
overridevirtual |
A tag name when represented by XML.
Implements samchon::protocol::Entity.
Definition at line 46 of file SystemRole.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::Entity.
Definition at line 51 of file SystemRole.cpp.
References listeners, name, and samchon::protocol::Entity::toXML().
|
protected |
A name representing the role.
Definition at line 33 of file SystemRole.hpp.
Referenced by construct(), hasListener(), key(), and toXML().
|
protected |
Listeners belongs to the role.
Definition at line 38 of file SystemRole.hpp.
Referenced by construct(), hasListener(), and toXML().