SmartSoft Component-Developer API
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Smart::IServerPattern Class Referenceabstract

This is the base class for all server-patterns. More...

#include <smartIServerPattern.h>

Inheritance diagram for Smart::IServerPattern:
Smart::ICommunicationPattern Smart::IShutdownObserver Smart::IEventServerPattern< ActivationType, EventType, UpdateType > Smart::IPushServerPattern< DataType > Smart::IQueryServerPattern< RequestType, AnswerType > Smart::ISendServerPattern< DataType >

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
 
ICommunicationPatternoperator= (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
IComponenticomponent
 the internal pointer to the component (can be accessed in derived classes) More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ IServerPattern()

Smart::IServerPattern::IServerPattern ( IComponent component,
const std::string &  serviceName 
)
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.

Parameters
componentmanagement class of the component
serviceNamename of the service

◆ ~IServerPattern()

virtual Smart::IServerPattern::~IServerPattern ( )
inlinevirtual

Destructor.

Properly disconnects all service requestors in case of destruction.

Member Function Documentation

◆ is_shutting_down()

bool Smart::IServerPattern::is_shutting_down ( ) const
inlineprotected

◆ on_shutdown()

virtual void Smart::IServerPattern::on_shutdown ( )
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.

◆ serverInitiatedDisconnect()

virtual void Smart::IServerPattern::serverInitiatedDisconnect ( )
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.

Member Data Documentation

◆ serviceName

std::string Smart::IServerPattern::serviceName
protected

the current serviceName (can be used in derived classes)


The documentation for this class was generated from the following file: