Files
UnrealEngineUWP/Engine/Source/Developer/TaskGraph/Public/VisualizerEvents.h
bryan sefcik de1956f47b Ran IWYU on Public headers under Engine/Source/Developer/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21064294 by bryan.sefcik
#jira
#preflight 62d5c2111062f2e63015e598

#ROBOMERGE-OWNER: bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21155249 via CL 21158121 via CL 21161259
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21182053 by bryan sefcik in ue5-main branch]
2022-07-20 12:03:45 -04:00

97 lines
2.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/Array.h"
#include "Containers/UnrealString.h"
#include "CoreMinimal.h"
#include "HAL/Platform.h"
#include "HAL/PlatformCrt.h"
#include "Templates/SharedPointer.h"
class FArchive;
namespace EVisualizerTimeUnits
{
typedef uint8 Type;
/** Microseconds */
const Type Microseconds = 0;
/** Milliseconds */
const Type Milliseconds = 1;
/** Seconds */
const Type Seconds = 2;
};
namespace EVisualizerViewMode
{
typedef uint8 Type;
/** Hierarchical */
const Type Hierarchical = 0;
/** Flat */
const Type Flat = 1;
/** Coalesced */
const Type Coalesced = 2;
/** FlatCoalesced */
const Type FlatCoalesced = 3;
};
/** A graph event represented by SGraphBar as a single bar.*/
struct FVisualizerEvent
{
/** Normalized start time (0.0-1.0) of the event relative to the first event in the profile */
double Start;
/** Normalized duration time (0.0-1.0) of the event. */
double Duration;
/** Duration of the event in milliseconds */
double DurationMs;
/** Category this event belongs to (thread/file etc.) */
int32 Category;
/** Name of the event. */
FString EventName;
/** Determines if this event is selected or not. */
bool IsSelected;
/** Bar color */
uint32 ColorIndex;
/** Parent event */
TSharedPtr< FVisualizerEvent > ParentEvent;
/** Child events */
TArray< TSharedPtr< FVisualizerEvent > > Children;
FVisualizerEvent(const double InStart, const double InDuration, const double InDurationMs, const int32 InCategory, const FString& InEventName)
: Start( InStart )
, Duration( InDuration )
, DurationMs( InDurationMs )
, Category( InCategory )
, EventName( InEventName )
, IsSelected( false )
, ColorIndex( 0 )
{
ColorIndex = GetTypeHash( InEventName );
}
static TSharedPtr< FVisualizerEvent > LoadVisualizerEvent(FArchive *Ar);
static void SaveVisualizerEventRecursively(FArchive *Ar, TSharedPtr< FVisualizerEvent > VisualizerEvent);
private:
static TSharedPtr< FVisualizerEvent > LoadVisualizerEventRecursively(FArchive *Ar, TSharedPtr< FVisualizerEvent > InParentEvent);
};
/** Array of graph events.*/
typedef TArray< TSharedPtr< FVisualizerEvent > > FVisualizerEventsArray;