SmartSoft Component-Developer API
Public Member Functions | List of all members
Smart::IPushServerPattern< DataType > Class Template Referenceabstract

Server part of the Push pattern to provide a push service. More...

#include <smartIPushServerPattern_T.h>

Inheritance diagram for Smart::IPushServerPattern< DataType >:
Smart::IServerPattern Smart::ICommunicationPattern Smart::IShutdownObserver

Public Member Functions

 IPushServerPattern (IComponent *component, const std::string &serviceName)
 Default Constructor. More...
 
virtual ~IPushServerPattern ()=default
 Destructor. More...
 
virtual StatusCode put (const DataType &d)=0
 Provide new data which is sent to all subscribed clients taking into account their individual prescale factors. 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...
 

Additional Inherited Members

- 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 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::IPushServerPattern< DataType >

Server part of the Push pattern to provide a push service.

New data is provided to the server by the put() method. It immediately distributes the new data to all at that point subscribed clients taking into account their individual prescale factors (see IPushClientPattern).

Template parameters

Constructor & Destructor Documentation

◆ IPushServerPattern()

template<class DataType >
Smart::IPushServerPattern< DataType >::IPushServerPattern ( IComponent component,
const std::string &  serviceName 
)
inline

Default Constructor.

The default constructor should initialize all internal server resources such that the put() method can be used.

Parameters
componentmanagement class of the component
serviceNamename of the service

◆ ~IPushServerPattern()

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

Destructor.

Properly disconnects all service requestors in case of destruction such that all connected and subscribed clients are unsubscribed and disconnected properly.

Member Function Documentation

◆ put()

template<class DataType >
virtual StatusCode Smart::IPushServerPattern< DataType >::put ( const DataType &  d)
pure virtual

Provide new data which is sent to all subscribed clients taking into account their individual prescale factors.

Prescale factors are always whole-numbered multiples of the server update intervals.

(Individual update interval counters are incremented each time this member function is called irrespectively of the elapsed time. One should use the time triggered handler to call the put() member function with the appropriate timing.)

Parameters
dcontains the newly acquired data to be sent as update.
Returns
status code
  • SMART_OK : everything is ok
  • SMART_ERROR_COMMUNICATION : communication problems caused by at least one client. The other clients are updated correctly.
  • SMART_ERROR : something went completely wrong with at least one client. Some clients might still been updated correctly.

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