AceSmartSoft API Documentation
Public Types | Public Member Functions | List of all members
SmartACE::QueryServerHandler< R, A > Class Template Referenceabstract

Handler Class for QueryServer for incoming requests. More...

#include <smartQueryServerHandler.hh>

Inheritance diagram for SmartACE::QueryServerHandler< R, A >:

Public Types

using IQueryServer = Smart::IQueryServerPattern< R, A >
 this Alias simplifies usage in the handleQuery method More...
 

Public Member Functions

virtual ~QueryServerHandler ()=default
 
virtual void handleQuery (IQueryServer &server, const Smart::QueryIdPtr &id, const R &request)=0
 Handler method for an incoming query request. More...
 

Detailed Description

template<class R, class A>
class SmartACE::QueryServerHandler< R, A >

Handler Class for QueryServer for incoming requests.

Used by the QueryServer to handle incoming queries. The user should provide the handleQuery() method by subclassing and register an instance of this handler class with the QueryServer.

Member Typedef Documentation

◆ IQueryServer

template<class R, class A>
using SmartACE::QueryServerHandler< R, A >::IQueryServer = Smart::IQueryServerPattern<R,A>

this Alias simplifies usage in the handleQuery method

See also
handleQuery

Constructor & Destructor Documentation

◆ ~QueryServerHandler()

template<class R, class A>
virtual SmartACE::QueryServerHandler< R, A >::~QueryServerHandler ( )
virtualdefault

Member Function Documentation

◆ handleQuery()

template<class R, class A>
virtual void SmartACE::QueryServerHandler< R, A >::handleQuery ( IQueryServer server,
const Smart::QueryIdPtr &  id,
const R &  request 
)
pure virtual

Handler method for an incoming query request.

This method is called by the communication pattern 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.

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.

Parameters
servera reference to the "parent" query-server that triggers this handler callback; can be used to provide the query-answer
idthe query-id can be used to provide the query answer
requestthe request itself
See also
IQueryServer

Implemented in SmartACE::StateSlaveHandler, and SmartACE::WiringHandler.


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