Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataChunk.h
devin doucette 35393bbb2b DDC: Split FPayload into separate FValue and FValueId types
A payload was conceptually a value with an ID. That has been formalized by removing the ID from the payload and having separate FValue and FValueId types. This separation cleans up the API in a few areas, and provides a more natural path to providing a basic key/value API.

#rb Zousar.Shaker
#rnx
#preflight 61d704c04c252480ca284d61

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18531844 in //UE5/Release-5.0/... via CL 18531856
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18531864 by devin doucette in ue5-release-engine-test branch]
2022-01-06 11:05:57 -05:00

46 lines
885 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
namespace UE::DerivedData
{
/** Binary predicate that compares chunks by key, then value ID, then raw offset. */
struct TChunkEqual
{
template <typename ChunkTypeA, typename ChunkTypeB>
inline bool operator()(ChunkTypeA&& A, ChunkTypeB&& B) const
{
return A.Key == B.Key && A.Id == B.Id && A.RawOffset == B.RawOffset;
}
};
/** Binary predicate that compares chunks by key, then value ID, then raw offset. */
struct TChunkLess
{
template <typename ChunkTypeA, typename ChunkTypeB>
inline bool operator()(ChunkTypeA&& A, ChunkTypeB&& B) const
{
if (A.Key < B.Key)
{
return true;
}
if (B.Key < A.Key)
{
return false;
}
if (A.Id < B.Id)
{
return true;
}
if (B.Id < A.Id)
{
return false;
}
return A.RawOffset < B.RawOffset;
}
};
} // UE::DerivedData