UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FTestData Class Reference

Public Member Functions

void AddChild (TSharedRef< FTestData > InChild)
 
const FTextGetName () const
 
void SetName (const FText &InNewName)
 
void GetChildren (TArray< TSharedPtr< FTestData > > &OutChildren)
 
float GetNumber () const
 
void SetNumber (float NewValue)
 

Static Public Member Functions

static TSharedRef< FTestDataMake (const FText &ChildName)
 
static bool RemoveRecursive (TArray< TSharedPtr< FTestData > > &RemoveFrom, const TSharedPtr< FTestData > &ItemToRemove)
 
static bool InsertRecursive (TArray< TSharedPtr< FTestData > > &InsertInto, const TSharedRef< FTestData > &ItemToInsert, const TSharedRef< FTestData > &TargetItem, EItemDropZone RelativeLocation)
 
static float MakeRandomItemHeight ()
 
static bool BinaryProbability (int32 Level)
 
static int32 GenerateChildren (TSharedRef< FTestData > MakeChildrenForMe, int32 DescendantsLeftToMake, int32 NestingDepth)
 

Detailed Description

A data item with which we can test lists and trees. It supports having children and having a name.

Member Function Documentation

◆ AddChild()

void FTestData::AddChild ( TSharedRef< FTestData InChild)
inline

Add a child to this test data item.

Parameters
InChildA reference to the child being added

◆ BinaryProbability()

static bool FTestData::BinaryProbability ( int32  Level)
inlinestatic
Returns
true or false with decreasing probability of true for higher values of Level. Level < 0 is always true. Level = 0 is 50.0% chance of true. Level = 1 is 25.0% chance of true. Level = 2 is 12.5% chance of true. Level = N is 1/(2^Level) chance of true.

◆ GenerateChildren()

static int32 FTestData::GenerateChildren ( TSharedRef< FTestData MakeChildrenForMe,
int32  DescendantsLeftToMake,
int32  NestingDepth 
)
inlinestatic

Recursively add a bunch of descendants to this node. TotalDescendants is how many descendants we should add before we stop.

Parameters
MakeChildrenForMeThe node to which to add children
DescendantsLeftToMakeHow many descendants we still need to make
NestingDepthTrack the nesting depth to prevent super-deep nesting
Returns
How many descendants we still need to make after this function ran.

◆ GetChildren()

void FTestData::GetChildren ( TArray< TSharedPtr< FTestData > > &  OutChildren)
inline

Populate the OutChildren array with this data item's children.

Parameters
OutChildren

◆ GetName()

const FText & FTestData::GetName ( ) const
inline
Returns
the name of this data item

◆ GetNumber()

float FTestData::GetNumber ( ) const
inline
Returns
the dummy number value

◆ InsertRecursive()

static bool FTestData::InsertRecursive ( TArray< TSharedPtr< FTestData > > &  InsertInto,
const TSharedRef< FTestData > &  ItemToInsert,
const TSharedRef< FTestData > &  TargetItem,
EItemDropZone  RelativeLocation 
)
inlinestatic

Recursively look for TargetItem in InsertInto and any of the descendants. Insert ItemToInsert relative to the target. Relative positioning dictated by RelativeLocation.

Returns
true when successful.

◆ Make()

static TSharedRef< FTestData > FTestData::Make ( const FText ChildName)
inlinestatic

◆ MakeRandomItemHeight()

static float FTestData::MakeRandomItemHeight ( )
inlinestatic

◆ RemoveRecursive()

static bool FTestData::RemoveRecursive ( TArray< TSharedPtr< FTestData > > &  RemoveFrom,
const TSharedPtr< FTestData > &  ItemToRemove 
)
inlinestatic

Recursively look for ItemToRemove in RemoveFrom and any of the descendants, and remove ItemToRemove.

Returns
true when successful.

◆ SetName()

void FTestData::SetName ( const FText InNewName)
inline

Set this data node's name

Parameters
InNewNameThe new name to assign to this data item.

◆ SetNumber()

void FTestData::SetNumber ( float  NewValue)
inline
Parameters
NewValueThe new dummy value

The documentation for this class was generated from the following file: