2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "ProfilerServicePrivatePCH.h"
|
|
|
|
|
#include "ModuleManager.h"
|
|
|
|
|
|
2014-09-21 20:35:48 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
/**
|
|
|
|
|
* Implements the ProfilerService module
|
|
|
|
|
*/
|
|
|
|
|
class FProfilerServiceModule
|
|
|
|
|
: public IProfilerServiceModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// Begin IModuleInterface interface
|
|
|
|
|
virtual void ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
if (ProfilerServiceManager.IsValid())
|
|
|
|
|
{
|
|
|
|
|
((FProfilerServiceManager*)ProfilerServiceManager.Get())->Shutdown();
|
|
|
|
|
}
|
|
|
|
|
ProfilerServiceManager.Reset();
|
|
|
|
|
}
|
|
|
|
|
// End IModuleInterface interface
|
|
|
|
|
|
|
|
|
|
// Begin IProfilerServiceModule interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual IProfilerServiceManagerPtr CreateProfilerServiceManager( ) override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
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);
|