You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Usage of MessageLog in non-ui threads is tricky and need to be carefully managed to avoid flushing memory on the wrong thread. With this change direct usage of MessageLog in the analysis engine is removed and replaced with a callback system which allows the user of TraceAnalysis to implement display of the messages themselves. In the case of InsightsManager this means queuing up the messages in analysis session and regularly polled from the UI thread. #rb ionut.matasaru #jira UE-185528 [CL 26086861 by Johan Berg in ue5-main branch]
41 lines
928 B
C++
41 lines
928 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Analysis/Engine.h"
|
|
#include "HAL/Runnable.h"
|
|
#include "Logging/MessageLog.h"
|
|
#include "Trace/Analysis.h"
|
|
|
|
class FEvent;
|
|
class FRunnableThread;
|
|
|
|
namespace UE {
|
|
namespace Trace {
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class FAnalysisProcessor::FImpl
|
|
: public FRunnable
|
|
{
|
|
public:
|
|
FImpl(IInDataStream& DataStream, TArray<IAnalyzer*>&& InAnalyzers, FMessageDelegate&& InMessage);
|
|
~FImpl();
|
|
virtual uint32 Run() override;
|
|
bool IsActive() const;
|
|
void StopAnalysis();
|
|
void WaitOnAnalysis();
|
|
void PauseAnalysis(bool bState);
|
|
FMessageLog* GetLog();
|
|
|
|
private:
|
|
FAnalysisEngine AnalysisEngine;
|
|
IInDataStream& DataStream;
|
|
FEvent* StopEvent;
|
|
FEvent* UnpausedEvent;
|
|
FRunnableThread* Thread = nullptr;
|
|
volatile bool bComplete = false;
|
|
};
|
|
|
|
} // namespace Trace
|
|
} // namespace UE
|