SmartSoft Component-Developer API
|
This is the base class for all server-patterns. More...
#include <smartIServerPattern.h>
Public Member Functions | |
IServerPattern (IComponent *component, const std::string &serviceName) | |
Constructor. More... | |
virtual | ~IServerPattern () |
Destructor. More... | |
Public Member Functions inherited from Smart::ICommunicationPattern | |
ICommunicationPattern (IComponent *component) | |
Default Constructor initializing an IShutdownObserver. More... | |
virtual | ~ICommunicationPattern ()=default |
Default Destructor. More... | |
Public Member Functions inherited from Smart::IShutdownObserver | |
IShutdownObserver (ShutdownSubject *subject=nullptr) | |
The default constructor. More... | |
virtual | ~IShutdownObserver () |
The default destructor. More... | |
Protected Member Functions | |
bool | is_shutting_down () const |
virtual void | on_shutdown () |
implements individual shutdown strategy. More... | |
virtual void | serverInitiatedDisconnect ()=0 |
implements server-initiated-disconnect (SID) More... | |
Protected Member Functions inherited from Smart::ICommunicationPattern | |
ICommunicationPattern (const ICommunicationPattern &)=delete | |
ICommunicationPattern & | operator= (const ICommunicationPattern &)=delete |
ICommunicationPattern ()=delete | |
Protected Member Functions inherited from Smart::IShutdownObserver | |
void | attach_self_to (ShutdownSubject *subject) |
call this method from within the constructor of derived classes More... | |
void | detach_self_from (ShutdownSubject *subject) |
this method is called within the destructor More... | |
Protected Attributes | |
std::string | serviceName |
the current serviceName (can be used in derived classes) More... | |
Protected Attributes inherited from Smart::ICommunicationPattern | |
IComponent * | icomponent |
the internal pointer to the component (can be accessed in derived classes) More... | |
This is the base class for all server-patterns.
The main two functionalities that are shared among all server-patterns are:
A server-pattern is supposed to fully initialize its internal server-side infrastructure within its constructor such that after the constructor the server is ready to deliver its service.
The individual serverInitiatedDisconnect() is automatically triggered from within the on_shutdown() method and from within the destructor.
|
inline |
Constructor.
Default constructor for a ServerPattern. Derived classes should entirely initialize all internal server resources such that after the constructor the server becomes ready to deliver its service.
component | management class of the component |
serviceName | name of the service |
|
inlinevirtual |
Destructor.
Properly disconnects all service requestors in case of destruction.
|
inlineprotected |
|
inlineprotectedvirtual |
implements individual shutdown strategy.
The default behavior for each server during component shutdown is to call serverInitiatedDisconnect() which automatically disconnects all currently connected clients.
Implements Smart::IShutdownObserver.
|
protectedpure virtual |
implements server-initiated-disconnect (SID)
The server-initiated-disconnect is specific to a certain server implementation. Each server should be able triggering disconnecting all currently connected clients in case e.g. the component of that server is about to shutdown. Disconnecting clients before that ensures that the clients remain in a defined state (namely disconnected) after the server is gone.
|
protected |
the current serviceName (can be used in derived classes)