SmartSoft Component-Developer API
Public Types | Public Member Functions | Protected Member Functions | List of all members
Smart::ISendServerPattern< DataType > Class Template Reference

Server part of the one-way, n->1 Send communication pattern. More...

#include <smartISendServerPattern_T.h>

Inheritance diagram for Smart::ISendServerPattern< DataType >:
Smart::IServerPattern Smart::InputSubject< DataType > Smart::ICommunicationPattern Smart::IShutdownObserver

Public Types

using ISendServerHandlerPtr = std::shared_ptr< Smart::ISendServerHandler< DataType > >
 

Public Member Functions

 ISendServerPattern (IComponent *component, const std::string &service, ISendServerHandlerPtr handler=nullptr)
 Default constructor. More...
 
virtual ~ISendServerPattern ()=default
 Destructor. More...
 
- Public Member Functions inherited from Smart::IServerPattern
 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...
 
- Public Member Functions inherited from Smart::InputSubject< DataType >
virtual ~InputSubject ()=default
 Default destructor. More...
 

Protected Member Functions

void handleSend (const DataType &data)
 please call this method in derived classes from within the middleware-specific data handler More...
 
- Protected Member Functions inherited from Smart::IServerPattern
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 Member Functions inherited from Smart::InputSubject< DataType >
virtual void attach (IInputHandler< DataType > *handler, const unsigned int &prescaleFactor=1)
 Attach an IInputHandler<InputType> instance. More...
 
virtual void detach (IInputHandler< DataType > *handler)
 Detach an IInputHandler<InputType> instance. More...
 
virtual bool notify_input (const DataType &input)
 Notifies all attached IInputHandler instances about incoming data. More...
 

Additional Inherited Members

- Protected Attributes inherited from Smart::IServerPattern
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

template<class DataType>
class Smart::ISendServerPattern< DataType >

Server part of the one-way, n->1 Send communication pattern.

Clients can send a specified DataType object to a server. The server propagates handling of the input object to a registered ISendServerHandler

If the send() method succeeds, this means that the sent object actually arrived at the server, but the server has the freedom to process this object later or throw it away altogether, depending on the implemented server semantics.

Template parameters

Template parameters:

Demonstrated in sixth example

Member Typedef Documentation

◆ ISendServerHandlerPtr

template<class DataType >
using Smart::ISendServerPattern< DataType >::ISendServerHandlerPtr = std::shared_ptr<Smart::ISendServerHandler<DataType> >

Constructor & Destructor Documentation

◆ ISendServerPattern()

template<class DataType >
Smart::ISendServerPattern< DataType >::ISendServerPattern ( IComponent component,
const std::string &  service,
ISendServerHandlerPtr  handler = nullptr 
)
inline

Default constructor.

Note that a handler has to be supplied. Without a handler, the SendServer could not accept a send command.

Parameters
componentmanagement class of the component
servicename of the service
handleris a pointer to the send-handler

◆ ~ISendServerPattern()

template<class DataType >
virtual Smart::ISendServerPattern< DataType >::~ISendServerPattern ( )
virtualdefault

Destructor.

Properly disconnects all service requestors in case of destruction such that all pending sends are handled correctly at client side even when the service provider disappears during pending sends.

Member Function Documentation

◆ handleSend()

template<class DataType >
void Smart::ISendServerPattern< DataType >::handleSend ( const DataType &  data)
inlineprotected

please call this method in derived classes from within the middleware-specific data handler


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