Class CallData
-
template<class ServiceType, typename RequestType, typename ResponseType>
class CallData -
A class that manages the state of a generic RPC call.
DoWork() can be used in child threads to automatically progress the state of the call.
- Template Parameters:
-
-
ServiceType – The type of the service that this CallData is associated with
-
RequestType – The type of the request message for the RPC, this is an incoming message to Unreal
-
ResponseType – The type of the response message for the RPC, this is an outgoing message from Unreal
-
Subclassed by ExchangeCallData< ServiceType, RequestType, ResponseType >
Public Functions
- inline CallData(ServiceType *Service, ServerCompletionQueue *CQueue, AsyncAPIHandler TargetRPC, bool bReusable = false, bool bAutoCreate = true)
-
Construct a new CallData object.
- Parameters:
-
-
Service – [in] The AsyncService that this CallData is associated with
-
CQueue – [in] The completion queue that this CallData will tracked with
-
TargetRPC – [in] The method that this CallData will be servicing
-
bReusable – [in] Whether this CallData should be reused after serving one RPC
-
bAutoCreate – [in] Whether this CallData should automatically create itself, or it should happen later via Create()
-
- inline void Create()
-
Create/setup the calldata instance.
This registers the calldata as the tag to return when the TargetRPC is called.
- inline void Submit()
-
Submit a response to the caller of the TargetRPC.
This will put us back on the queue once the response finished processing.
- inline void Reset()
-
Reset the RPC state object so it can be reused again by another RPC in the future.
- inline const RequestType &GetRequest()
-
Get the request associated with this RPC.
May be empty if the RPC is not ready
- Returns:
-
A reference to the RPC Request Message from the client
- inline ResponseType *GetMutableResponse()
-
Get a Response message that can be mutated in place.
- Returns:
-
A pointer to a response message owned by this object
- inline void SetResponse(ResponseType *NewResponse)
-
Set the response message.
Note
Caller must relinquish ownership of the response message
- Parameters:
-
NewResponse – [in] The new Response message to associate with this call.
- inline bool HasResponse()
-
Has the response message been set already.
- Returns:
-
true iff the response message has been set
Public Members
- int Id = 0
-
The unique ID of this CallData instance.
Used for debugging,