2021-01-21 01:57:01 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreTypes.h"
|
2021-10-07 09:11:32 -04:00
|
|
|
#include "Containers/StringFwd.h"
|
2021-01-21 01:57:01 -04:00
|
|
|
#include "DerivedDataCacheKey.h"
|
2022-01-28 20:34:31 -05:00
|
|
|
#include "DerivedDataCachePolicy.h"
|
2021-12-13 13:32:28 -05:00
|
|
|
#include "DerivedDataCacheRecord.h"
|
2021-08-06 15:50:00 -04:00
|
|
|
#include "DerivedDataRequestTypes.h"
|
2022-01-04 13:25:54 -05:00
|
|
|
#include "DerivedDataSharedString.h"
|
2022-01-10 12:13:18 -05:00
|
|
|
#include "DerivedDataValue.h"
|
2022-01-06 11:05:57 -05:00
|
|
|
#include "DerivedDataValueId.h"
|
2021-10-07 09:11:32 -04:00
|
|
|
#include "Math/NumericLimits.h"
|
2022-01-10 12:13:18 -05:00
|
|
|
#include "Memory/SharedBuffer.h"
|
2021-05-12 17:57:54 -04:00
|
|
|
#include "Templates/Function.h"
|
2021-01-21 01:57:01 -04:00
|
|
|
|
2021-08-05 13:12:08 -04:00
|
|
|
#define UE_API DERIVEDDATACACHE_API
|
|
|
|
|
|
2021-11-10 13:08:00 -05:00
|
|
|
namespace UE::DerivedData { class ICacheStoreMaintainer; }
|
2021-08-06 15:50:00 -04:00
|
|
|
namespace UE::DerivedData { class IRequestOwner; }
|
2022-01-18 04:47:59 -05:00
|
|
|
namespace UE::DerivedData { struct FCacheGetChunkRequest; }
|
|
|
|
|
namespace UE::DerivedData { struct FCacheGetChunkResponse; }
|
2021-12-13 13:32:28 -05:00
|
|
|
namespace UE::DerivedData { struct FCacheGetRequest; }
|
2022-01-11 17:09:20 -05:00
|
|
|
namespace UE::DerivedData { struct FCacheGetResponse; }
|
2022-01-10 12:13:18 -05:00
|
|
|
namespace UE::DerivedData { struct FCacheGetValueRequest; }
|
2022-01-11 17:09:20 -05:00
|
|
|
namespace UE::DerivedData { struct FCacheGetValueResponse; }
|
2021-12-13 13:32:28 -05:00
|
|
|
namespace UE::DerivedData { struct FCachePutRequest; }
|
2022-01-11 17:09:20 -05:00
|
|
|
namespace UE::DerivedData { struct FCachePutResponse; }
|
2022-01-10 12:13:18 -05:00
|
|
|
namespace UE::DerivedData { struct FCachePutValueRequest; }
|
2022-01-11 17:09:20 -05:00
|
|
|
namespace UE::DerivedData { struct FCachePutValueResponse; }
|
2021-08-06 15:50:00 -04:00
|
|
|
|
2021-04-28 12:55:00 -04:00
|
|
|
namespace UE::DerivedData
|
2021-01-21 01:57:01 -04:00
|
|
|
{
|
|
|
|
|
|
2022-01-11 17:09:20 -05:00
|
|
|
using FOnCachePutComplete = TUniqueFunction<void (FCachePutResponse&& Response)>;
|
|
|
|
|
using FOnCacheGetComplete = TUniqueFunction<void (FCacheGetResponse&& Response)>;
|
|
|
|
|
using FOnCachePutValueComplete = TUniqueFunction<void (FCachePutValueResponse&& Response)>;
|
|
|
|
|
using FOnCacheGetValueComplete = TUniqueFunction<void (FCacheGetValueResponse&& Response)>;
|
2022-01-18 04:47:59 -05:00
|
|
|
using FOnCacheGetChunkComplete = TUniqueFunction<void (FCacheGetChunkResponse&& Response)>;
|
|
|
|
|
|
2021-01-21 01:57:01 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2021-10-07 09:11:32 -04:00
|
|
|
|
2021-04-28 12:55:00 -04:00
|
|
|
/**
|
2022-01-27 15:43:52 -05:00
|
|
|
* Interface to the cache.
|
2021-04-28 12:55:00 -04:00
|
|
|
*
|
2022-01-27 15:43:52 -05:00
|
|
|
* Functions on this interface may be called from any thread.
|
|
|
|
|
*
|
|
|
|
|
* Requests may complete out of order relative to the order that they were requested.
|
|
|
|
|
*
|
|
|
|
|
* Callbacks may be called from any thread, including the calling thread, may be called from more
|
|
|
|
|
* than one thread concurrently, and may be called before returning from the request function.
|
2021-04-28 12:55:00 -04:00
|
|
|
*/
|
2022-01-27 15:43:52 -05:00
|
|
|
class ICache
|
2021-04-28 12:55:00 -04:00
|
|
|
{
|
|
|
|
|
public:
|
2022-01-27 15:43:52 -05:00
|
|
|
virtual ~ICache() = default;
|
2021-03-10 12:23:29 -04:00
|
|
|
|
2021-02-19 11:26:34 -04:00
|
|
|
/**
|
2022-01-27 15:43:52 -05:00
|
|
|
* Asynchronous request to put records in the cache.
|
2021-02-19 11:26:34 -04:00
|
|
|
*
|
2022-01-27 15:43:52 -05:00
|
|
|
* @see FCachePutRequest
|
2021-05-12 09:28:05 -04:00
|
|
|
*
|
2021-12-13 13:32:28 -05:00
|
|
|
* @param Requests Requests with the cache records to store. Records must have a key.
|
2022-01-27 15:43:52 -05:00
|
|
|
* @param Owner The owner to execute the request within. See IRequestOwner.
|
|
|
|
|
* @param OnComplete A callback invoked for every request as it completes or is canceled.
|
2021-02-19 11:26:34 -04:00
|
|
|
*/
|
2021-08-04 18:08:50 -04:00
|
|
|
virtual void Put(
|
2021-12-13 13:32:28 -05:00
|
|
|
TConstArrayView<FCachePutRequest> Requests,
|
2021-08-04 18:08:50 -04:00
|
|
|
IRequestOwner& Owner,
|
2022-01-27 15:43:52 -05:00
|
|
|
FOnCachePutComplete&& OnComplete = {}) = 0;
|
2021-02-19 11:26:34 -04:00
|
|
|
|
2021-01-21 01:57:01 -04:00
|
|
|
/**
|
2022-01-27 15:43:52 -05:00
|
|
|
* Asynchronous request to get records from the cache.
|
2021-01-21 01:57:01 -04:00
|
|
|
*
|
2022-01-27 15:43:52 -05:00
|
|
|
* @see FCacheGetRequest
|
2021-01-21 01:57:01 -04:00
|
|
|
*
|
2022-01-27 15:43:52 -05:00
|
|
|
* @param Requests Requests with the keys of the cache records to fetch.
|
|
|
|
|
* @param Owner The owner to execute the request within. See IRequestOwner.
|
|
|
|
|
* @param OnComplete A callback invoked for every request as it completes or is canceled.
|
2021-01-21 01:57:01 -04:00
|
|
|
*/
|
2021-08-04 18:08:50 -04:00
|
|
|
virtual void Get(
|
2021-12-13 13:32:28 -05:00
|
|
|
TConstArrayView<FCacheGetRequest> Requests,
|
2021-08-04 18:08:50 -04:00
|
|
|
IRequestOwner& Owner,
|
2021-04-28 12:55:00 -04:00
|
|
|
FOnCacheGetComplete&& OnComplete) = 0;
|
2021-01-21 01:57:01 -04:00
|
|
|
|
2022-01-27 15:43:52 -05:00
|
|
|
/**
|
|
|
|
|
* Asynchronous request to put values in the cache.
|
|
|
|
|
*
|
|
|
|
|
* @see FCachePutValueRequest
|
|
|
|
|
*
|
|
|
|
|
* @param Requests Requests with the cache values to store. Requests must have a key.
|
|
|
|
|
* @param Owner The owner to execute the request within. See IRequestOwner.
|
|
|
|
|
* @param OnComplete A callback invoked for every request as it completes or is canceled.
|
|
|
|
|
*/
|
|
|
|
|
virtual void PutValue(
|
2022-01-10 12:13:18 -05:00
|
|
|
TConstArrayView<FCachePutValueRequest> Requests,
|
|
|
|
|
IRequestOwner& Owner,
|
2022-01-27 15:43:52 -05:00
|
|
|
FOnCachePutValueComplete&& OnComplete = {}) = 0;
|
2022-01-10 12:13:18 -05:00
|
|
|
|
2022-01-27 15:43:52 -05:00
|
|
|
/**
|
|
|
|
|
* Asynchronous request to get values from the cache.
|
|
|
|
|
*
|
|
|
|
|
* @see FCacheGetValueRequest
|
|
|
|
|
*
|
|
|
|
|
* @param Requests Requests with the keys of the cache values to fetch.
|
|
|
|
|
* @param Owner The owner to execute the request within. See IRequestOwner.
|
|
|
|
|
* @param OnComplete A callback invoked for every request as it completes or is canceled.
|
|
|
|
|
*/
|
|
|
|
|
virtual void GetValue(
|
2022-01-10 12:13:18 -05:00
|
|
|
TConstArrayView<FCacheGetValueRequest> Requests,
|
|
|
|
|
IRequestOwner& Owner,
|
2022-01-27 15:43:52 -05:00
|
|
|
FOnCacheGetValueComplete&& OnComplete) = 0;
|
2022-01-10 12:13:18 -05:00
|
|
|
|
2021-01-21 01:57:01 -04:00
|
|
|
/**
|
2022-01-06 11:05:57 -05:00
|
|
|
* Asynchronous request to get chunks, which are subsets of values, from records or values.
|
2021-01-21 01:57:01 -04:00
|
|
|
*
|
2022-01-27 15:43:52 -05:00
|
|
|
* @see FCacheGetChunkRequest
|
2021-01-21 01:57:01 -04:00
|
|
|
*
|
2022-01-27 15:43:52 -05:00
|
|
|
* @param Requests Requests with the key, ID, offset, and size of each chunk to fetch.
|
|
|
|
|
* @param Owner The owner to execute the request within. See IRequestOwner.
|
|
|
|
|
* @param OnComplete A callback invoked for every request as it completes or is canceled.
|
2021-01-21 01:57:01 -04:00
|
|
|
*/
|
2021-10-07 09:11:32 -04:00
|
|
|
virtual void GetChunks(
|
2022-01-18 04:47:59 -05:00
|
|
|
TConstArrayView<FCacheGetChunkRequest> Requests,
|
2021-08-04 18:08:50 -04:00
|
|
|
IRequestOwner& Owner,
|
2022-01-18 04:47:59 -05:00
|
|
|
FOnCacheGetChunkComplete&& OnComplete) = 0;
|
2021-11-10 13:08:00 -05:00
|
|
|
|
|
|
|
|
/** Returns the interface to the background cache store maintenance. */
|
|
|
|
|
virtual ICacheStoreMaintainer& GetMaintainer() = 0;
|
2021-04-28 12:55:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2021-12-13 13:32:28 -05:00
|
|
|
/** Parameters to request to put a cache record. */
|
|
|
|
|
struct FCachePutRequest
|
|
|
|
|
{
|
2022-01-04 09:26:33 -05:00
|
|
|
/** A name to identify this request for logging and profiling. An object path is typically sufficient. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-04 09:26:33 -05:00
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A record to store. */
|
2021-12-13 13:32:28 -05:00
|
|
|
FCacheRecord Record;
|
|
|
|
|
|
|
|
|
|
/** Flags to control the behavior of the request. See FCacheRecordPolicy. */
|
|
|
|
|
FCacheRecordPolicy Policy;
|
|
|
|
|
|
|
|
|
|
/** A value that will be returned in the completion callback. */
|
|
|
|
|
uint64 UserData = 0;
|
2022-01-26 17:07:56 -05:00
|
|
|
|
|
|
|
|
/** Make a default response for this request, with the provided status. */
|
|
|
|
|
UE_API FCachePutResponse MakeResponse(EStatus Status) const;
|
2021-12-13 13:32:28 -05:00
|
|
|
};
|
|
|
|
|
|
2021-03-03 11:55:38 -04:00
|
|
|
/** Parameters for the completion callback for cache put requests. */
|
2022-01-11 17:09:20 -05:00
|
|
|
struct FCachePutResponse
|
2021-03-03 11:55:38 -04:00
|
|
|
{
|
2022-01-04 09:26:33 -05:00
|
|
|
/** A copy of the name from the request. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-04 09:26:33 -05:00
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A copy of the key from the request. */
|
2021-03-03 11:55:38 -04:00
|
|
|
FCacheKey Key;
|
|
|
|
|
|
2021-12-13 13:32:28 -05:00
|
|
|
/** A copy of the value from the request. */
|
|
|
|
|
uint64 UserData = 0;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** The status of the request. */
|
2021-03-03 11:55:38 -04:00
|
|
|
EStatus Status = EStatus::Error;
|
|
|
|
|
};
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** Parameters to request to get a cache record. */
|
2021-12-13 13:32:28 -05:00
|
|
|
struct FCacheGetRequest
|
|
|
|
|
{
|
2022-01-04 09:26:33 -05:00
|
|
|
/** A name to identify this request for logging and profiling. An object path is typically sufficient. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-04 09:26:33 -05:00
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A key identifying the record to fetch. */
|
2021-12-13 13:32:28 -05:00
|
|
|
FCacheKey Key;
|
|
|
|
|
|
|
|
|
|
/** Flags to control the behavior of the request. See FCacheRecordPolicy. */
|
|
|
|
|
FCacheRecordPolicy Policy;
|
|
|
|
|
|
|
|
|
|
/** A value that will be returned in the completion callback. */
|
|
|
|
|
uint64 UserData = 0;
|
2022-01-26 17:07:56 -05:00
|
|
|
|
|
|
|
|
/** Make a default response for this request, with the provided status. */
|
|
|
|
|
UE_API FCacheGetResponse MakeResponse(EStatus Status) const;
|
2021-12-13 13:32:28 -05:00
|
|
|
};
|
|
|
|
|
|
2021-03-03 11:55:38 -04:00
|
|
|
/** Parameters for the completion callback for cache get requests. */
|
2022-01-11 17:09:20 -05:00
|
|
|
struct FCacheGetResponse
|
2021-03-03 11:55:38 -04:00
|
|
|
{
|
2022-01-04 09:26:33 -05:00
|
|
|
/** A copy of the name from the request. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-04 09:26:33 -05:00
|
|
|
|
2021-03-03 11:55:38 -04:00
|
|
|
/**
|
2022-01-10 12:13:18 -05:00
|
|
|
* Record for the request that completed or was canceled.
|
2021-03-03 11:55:38 -04:00
|
|
|
*
|
2021-05-03 12:05:18 -04:00
|
|
|
* The key is always populated. The remainder of the record is populated when Status is Ok.
|
2021-03-03 11:55:38 -04:00
|
|
|
*
|
2022-01-07 23:22:29 -05:00
|
|
|
* The metadata or the data for values may be skipped based on cache policy flags. Values for
|
|
|
|
|
* which data has been skipped will have a hash and size but null data.
|
2021-03-03 11:55:38 -04:00
|
|
|
*/
|
2022-01-10 12:13:18 -05:00
|
|
|
FCacheRecord Record;
|
2021-03-03 11:55:38 -04:00
|
|
|
|
2021-12-13 13:32:28 -05:00
|
|
|
/** A copy of the value from the request. */
|
|
|
|
|
uint64 UserData = 0;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** The status of the request. */
|
2021-03-03 11:55:38 -04:00
|
|
|
EStatus Status = EStatus::Error;
|
|
|
|
|
};
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** Parameters to request to put a cache value. */
|
|
|
|
|
struct FCachePutValueRequest
|
|
|
|
|
{
|
|
|
|
|
/** A name to identify this request for logging and profiling. An object path is typically sufficient. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-10 12:13:18 -05:00
|
|
|
|
|
|
|
|
/** A key that will uniquely identify the value in the cache. */
|
|
|
|
|
FCacheKey Key;
|
|
|
|
|
|
|
|
|
|
/** A value to store. */
|
|
|
|
|
FValue Value;
|
|
|
|
|
|
|
|
|
|
/** Flags to control the behavior of the request. See ECachePolicy. */
|
|
|
|
|
ECachePolicy Policy = ECachePolicy::Default;
|
|
|
|
|
|
|
|
|
|
/** A value that will be returned in the completion callback. */
|
|
|
|
|
uint64 UserData = 0;
|
2022-01-26 17:07:56 -05:00
|
|
|
|
|
|
|
|
/** Make a default response for this request, with the provided status. */
|
|
|
|
|
UE_API FCachePutValueResponse MakeResponse(EStatus Status) const;
|
2022-01-10 12:13:18 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Parameters for the completion callback for cache value put requests. */
|
2022-01-11 17:09:20 -05:00
|
|
|
struct FCachePutValueResponse
|
2022-01-10 12:13:18 -05:00
|
|
|
{
|
|
|
|
|
/** A copy of the name from the request. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-10 12:13:18 -05:00
|
|
|
|
|
|
|
|
/** A copy of the key from the request. */
|
|
|
|
|
FCacheKey Key;
|
|
|
|
|
|
|
|
|
|
/** A copy of the value from the request. */
|
|
|
|
|
uint64 UserData = 0;
|
|
|
|
|
|
|
|
|
|
/** The status of the request. */
|
|
|
|
|
EStatus Status = EStatus::Error;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Parameters to request to get a cache value. */
|
|
|
|
|
struct FCacheGetValueRequest
|
|
|
|
|
{
|
|
|
|
|
/** A name to identify this request for logging and profiling. An object path is typically sufficient. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-10 12:13:18 -05:00
|
|
|
|
|
|
|
|
/** A key identifying the value to fetch. */
|
|
|
|
|
FCacheKey Key;
|
|
|
|
|
|
|
|
|
|
/** Flags to control the behavior of the request. See ECachePolicy. */
|
|
|
|
|
ECachePolicy Policy = ECachePolicy::Default;
|
|
|
|
|
|
|
|
|
|
/** A value that will be returned in the completion callback. */
|
|
|
|
|
uint64 UserData = 0;
|
2022-01-26 17:07:56 -05:00
|
|
|
|
|
|
|
|
/** Make a default response for this request, with the provided status. */
|
|
|
|
|
UE_API FCacheGetValueResponse MakeResponse(EStatus Status) const;
|
2022-01-10 12:13:18 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Parameters for the completion callback for cache value get requests. */
|
2022-01-11 17:09:20 -05:00
|
|
|
struct FCacheGetValueResponse
|
2022-01-10 12:13:18 -05:00
|
|
|
{
|
|
|
|
|
/** A copy of the name from the request. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-10 12:13:18 -05:00
|
|
|
|
|
|
|
|
/** A copy of the key from the request. */
|
|
|
|
|
FCacheKey Key;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Value for the request that completed or was canceled.
|
|
|
|
|
*
|
|
|
|
|
* The data may be skipped based on cache policy flags. A value for which data has been skipped
|
|
|
|
|
* will have a hash and size but null data.
|
|
|
|
|
*/
|
|
|
|
|
FValue Value;
|
|
|
|
|
|
|
|
|
|
/** A copy of the value from the request. */
|
|
|
|
|
uint64 UserData = 0;
|
|
|
|
|
|
|
|
|
|
/** The status of the request. */
|
|
|
|
|
EStatus Status = EStatus::Error;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** Parameters to request a chunk, which is a subset of a value, from a cache record or cache value. */
|
2022-01-18 04:47:59 -05:00
|
|
|
struct FCacheGetChunkRequest
|
2021-03-03 11:55:38 -04:00
|
|
|
{
|
2022-01-04 09:26:33 -05:00
|
|
|
/** A name to identify this request for logging and profiling. An object path is typically sufficient. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-04 09:26:33 -05:00
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A key identifying the record or value to fetch the chunk from. */
|
2021-03-03 11:55:38 -04:00
|
|
|
FCacheKey Key;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** An ID identifying the value to fetch, if fetching from a record, otherwise null. */
|
2022-01-06 11:05:57 -05:00
|
|
|
FValueId Id;
|
2021-10-07 09:11:32 -04:00
|
|
|
|
2022-01-06 11:05:57 -05:00
|
|
|
/** The offset into the raw bytes of the value at which to start fetching. */
|
2021-10-07 09:11:32 -04:00
|
|
|
uint64 RawOffset = 0;
|
|
|
|
|
|
2022-01-06 11:05:57 -05:00
|
|
|
/** The maximum number of raw bytes of the value to fetch, starting from the offset. */
|
2021-10-07 09:11:32 -04:00
|
|
|
uint64 RawSize = MAX_uint64;
|
|
|
|
|
|
2022-01-06 11:05:57 -05:00
|
|
|
/** The raw hash of the entire value to fetch, if available, otherwise zero. */
|
2021-12-13 13:32:28 -05:00
|
|
|
FIoHash RawHash;
|
|
|
|
|
|
2021-10-07 09:11:32 -04:00
|
|
|
/** Flags to control the behavior of the request. See ECachePolicy. */
|
|
|
|
|
ECachePolicy Policy = ECachePolicy::Default;
|
2021-12-13 13:32:28 -05:00
|
|
|
|
|
|
|
|
/** A value that will be returned in the completion callback. */
|
|
|
|
|
uint64 UserData = 0;
|
2021-10-07 09:11:32 -04:00
|
|
|
|
2022-01-26 17:07:56 -05:00
|
|
|
/** Make a default response for this request, with the provided status. */
|
|
|
|
|
UE_API FCacheGetChunkResponse MakeResponse(EStatus Status) const;
|
|
|
|
|
};
|
2022-01-18 04:47:59 -05:00
|
|
|
|
2021-10-07 09:11:32 -04:00
|
|
|
/** Parameters for the completion callback for cache chunk requests. */
|
2022-01-18 04:47:59 -05:00
|
|
|
struct FCacheGetChunkResponse
|
2021-10-07 09:11:32 -04:00
|
|
|
{
|
2022-01-04 09:26:33 -05:00
|
|
|
/** A copy of the name from the request. */
|
2022-01-11 17:09:20 -05:00
|
|
|
FSharedString Name;
|
2022-01-04 09:26:33 -05:00
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A copy of the key from the request. */
|
2021-10-07 09:11:32 -04:00
|
|
|
FCacheKey Key;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A copy of the ID from the request. */
|
2022-01-06 11:05:57 -05:00
|
|
|
FValueId Id;
|
2021-10-07 09:11:32 -04:00
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** A copy of the offset from the request. */
|
2021-10-07 09:11:32 -04:00
|
|
|
uint64 RawOffset = 0;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** The size, in bytes, of the subset of the value that was fetched, if any. */
|
2021-10-07 09:11:32 -04:00
|
|
|
uint64 RawSize = 0;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** The hash of the entire value, even if only a subset was fetched. */
|
2022-01-13 16:44:15 -05:00
|
|
|
FIoHash RawHash;
|
2021-10-07 09:11:32 -04:00
|
|
|
|
2022-01-06 11:05:57 -05:00
|
|
|
/** Data for the subset of the value that was fetched when Status is Ok, otherwise null. */
|
2022-01-10 12:13:18 -05:00
|
|
|
FSharedBuffer RawData;
|
2021-03-03 11:55:38 -04:00
|
|
|
|
2021-12-13 13:32:28 -05:00
|
|
|
/** A copy of the value from the request. */
|
|
|
|
|
uint64 UserData = 0;
|
|
|
|
|
|
2022-01-10 12:13:18 -05:00
|
|
|
/** The status of the request. */
|
2021-03-03 11:55:38 -04:00
|
|
|
EStatus Status = EStatus::Error;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2021-08-06 12:53:08 -04:00
|
|
|
/** Returns a reference to the cache. Asserts if not available. */
|
2021-08-05 13:12:08 -04:00
|
|
|
UE_API ICache& GetCache();
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2021-04-28 12:55:00 -04:00
|
|
|
} // UE::DerivedData
|
2021-08-05 13:12:08 -04:00
|
|
|
|
|
|
|
|
#undef UE_API
|