SmartSoft Component-Developer API
|
Handler Class for QueryServer for incoming requests. More...
#include <smartIQueryServerPattern_T.h>
Public Types | |
using | IQueryServer = IQueryServerPattern< RequestType, AnswerType > |
Public Member Functions | |
virtual | ~IQueryServerHandler ()=default |
Default destructor. More... | |
virtual void | handleQuery (IQueryServer &server, const QueryIdPtr &id, const RequestType &request)=0 |
Handler method for an incoming query request. More... | |
Handler Class for QueryServer for incoming requests.
Used by the QueryServer to handle incoming queries. The user should implement the handleQuery() method by subclassing and providing a pointer to an IQueryServerPattern to this handler.
using Smart::IQueryServerHandler< RequestType, AnswerType >::IQueryServer = IQueryServerPattern<RequestType,AnswerType> |
|
virtualdefault |
Default destructor.
|
pure virtual |
Handler method for an incoming query request.
This method is called by the query-server every time a new query request is received. It must be provided by the component developer to handle incoming requests. Since the method is executed by the communication thread, it must be very fast and non-blocking. Within this handler, use the provided server pointer to provide an answer like this: "server->answer(...)".
Usually the request and the id will be inserted into a queue and another working thread processes the request and provides the result. The ThreadedQueryHandler decorator provides such a processing pattern.
server | a reference to the related query server pattern for calling the answer(...) method from within the handler |
id | id of new query |
request | the request itself |