Files
UnrealEngineUWP/Engine/Source/Developer/ProfilerService/Private/ProfilerServiceModule.cpp
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

52 lines
1.3 KiB
C++

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "ProfilerServicePrivatePCH.h"
#include "ModuleManager.h"
/**
* Implements the ProfilerService module
*/
class FProfilerServiceModule
: public IProfilerServiceModule
{
public:
// Begin IModuleInterface interface
virtual void ShutdownModule() override
{
if (ProfilerServiceManager.IsValid())
{
((FProfilerServiceManager*)ProfilerServiceManager.Get())->Shutdown();
}
ProfilerServiceManager.Reset();
}
// End IModuleInterface interface
// Begin IProfilerServiceModule interface
virtual IProfilerServiceManagerPtr CreateProfilerServiceManager( ) override
{
if (!ProfilerServiceManager.IsValid())
{
ProfilerServiceManager = FProfilerServiceManager::CreateSharedServiceManager();
((FProfilerServiceManager*)ProfilerServiceManager.Get())->Init();
}
return ProfilerServiceManager;
}
// End IProfilerServiceModule interface
private:
/**
* Holds the profiler service singleton
*/
static IProfilerServiceManagerPtr ProfilerServiceManager;
};
/* Static initialization
******************************************************************************/
IProfilerServiceManagerPtr FProfilerServiceModule::ProfilerServiceManager = NULL;
IMPLEMENT_MODULE(FProfilerServiceModule, ProfilerService);