Files
UnrealEngineUWP/Engine/Source/Runtime/MessagingRpc/Public/IMessageRpcCall.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

90 lines
2.1 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "IMessageContext.h"
/**
* Interface for RPC calls.
*
* Every time an RPC call is made, a request message containing the call parameters is
* sent to the remote endpoint. While the remote endpoint is executing the call, it may
* send back progress updates in regular intervals. Once the call is complete, the remote
* endpoint sends a response message containing the result.
*/
class IMessageRpcCall
{
public:
/**
* Complete the request and set its result, if available.
*
* @param ResponseContext The context of the response message.
* @see TimeOut
*/
virtual void Complete(const TSharedRef<IMessageContext, ESPMode::ThreadSafe>& ResponseContext) = 0;
/**
* Get the call's unique identifier.
*
* @return Call identifier.
*/
virtual const FGuid& GetId() const = 0;
/**
* Get the request message template.
*
* @return Pointer to the request message template.
*/
virtual void* GetMessageTemplate() const = 0;
/**
* Constructs a new message based on the call message template. Ownership of the message belongs to the caller.
*
* @return Pointer to the request message.
*/
virtual void* ConstructMessage() const = 0;
/**
* Get the time at which the request was last updated by the server.
*
* @return Update time.
*/
virtual FDateTime GetLastUpdated() const = 0;
/**
* Get the type of the request message.
*
* @return Request message type.
*/
virtual UScriptStruct* GetMessageType() const = 0;
/**
* Gets the time at which the request was created.
*
* @return Creation time.
*/
virtual FDateTime GetTimeCreated() const = 0;
/**
* Time out the request.
*
* @see Complete
*/
virtual void TimeOut() = 0;
/**
* Update the current progress.
*
* @param InCompletion The new completion percentage.
* @param InStatusText The new status text.
*/
virtual void UpdateProgress(float InCompletion, const FText& InStatusText) = 0;
public:
/** Virtual destructor. */
virtual ~IMessageRpcCall() { }
};