AceSmartSoft API Documentation
|
server query template. More...
#include <smartWiring.hh>
Public Types | |
using | IQueryServerBase = Smart::IQueryServerPattern< R, A > |
Public Member Functions | |
QueryServer (SmartComponent *component, const std::string &service, IQueryServerHandlerPtr query_handler=nullptr) | |
Constructor. More... | |
virtual | ~QueryServer () |
Destructor. More... | |
Smart::StatusCode | answer (const Smart::QueryIdPtr id, const A &answer) |
Provide answer to be sent back to the requestor. More... | |
server query template.
Server part of query pattern to perform two-way communication.
Template parameters
Demonstrated in first example and third example
using SmartACE::QueryServer< R, A >::IQueryServerBase = Smart::IQueryServerPattern<R,A> |
SmartACE::QueryServer< R, A >::QueryServer | ( | SmartComponent * | component, |
const std::string & | service, | ||
IQueryServerHandlerPtr | query_handler = nullptr |
||
) |
Constructor.
Note that a handler has to be supplied. Without a handler, the QueryServer could not accept a query.
(Currently exception not thrown)
component | management class of the component |
service | name of the service |
query_handler | an optional query_handler |
|
virtual |
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.
Smart::StatusCode SmartACE::QueryServer< R, A >::answer | ( | const Smart::QueryIdPtr | id, |
const A & | answer | ||
) |
Provide answer to be sent back to the requestor.
Member function is thread safe and thread reentrant.
id | identifies the request to which the answer belongs |
answer | is the reply itself. |