Files
UnrealEngineUWP/Engine/Source/Developer/ProfilerService/Private/ProfilerServiceModule.cpp
Robert Manuszewski 2752c82adc Merging //UE4/Dev-Main @ 4664414 to Dev-Core (//UE4/Dev-Core)
#rb none

[CL 4675693 by Robert Manuszewski in Dev-Core branch]
2019-01-02 00:55:51 -05:00

54 lines
1.2 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "IProfilerServiceModule.h"
#include "ProfilerServiceManager.h"
/**
* Implements the ProfilerService module
*/
class FProfilerServiceModule
: public IProfilerServiceModule
{
public:
//~ IModuleInterface interface
virtual void ShutdownModule() override
{
if (ProfilerServiceManager.IsValid())
{
((FProfilerServiceManager*)ProfilerServiceManager.Get())->Shutdown();
}
ProfilerServiceManager.Reset();
}
public:
//~ IProfilerServiceModule interface
virtual TSharedPtr<IProfilerServiceManager> CreateProfilerServiceManager() override
{
if (!ProfilerServiceManager.IsValid())
{
ProfilerServiceManager = FProfilerServiceManager::CreateSharedServiceManager();
((FProfilerServiceManager*)ProfilerServiceManager.Get())->Init();
}
return ProfilerServiceManager;
}
private:
/** The profiler service singleton. */
static TSharedPtr<IProfilerServiceManager> ProfilerServiceManager;
};
TSharedPtr<IProfilerServiceManager> FProfilerServiceModule::ProfilerServiceManager = nullptr;
IMPLEMENT_MODULE(FProfilerServiceModule, ProfilerService);