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

Handler class to process fired events asynchronously at the client. More...

#include <smartIEventClientPattern_T.h>

Inheritance diagram for Smart::IEventHandler< EventType >:
Smart::IInputHandler< EventInputType< EventType > >

Public Member Functions

 IEventHandler (InputSubject< EventInputType< EventType > > *subject)
 
virtual ~IEventHandler ()=default
 
virtual void handleEvent (const EventIdPtr &id, const EventType &event)=0
 Handler which is called by the event client pattern with every fired event. More...
 
- Public Member Functions inherited from Smart::IInputHandler< EventInputType< EventType > >
 IInputHandler (InputSubject< EventInputType< EventType > > *subject, const unsigned int &prescaleFactor=1)
 The default constructor. More...
 
virtual ~IInputHandler ()
 The default destructor. More...
 

Protected Member Functions

virtual void handle_input (const EventInputType< EventType > &input)
 implements IInputHandler More...
 
- Protected Member Functions inherited from Smart::IInputHandler< EventInputType< EventType > >
void attach_self (const unsigned int &prescale=1)
 calls subject->attach(this); More...
 
void detach_self ()
 calls subject->detach(this); More...
 

Additional Inherited Members

- Protected Attributes inherited from Smart::IInputHandler< EventInputType< EventType > >
InputSubject< EventInputType< EventType > > * subject
 this is the subject-pointer (can be used in derived classes) More...
 

Detailed Description

template<class EventType>
class Smart::IEventHandler< EventType >

Handler class to process fired events asynchronously at the client.

Register it with the constructor of the event client.

Template parameters:

Demonstrated in fifth example

Constructor & Destructor Documentation

◆ IEventHandler()

template<class EventType >
Smart::IEventHandler< EventType >::IEventHandler ( InputSubject< EventInputType< EventType > > *  subject)
inline

◆ ~IEventHandler()

template<class EventType >
virtual Smart::IEventHandler< EventType >::~IEventHandler ( )
virtualdefault

Member Function Documentation

◆ handle_input()

template<class EventType >
virtual void Smart::IEventHandler< EventType >::handle_input ( const EventInputType< EventType > &  input)
inlineprotectedvirtual

implements IInputHandler

This handler method delegates the call to the handleSend() method.

Parameters
inputthe input data-object

Implements Smart::IInputHandler< EventInputType< EventType > >.

◆ handleEvent()

template<class EventType >
virtual void Smart::IEventHandler< EventType >::handleEvent ( const EventIdPtr id,
const EventType &  event 
)
pure virtual

Handler which is called by the event client pattern with every fired event.

The handler method has to be provided by the user by subclassing.

Parameters
idcontains the activation id to be able to find out which activation caused the current event
eventis the event answer class (Communication Object) received due to the firing of the activation with identifier id.

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