Files
UnrealEngineUWP/Engine/Source/Runtime/PakFile/Private/FilePackageStore.h
carlmagnus nordin 51c9794dea PackageStore refactor
* Decouple container concept from IoDispatcher
* Decoiuple PackageStore implementation from AsyncLoading2
* Restore ucas unmount fix that got kist when merrging from UE4
* Fix packages being left in the PackageStiore even after unmounting contaiiners

#rnx
#rb pj.kack, per.larsson
#preflight 61520cc52afc2d0001146ce7

#ROBOMERGE-AUTHOR: carlmagnus.nordin
#ROBOMERGE-SOURCE: CL 17641845 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v874-17637634)

[CL 17642353 by carlmagnus nordin in ue5-release-engine-test branch]
2021-09-28 04:00:33 -04:00

52 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "IO/PackageId.h"
#include "IO/PackageStore.h"
struct FIoContainerHeader;
struct FFilePackageStoreEntry;
/*
* File/container based package store.
*/
class FFilePackageStore
: public FPackageStoreBase
{
public:
FFilePackageStore();
virtual ~FFilePackageStore() = default;
virtual void Initialize() override;
virtual void Lock() override;
virtual void Unlock() override;
virtual bool DoesPackageExist(FPackageId PackageId) override;
virtual FPackageStoreEntryHandle GetPackageEntryHandle(FPackageId PackageId, const FName& PackageName) override;
virtual FPackageStoreEntry GetPackageEntry(FPackageStoreEntryHandle Handle) override;
virtual bool GetPackageRedirectInfo(FPackageId PackageId, FName& OutSourcePackageName, FPackageId& OutRedirectedToPackageId) override;
void Mount(const FIoContainerHeader* ContainerHeader, uint32 Order);
void Unmount(const FIoContainerHeader* ContainerHeader);
private:
struct FMountedContainer
{
const FIoContainerHeader* ContainerHeader;
uint32 Order;
};
void Update();
FRWLock EntriesLock;
FCriticalSection UpdateLock;
TArray<FString> CurrentCultureNames;
TArray<FMountedContainer> MountedContainers;
TMap<FPackageId, const FFilePackageStoreEntry*> StoreEntriesMap;
TMap<FPackageId, TTuple<FName, FPackageId>> RedirectsPackageMap;
bool bNeedsUpdate = false;
static thread_local bool bIsLockedOnThread;
};