MIRA
|
PendingResponse template class. More...
#include <rpc/RPCClient.h>
Public Types | |
typedef Backend::ClientResponse | Response |
Public Member Functions | |
PendingResponse () | |
virtual void | handleResponse (void *responsePtr) |
Handles the response by calling getReturn() of the RPCResponse backend. More... | |
virtual void | handleServiceRemoved () |
Handles the service being removed before a response is received. More... | |
virtual int | getBackendTypeId () const |
Returns the (non portable) type id of the used backend. More... | |
Public Attributes | |
boost::promise< R > | promise |
The boost::promise object that is used for generating and setting the RPCFuture. More... | |
int | backendTypeId |
PendingResponse template class.
This class has to be a template, since we must handle different response types (e.g. Binary responses, JSON responses, etc) with different return value types (e.g. void, float, etc.). The return types depend on the rpc method that is called. Hence, for each rpc call an PendingResponse object with the matching types is created in the call() method below. This PendingResponse object is responsible for handling the response that is returned by the RPCServer after the call was invoked and processed. The PendingResponse object also holds the boost::promise object that is used to generate the RPCFuture and that is used to set the return value in the handleResponse method.
typedef Backend::ClientResponse Response |
|
inline |
|
inlinevirtual |
Handles the response by calling getReturn() of the RPCResponse backend.
The getReturn() method will set the value to the promise object (which communicates with the RPCFuture)
Implements RPCClient::PendingResponseBase.
|
inlinevirtual |
Handles the service being removed before a response is received.
Implements RPCClient::PendingResponseBase.
|
inlinevirtual |
Returns the (non portable) type id of the used backend.
It is used by RPCClient::handleResponse() for type checking where it is compared with the type of the actually received response.
Implements RPCClient::PendingResponseBase.
boost::promise<R> promise |
The boost::promise object that is used for generating and setting the RPCFuture.
int backendTypeId |