Files
UnrealEngineUWP/Engine/Source/Runtime/RenderCore/Public/RenderDeferredCleanup.h
christopher waters 0270a5f287 Moving FDeferredCleanupInterface and accompanying types to RenderDeferredCleanup.h to remove global dependencies on RenderThread.h
#preflight 6393481ebb6fefa472ddeae0

[CL 23475364 by christopher waters in ue5-main branch]
2022-12-11 23:11:39 -05:00

39 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/Array.h"
/**
* The base class of objects that need to defer deletion until the render command queue has been flushed.
*/
class RENDERCORE_API FDeferredCleanupInterface
{
public:
virtual ~FDeferredCleanupInterface() {}
};
/**
* A set of cleanup objects which are pending deletion.
*/
class FPendingCleanupObjects
{
TArray<FDeferredCleanupInterface*> CleanupArray;
public:
inline bool IsEmpty() const { return CleanupArray.IsEmpty(); }
FPendingCleanupObjects();
RENDERCORE_API ~FPendingCleanupObjects();
};
/**
* Adds the specified deferred cleanup object to the current set of pending cleanup objects.
*/
extern RENDERCORE_API void BeginCleanup(FDeferredCleanupInterface* CleanupObject);
/**
* Transfers ownership of the current set of pending cleanup objects to the caller. A new set is created for subsequent BeginCleanup calls.
* @return A pointer to the set of pending cleanup objects. The called is responsible for deletion.
*/
extern RENDERCORE_API FPendingCleanupObjects* GetPendingCleanupObjects();