Files
UnrealEngineUWP/Engine/Source/Editor/DerivedDataEditor/Private/DerivedDataCacheNotifications.cpp
Marc Audy 0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00

61 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "DerivedDataCacheNotifications.h"
#include "Misc/EngineBuildSettings.h"
#include "Logging/LogMacros.h"
#include "Misc/CoreMisc.h"
#include "Misc/App.h"
#include "Internationalization/Internationalization.h"
#include "Widgets/Notifications/SNotificationList.h"
#include "Widgets/Input/SHyperlink.h"
#include "Framework/Notifications/NotificationManager.h"
#include "DerivedDataCacheInterface.h"
#include "Editor/EditorPerformanceSettings.h"
#define LOCTEXT_NAMESPACE "DerivedDataCacheNotifications"
DEFINE_LOG_CATEGORY_STATIC(DerivedDataCacheNotifications, Log, All);
FDerivedDataCacheNotifications::FDerivedDataCacheNotifications() :
bSubscribed(false)
{
Subscribe(true);
}
FDerivedDataCacheNotifications::~FDerivedDataCacheNotifications()
{
Subscribe(false);
}
void FDerivedDataCacheNotifications::OnDDCNotificationEvent(FDerivedDataCacheInterface::EDDCNotification DDCNotification)
{
if (IsEngineExitRequested())
{
return;
}
// TODO : Handle any notificaiton evens here
}
void FDerivedDataCacheNotifications::Subscribe(bool bSubscribe)
{
if (bSubscribe != bSubscribed)
{
FDerivedDataCacheInterface::FOnDDCNotification& DDCNotificationEvent = GetDerivedDataCacheRef().GetDDCNotificationEvent();
if (bSubscribe)
{
DDCNotificationEvent.AddRaw(this, &FDerivedDataCacheNotifications::OnDDCNotificationEvent);
}
else
{
DDCNotificationEvent.RemoveAll(this);
}
bSubscribed = bSubscribe;
}
}
#undef LOCTEXT_NAMESPACE