SmartSoft Component-Developer API
Public Types | Public Member Functions | Protected Member Functions | List of all members
Smart::IEventServerPattern< ActivationType, EventType, UpdateType > Class Template Referenceabstract

#include <smartIEventServerPattern_T.h>

Inheritance diagram for Smart::IEventServerPattern< ActivationType, EventType, UpdateType >:
Smart::IServerPattern Smart::ICommunicationPattern Smart::IShutdownObserver

Public Types

using IEventTestHandlerPtr = std::shared_ptr< IEventTestHandler< ActivationType, EventType, UpdateType > >
 

Public Member Functions

 IEventServerPattern (IComponent *component, const std::string &service, IEventTestHandlerPtr testHandler)
 Default constructor. More...
 
virtual ~IEventServerPattern ()=default
 Destructor. More...
 
virtual StatusCode put (const UpdateType &state)=0
 Initiate testing the event conditions for the activations. 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...
 

Protected Member Functions

void onActivation (const ActivationType &p)
 
bool testEvent (ActivationType &p, EventType &e, const UpdateType &s)
 
- 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...
 

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

Member Typedef Documentation

◆ IEventTestHandlerPtr

template<class ActivationType , class EventType , class UpdateType = EventType>
using Smart::IEventServerPattern< ActivationType, EventType, UpdateType >::IEventTestHandlerPtr = std::shared_ptr<IEventTestHandler<ActivationType,EventType,UpdateType> >

Constructor & Destructor Documentation

◆ IEventServerPattern()

template<class ActivationType , class EventType , class UpdateType = EventType>
Smart::IEventServerPattern< ActivationType, EventType, UpdateType >::IEventServerPattern ( IComponent component,
const std::string &  service,
IEventTestHandlerPtr  testHandler 
)
inline

Default constructor.

Note that a handler has to be supplied. Without a handler, the QueryServer could not accept a query.

Parameters
componentmanagement class of the component
servicename of the service
testHandleris a shared-pointer to an EventTestHandler

◆ ~IEventServerPattern()

template<class ActivationType , class EventType , class UpdateType = EventType>
virtual Smart::IEventServerPattern< ActivationType, EventType, UpdateType >::~IEventServerPattern ( )
virtualdefault

Destructor.

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

Member Function Documentation

◆ onActivation()

template<class ActivationType , class EventType , class UpdateType = EventType>
void Smart::IEventServerPattern< ActivationType, EventType, UpdateType >::onActivation ( const ActivationType &  p)
inlineprotected

◆ put()

template<class ActivationType , class EventType , class UpdateType = EventType>
virtual StatusCode Smart::IEventServerPattern< ActivationType, EventType, UpdateType >::put ( const UpdateType &  state)
pure virtual

Initiate testing the event conditions for the activations.

Parameters
statecontains the current information checked in testEvent() against the individual activation parameters.
Returns
status code
  • SMART_OK : everything is ok
  • SMART_ERROR_COMMUNICATION : communication problems
  • SMART_ERROR : something went wrong

◆ testEvent()

template<class ActivationType , class EventType , class UpdateType = EventType>
bool Smart::IEventServerPattern< ActivationType, EventType, UpdateType >::testEvent ( ActivationType &  p,
EventType &  e,
const UpdateType &  s 
)
inlineprotected

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