Files
UnrealEngineUWP/Engine/Source/Developer/Profiler/Private/ProfilerModule.cpp
Jaroslaw Surowiec 34ec05e6a1 #UE4.Profiler (misc tweaks, basic support for the new view mode, added profiler stream class)
- Misc tweaks to make profiler more base on the new stats system
- Added a new view mode to the data graph, for the regular stats file it will be LineIndexBased, for the raw stats file it will be ThreadViewTimeBased
- Added profiler stream, a new class that will hold all data read from the raw stats file, hopefully will replace the current profiler data provider/ data source later
- Added basic support for the second profiler view mode

[CL 2054275 by Jaroslaw Surowiec in Main branch]
2014-04-23 20:14:38 -04:00

60 lines
1.8 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ProfilerModule.cpp: Implements the FProfilerModule class.
=============================================================================*/
#include "ProfilerPrivatePCH.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);