Files
UnrealEngineUWP/Engine/Source/Runtime/InstallBundleManager/Public/InstallBundleManagerModule.h
justin marcus e6c5fd6ae1 Fix my last CL
[at]Daniel.Lamb [at]Eric.Knapik



#ROBOMERGE-SOURCE: CL 13055695 via CL 13057825 via CL 13057859 via CL 13057890 via CL 13057938
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v686-13045012)

[CL 13058003 by justin marcus in Main branch]
2020-04-28 13:11:06 -04:00

68 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Modules/ModuleInterface.h"
#include "Modules/ModuleManager.h"
#include "Misc/ConfigCacheIni.h"
#include "InstallBundleManagerInterface.h"
/**
* Currently empty implementation for InstallBundleModule until things are moved in here.
*/
class FInstallBundleManagerModule : public IModuleInterface
{
public:
// IModuleInterface interface
virtual void StartupModule() override
{
}
virtual void ShutdownModule() override
{
}
};
/**
* Base Module Interface for InstallBundleManager implementation modules
*/
class IInstallBundleManagerModule : public IModuleInterface
{
public:
virtual void PreUnloadCallback() override
{
InstallBundleManager.Reset();
}
IInstallBundleManager* GetInstallBundleManager()
{
return InstallBundleManager.Get();
}
protected:
TUniquePtr<IInstallBundleManager> InstallBundleManager;
};
/**
* Module Interface for InstallBundleManager implementation modules
*/
template<class InstallBundleManagerModuleImpl>
class TInstallBundleManagerModule : public IInstallBundleManagerModule
{
public:
virtual void StartupModule() override
{
// Only instantiate the bundle manager if this is the version the game has been configured to use
FString ModuleName;
#if WITH_EDITOR
GConfig->GetString(TEXT("InstallBundleManager"), TEXT("EditorModuleName"), ModuleName, GEngineIni);
#else
GConfig->GetString(TEXT("InstallBundleManager"), TEXT("ModuleName"), ModuleName, GEngineIni);
#endif // WITH_EDITOR
if (FModuleManager::Get().GetModule(*ModuleName) == this)
{
InstallBundleManager = MakeUnique<InstallBundleManagerModuleImpl>();
}
}
};