Samchon Framework for CPP
1.0.0
|
#include <ExternalClientArray.hpp>
Public Member Functions | |
ExternalClientArray () | |
Public Member Functions inherited from samchon::templates::external::ExternalSystemArray< System > | |
ExternalSystemArray () | |
virtual | ~ExternalSystemArray ()=default |
auto | hasRole (const std::string &key) const -> bool |
auto | getRole (const std::string &key) const -> std::shared_ptr< ExternalSystemRole > |
virtual void | sendData (std::shared_ptr< protocol::Invoke > invoke) |
virtual void | replyData (std::shared_ptr< protocol::Invoke > invoke)=0 |
virtual auto | CHILD_TAG () const -> std::string override |
A tag name of children. More... | |
Public Member Functions inherited from samchon::protocol::EntityGroup< Container, T, Key > | |
virtual void | construct (std::shared_ptr< library::XML > xml) |
Construct data of the Entity from an XML object. More... | |
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... | |
virtual auto | toXML () const -> std::shared_ptr< library::XML > |
Get an XML object represents the EntityGroup. 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... | |
Public Member Functions inherited from samchon::protocol::IProtocol | |
virtual void | replyData (std::shared_ptr< Invoke >)=0 |
virtual void | sendData (std::shared_ptr< Invoke >)=0 |
Public Member Functions inherited from samchon::protocol::Server | |
Server () | |
virtual | ~Server () |
virtual void | open (int port) |
virtual void | close () |
Protected Member Functions | |
virtual void | addClient (std::shared_ptr< protocol::ClientDriver > driver) override final |
virtual auto | createChild (std::shared_ptr< library::XML > xml) -> System *override |
virtual auto | createExternalClient (std::shared_ptr< protocol::ClientDriver >) -> System *=0 |
Protected Member Functions inherited from samchon::protocol::Server | |
virtual void | addClient (std::shared_ptr< ClientDriver >)=0 |
An array and manager of external clients as a server.
The ExternalClientArray is an abstract class, derived from the ExternalSystemArray class, opening a server accepting external clients.
Extends this ExternalClientArray, overrides createExternalClient() creating child ExternalSystem object. After the extending and overridings, open this server using the open() method. If you want this server to follow web-socket protocol, then overrides WebServer virtually.
An array and manager of external system drivers.
The ExternalSystemArray is an abstract class containing and managing external system drivers, ExternalSystem objects. Within framewokr of network, ExternalSystemArray represents your system and children ExternalSystem objects represent remote, external systems connected with your system. With this ExternalSystemArray, you can manage multiple external systems as a group.
You can specify this ExternalSystemArray class to be a server accepting external clients or a client connecting to external servers. Even both of them is also possible.
The ExternalSystemArray class can use Proxy Pattern. 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.
Definition at line 30 of file ExternalClientArray.hpp.
|
inline |
Default Constructor.
Definition at line 45 of file ExternalClientArray.hpp.
|
inlinefinaloverrideprotectedvirtual |
Add a newly connected remote client.
When a remote client connects to this server ExternalClientArray object, then this ExternalClientArray creates a child external client object through the createExternalClient() method and inserts it.
driver | A communicator for external client. |
Definition at line 66 of file ExternalClientArray.hpp.
|
inlineoverrideprotectedvirtual |
(Deprecated) Factory method creating child object.
The method createChild() is deprecated. Don't use and override this.
Note that, the ExternalClientArray is a server accepting external clients. There's no way to creating the external clients in advance before opening the server.
xml | An XML object represents the child ExternalSystem object. |
Implements samchon::protocol::EntityGroup< Container, T, Key >.
Reimplemented in samchon::templates::external::ExternalServerClientArray< System >.
Definition at line 100 of file ExternalClientArray.hpp.
|
protectedpure virtual |
Factory method creating a child ExternalSystem object.
driver | A communicator with connected client. |
Referenced by samchon::templates::external::ExternalClientArray< Viewer >::addClient(), and samchon::templates::external::ExternalClientArray< Viewer >::createChild().