AceSmartSoft API Documentation
Public Member Functions | List of all members
SmartACE::PushServer< DataType > Class Template Reference

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

#include <smartPush.hh>

Inheritance diagram for SmartACE::PushServer< DataType >:

Public Member Functions

 PushServer (SmartComponent *component, const std::string &svc, const SmartTimeValue &minCycleTime=SmartTimeValue::zero)
 Constructor. More...
 
virtual ~PushServer ()
 Destructor. More...
 
Smart::StatusCode put (const DataType &d)
 Provide new data which is sent to all subscribed clients taking into account their individual update cycles. More...
 

Detailed Description

template<class DataType>
class SmartACE::PushServer< DataType >

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

A user provided handler method is regularly triggered to initiate data acquisition. Newly acquired data is provided to the server by the put-method. It immediately distributes the new data to subscribed clients taking into account their individual update cycles.

Template parameters

Demonstrated in eigth example

Constructor & Destructor Documentation

◆ PushServer()

template<class DataType >
SmartACE::PushServer< DataType >::PushServer ( SmartComponent component,
const std::string &  svc,
const SmartTimeValue minCycleTime = SmartTimeValue::zero 
)

Constructor.

Parameters
componentmanagement class of the component
svcname of the service
minCycleTimecycle time of the service in [seconds]

(Currently exception not thrown)

◆ ~PushServer()

template<class DataType >
virtual SmartACE::PushServer< DataType >::~PushServer ( )
virtual

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 >
Smart::StatusCode SmartACE::PushServer< DataType >::put ( const DataType &  d)

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

Update cycles are always whole-numbered multiples of the server update cycle.

(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.)

PushHandler::handlePushRequest() directly or indirectly use this method to provide new data.

Parameters
dcontains the newly acquired data to be sent as update.
Returns
status code
  • SMART_OK : everything is ok
  • SMART_NOTACTIVATED : server is stopped and does therefore not distribute any data to clients. In that case update interval counters are not touched.
  • 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: