2014-03-14 14:13:41 -04:00
|
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
ProfilerClientModule.cpp: Implements the FProfilerClientModule class.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "ProfilerClientPrivatePCH.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Implements the ProfilerClient module
|
|
|
|
|
*/
|
|
|
|
|
class FProfilerClientModule
|
|
|
|
|
: public IProfilerClientModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// Begin IModuleInterface interface
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void StartupModule() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
MessageBusPtr = IMessagingModule::Get().GetDefaultBus();
|
|
|
|
|
}
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void ShutdownModule() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// End IModuleInterface interface
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// Begin IProfilerClientModule interface
|
|
|
|
|
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual IProfilerClientPtr CreateProfilerClient() override
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
IMessageBusPtr MessageBus = MessageBusPtr.Pin();
|
|
|
|
|
|
|
|
|
|
if (!MessageBus.IsValid())
|
|
|
|
|
{
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return MakeShareable(new FProfilerClientManager(MessageBus.ToSharedRef()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// End IProfilerClientModule interface
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
// Holds a weak pointer to the message bus.
|
|
|
|
|
IMessageBusWeakPtr MessageBusPtr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Static initialization
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FProfilerClientModule, ProfilerClient);
|