Files
UnrealEngineUWP/Engine/Source/Developer/Profiler/Private/ProfilerModule.cpp
Wes Hunt 31e2bb00ac Removed a bunch of stuff from Slate standard include, created SlateBasics.h
* Moved Slate.h into SlateBasics.h and began shifting less commonly used headers into SlateExtras.h.
* Slate.h now simply includes SlateBasics.h and SlateExtras.h.
* Slate.h includes a deprecated warning now to indicate that SlateBasics.h + specific includes should be used instead.
* Moved dozens of inlined functions using Slate widgets into .cpp files to avoid header dependencies.
* All code samples now include SlateBasics.h and SlateExtras.h so future shifts will not break most those projects, but not trigger the deprecation warning of including Slate.h.
#BUN

[CL 2329610 by Wes Hunt in Main branch]
2014-10-14 22:50:06 -04:00

61 lines
1.8 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ProfilerModule.cpp: Implements the FProfilerModule class.
=============================================================================*/
#include "ProfilerPrivatePCH.h"
#include "SDockTab.h"
/**
* Implements the FProfilerModule module.
*/
class FProfilerModule
: public IProfilerModule
{
public:
virtual TSharedRef<SWidget> CreateProfilerWindow( const ISessionManagerRef& InSessionManager, const TSharedRef<SDockTab>& ConstructUnderMajorTab ) override
{
ProfilerManager = FProfilerManager::Initialize( InSessionManager );
TSharedRef<SProfilerWindow> ProfilerWindow = SNew(SProfilerWindow);
FProfilerManager::Get()->AssignProfilerWindow( ProfilerWindow );
// Register OnTabClosed to handle profiler manager shutdown.
ConstructUnderMajorTab->SetOnTabClosed( SDockTab::FOnTabClosedCallback::CreateRaw(this, &FProfilerModule::Shutdown) );
return ProfilerWindow;
}
virtual void StartupModule() override
{}
virtual void ShutdownModule() override
{
if( FProfilerManager::Get().IsValid() )
{
FProfilerManager::Get()->Shutdown();
}
}
virtual bool SupportsDynamicReloading() override
{
return false;
}
virtual TWeakPtr<class IProfilerManager> GetProfilerManager() override
{
return ProfilerManager;
}
protected:
/** Shutdowns the profiler manager. */
void Shutdown( TSharedRef<SDockTab> TabBeingClosed )
{
FProfilerManager::Get()->Shutdown();
TabBeingClosed->SetOnTabClosed( SDockTab::FOnTabClosedCallback() );
}
/** A weak pointer to the global instance of the profiler manager. Will last as long as profiler window is visible. */
TWeakPtr<class IProfilerManager> ProfilerManager;
};
IMPLEMENT_MODULE(FProfilerModule, Profiler);