// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreTypes.h" // TraceInsightsCore #include "InsightsCore/Table/ViewModels/TableTreeNode.h" // TraceInsights #include "Insights/TaskGraphProfiler/ViewModels/TaskTable.h" #include "Insights/TaskGraphProfiler/ViewModels/TaskEntry.h" //////////////////////////////////////////////////////////////////////////////////////////////////// namespace UE::Insights::TaskGraphProfiler { //////////////////////////////////////////////////////////////////////////////////////////////////// class FTaskNode; /** Type definition for shared pointers to instances of FTaskNode. */ typedef TSharedPtr FTaskNodePtr; /** Type definition for shared references to instances of FTaskNode. */ typedef TSharedRef FTaskNodeRef; /** Type definition for shared references to const instances of FTaskNode. */ typedef TSharedRef FTaskNodeRefConst; /** Type definition for weak references to instances of FTaskNode. */ typedef TWeakPtr FTaskNodeWeak; //////////////////////////////////////////////////////////////////////////////////////////////////// /** * Class used to store information about a task node (used in the STaskTreeView). */ class FTaskNode : public FTableTreeNode { INSIGHTS_DECLARE_RTTI(FTaskNode, FTableTreeNode) public: /** Initialization constructor for the Task node. */ explicit FTaskNode(const FName InName, TWeakPtr InParentTable, int32 InRowIndex) : FTableTreeNode(InName, InParentTable, InRowIndex) { } /** Initialization constructor for the group node. */ explicit FTaskNode(const FName InGroupName, TWeakPtr InParentTable) : FTableTreeNode(InGroupName, InParentTable) { } FTaskTable& GetTaskTableChecked() const { const TSharedPtr& TablePin = GetParentTable().Pin(); check(TablePin.IsValid()); return *StaticCastSharedPtr(TablePin); } bool IsValidTask() const { return GetTaskTableChecked().IsValidRowIndex(GetRowIndex()); } const FTaskEntry* GetTask() const { return GetTaskTableChecked().GetTask(GetRowIndex()); } const FTaskEntry& GetTaskChecked() const { return GetTaskTableChecked().GetTaskChecked(GetRowIndex()); } }; //////////////////////////////////////////////////////////////////////////////////////////////////// } // namespace UE::Insights::TaskGraphProfiler