Samchon Framework for CPP
1.0.0
|
Standard message of network I/O. More...
#include <Invoke.hpp>
Public Member Functions | |
Invoke (const std::string &listener) | |
Construct from a listener. More... | |
virtual void | construct (std::shared_ptr< library::XML > xml) override |
Construct data of the Entity from an XML object. More... | |
template<typename T , typename... _Args> | |
Invoke (const std::string &listener, const T &val, const _Args &...args) | |
Construct from arguments. More... | |
auto | getListener () const -> std::string |
Get listener. More... | |
void | setListener (const std::string &val) |
Set listener. More... | |
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::Entity< Key > | |
virtual auto | key () const -> Key |
Get a key that can identify the Entity uniquely. More... | |
Protected Member Functions | |
virtual auto | createChild (std::shared_ptr< library::XML >) -> InvokeParameter *override |
Factory method of a child Entity. More... | |
Protected Attributes | |
std::string | listener |
Represent who listens, often be a function name. More... | |
Standard message of network I/O.
Invoke is a class used in network I/O in protocol package of Samchon Framework.
The Invoke message has an XML structure like the result screen of provided example in below. We can enjoy lots of benefits by the normalized and standardized message structure used in network I/O.
The greatest advantage is that we can make any type of network system, even how the system is enourmously complicated. As network communication message is standardized, we only need to concentrate on logical relationships between network systems. We can handle each network system like a object (class) in OOD. And those relationships can be easily designed by using design pattern.
In Samchon Framework, you can make any type of network system with basic 3 + 1 componenets (IProtocol, Server and IClient + ServerConnector), by implemens or inherits them, like designing classes of S/W architecture.
Definition at line 35 of file Invoke.hpp.
|
inline |
Construct from a listener.
listener | Represents who listens the Invoke message. Almost same with Function name |
Definition at line 60 of file Invoke.hpp.
References listener.
|
inline |
Construct from arguments.
_Ty | Type of an argument which represents a parameter |
_Args | Left varadic template arguments' types |
Creates Invoke and InvokeParameter(s) at the same time by varadic template method.
By the varadic template constructor, you can't specify name of each InvokeParameter, but specify type and value of each InvokeParameter. If you try to record the Invoke to Database, the name of InvokeParameter will be NULL.
By the varadic template constructor, name of InovkeParameter(s) will be omitted. Because of name, an identifier of an InvokeParameter, is omitted, you can't access to InvokeParameter by Invoke::has() or Invoke::get().
listener | A string represents who listens the Invoke message. Almost same with name of a function. |
val | A value to be a parameter of Invoke |
args | Left arguments to be parameters of Invoke |
Definition at line 107 of file Invoke.hpp.
|
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.
Reimplemented from samchon::protocol::EntityGroup< Container, T, Key >.
Definition at line 67 of file Invoke.hpp.
References samchon::protocol::EntityGroup< Container, T, Key >::construct().
|
inlineoverrideprotectedvirtual |
Factory method of a child Entity.
EntityGroup::createChild() is a factory method creating a new child Entity which is belonged to the EntityGroup. This method is called by EntityGroup::construct(). The children construction methods Entity::construct() will be called by abstract method of the EntityGroup::construct().
Implements samchon::protocol::EntityGroup< Container, T, Key >.
Definition at line 75 of file Invoke.hpp.
|
inline |
|
inline |
Set listener.
Definition at line 150 of file Invoke.hpp.
|
inlineoverridevirtual |
A tag name of children.
< TAG>
<CHILD_TAG />
<CHILD_TAG />
</TAG>
Implements samchon::protocol::EntityGroupBase.
Definition at line 162 of file Invoke.hpp.
|
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.
Reimplemented from samchon::protocol::EntityGroup< Container, T, Key >.
Definition at line 167 of file Invoke.hpp.
References samchon::protocol::EntityGroup< Container, T, Key >::toXML().
|
protected |
Represent who listens, often be a function name.
Definition at line 45 of file Invoke.hpp.
Referenced by getListener(), and Invoke().