SmartSoft Component-Developer API
|
Condition Test Handler (decides at server whether event fires or not). More...
#include <smartIEventServerPattern_T.h>
Public Member Functions | |
virtual | ~IEventTestHandler ()=default |
virtual bool | testEvent (ActivationType &p, EventType &e, const UpdateType &s)=0 |
This is the test method which decides whether the event fires or not. More... | |
virtual void | onActivation (const ActivationType &p) |
This is a hook which is called whenever an event gets activated. More... | |
Condition Test Handler (decides at server whether event fires or not).
|
virtualdefault |
|
inlinevirtual |
This is a hook which is called whenever an event gets activated.
Each time a client activates an event, this hook is called with the corresponding parameter. The overloading of this hook is optional. Blocking calls within this hook should be avoided.
p | event activation parameter set |
|
pure virtual |
This is the test method which decides whether the event fires or not.
As soon as the EventServer::put() is called, the pattern calls EventTestHandler::testEvent() to decide for each event activation parameter set individually whether this parameter set requires the event to fire.
The parameters p are provided by the client individually with every event activation, the current state s is provided via the EventServer::put() method when the server wants the event conditions to be checked.
The test method has to be provided by the user. In case the event fires, one can return data in the event answer object e.
Attention: this function will be called within the same context as the EventServer::put()-method. Therefore pay attention to blocking calls etc.
p | activation parameter set to be checked (Communication Object). Can be modified in the test event handler to store state information in the parameter object (for example needed to easily implement an event which only fires with state changes) |
e | event answer object (Communication Object) which returns data in case of firing to the client which is responsible for this event activation |
s | current information against which the testEvent() checks the parameters p |