Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Debugger/StateTreeTraceProvider.h
yoan stamant 1cd242d1dc [StateTree] debugger update
- moved debugger related files to a dedicated directory
- trace provider now allows to read all timelines associated to a given state tree asset instance
- added multiple slate widgets to manage tracks and timelines (directly inspired from RewindDebugger to make it easier to integrate the tools together eventually).
- added synchronized lists of instance names and timelines
- converted EStateTreeUpdatePhase to enum flags used to build frame details hierarchically
#preflight 645a57584c3ec54e6e65f494

[CL 25390252 by yoan stamant in ue5-main branch]
2023-05-09 12:57:56 -04:00

44 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#if WITH_STATETREE_DEBUGGER
#include "IStateTreeTraceProvider.h"
#include "Model/PointTimeline.h"
#include "StateTreeTypes.h" // required to compile TMap<FStateTreeInstanceDebugId, ...>
namespace TraceServices { class IAnalysisSession; }
enum class EStateTreeTraceInstanceEventType : uint8;
class UStateTree;
namespace UE::StateTreeDebugger { struct FInstanceDescriptor; }
class FStateTreeTraceProvider : public IStateTreeTraceProvider
{
public:
static FName ProviderName;
explicit FStateTreeTraceProvider(TraceServices::IAnalysisSession& InSession);
void AppendEvent(FStateTreeInstanceDebugId InInstanceId, double InTime, const FStateTreeTraceEventVariantType& InEvent);
void AppendInstanceEvent(
const UStateTree* InStateTree,
const FStateTreeInstanceDebugId InInstanceId,
const TCHAR* InInstanceName,
double Time,
EStateTreeTraceInstanceEventType EventType);
protected:
/** IStateTreeDebuggerProvider interface */
virtual void GetInstances(TArray<UE::StateTreeDebugger::FInstanceDescriptor>& OutInstances) const override;
virtual bool ReadTimelines(const FStateTreeInstanceDebugId InstanceId, TFunctionRef<void(const FStateTreeInstanceDebugId ProcessedInstanceId, const FEventsTimeline&)> Callback) const override;
virtual bool ReadTimelines(const UStateTree& StateTree, TFunctionRef<void(const FStateTreeInstanceDebugId ProcessedInstanceId, const FEventsTimeline&)> Callback) const override;
private:
TraceServices::IAnalysisSession& Session;
TMap<FStateTreeInstanceDebugId, uint32> InstanceIdToDebuggerEntryTimelines;
TArray<UE::StateTreeDebugger::FInstanceDescriptor> Descriptors;
TArray<TSharedRef<TraceServices::TPointTimeline<FStateTreeTraceEventVariantType>>> EventsTimelines;
};
#endif // WITH_STATETREE_DEBUGGER