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

#include <ClassTree.h>

Public Member Functions

void PopulateTree ()
 
bool AddClass (UClass *ChildClass)
 
UClassGetClass () const
 
void GetChildClasses (TArray< FClassTree * > &ChildClasses, bool bRecurse=false)
 
void GetChildClasses (TArray< const FClassTree * > &ChildClasses, bool bRecurse=false) const
 
template<class Comparator >
void GetChildClasses (TArray< UClass * > &ChildClasses, const Comparator &Mask, bool bRecurse=false) const
 
template<class Comparator >
FClassTreeGenerateMaskedClassTree (const Comparator &Mask) const
 
FClassTreeGetRootNode ()
 
const FClassTreeGetRootNode () const
 
FClassTreeGetNode (UClass *SearchClass)
 
const FClassTreeFindNode (UClass *SearchClass) const
 
bool ChangeParentClass (UClass *SearchClass, UClass *InNewParentClass=NULL)
 
int32 Num () const
 
void Validate () const
 
 FClassTree (UClass *BaseClass)
 
 ~FClassTree ()
 
void DumpClassTree (int32 IndentCount, FOutputDevice &Ar)
 
UE_FORCEINLINE_HINT int32 NumChildren () const
 
UE_FORCEINLINE_HINT const FClassTreeGetChild (int32 Index) const
 

Detailed Description

Manages an inheritance tree. There is one FClassTree node for each UClass. Each node stores pointers to its parent and child nodes. New nodes should always be added to the root node. This is enforced by allowing const references to child nodes.

Constructor & Destructor Documentation

◆ FClassTree()

FClassTree::FClassTree ( UClass BaseClass)
inline

Constructor

Parameters
BaseClassthe class that should be associated with this node.

◆ ~FClassTree()

FClassTree::~FClassTree ( )
inline

Destructor. Frees the memory for all child nodes, recursively.

Member Function Documentation

◆ AddClass()

bool FClassTree::AddClass ( UClass ChildClass)
inline

Public interface for adding a new class to the tree. Actual functionality implemented separately in order to support being able to call AddClass() on any node in the tree structure and have it inserted into the correct location.

Can be called on any node in the tree. Takes care of inserting the class into the correct location in the structure. Correctly handles adding classes in any arbitrary order (i.e. parent classes do not need to be added before child classes, etc.)

Parameters
ChildClassthe class to add to the tree
Returns
buffer that will contain the post processed text

◆ ChangeParentClass()

bool FClassTree::ChangeParentClass ( UClass SearchClass,
UClass InNewParentClass = NULL 
)
inline

Move a class node in the hierarchy tree after a class has changed its SuperClass

Parameters
SearchClassthe class that has changed parents
InNewParentClassif non-null force reparenting to this instead of the SuperClass
Returns
true if SearchClass was successfully moved to the new location

◆ DumpClassTree()

void FClassTree::DumpClassTree ( int32  IndentCount,
FOutputDevice Ar 
)
inline

◆ FindNode()

const FClassTree * FClassTree::FindNode ( UClass SearchClass) const
inline

Find the node associated with the class specified

Parameters
SearchClassthe class to search for
Returns
a pointer to the node associated with the class specified, or NULL if this branch doesn't contain that class

◆ GenerateMaskedClassTree()

template<class Comparator >
FClassTree * FClassTree::GenerateMaskedClassTree ( const Comparator Mask) const
inline

Creates a new class tree rooted at this node's class, which contains only classes which match the class flags specified.

Parameters
Maskinformation about the types of classes to include. Must implement bool IsValidClass(const FClassTree* Node) const.
Returns
a pointer to an FClassTree that contains only classes which match the parameters specified by MaskParams. If the class associated with this node does not meet the requirements of the MaskParams, the return value is a NULL pointer, and the class tree will not contain any of the children of that class. NOTE: the caller is responsible for deleting the FClassTree returned by this function!!

◆ GetChild()

UE_FORCEINLINE_HINT const FClassTree * FClassTree::GetChild ( int32  Index) const
inline

◆ GetChildClasses() [1/3]

void FClassTree::GetChildClasses ( TArray< const FClassTree * > &  ChildClasses,
bool  bRecurse = false 
) const
inline

Retrieve the child nodes of this node

Parameters
ChildClasses[out] this node's children
bRecurseif false, only direct children of this node's class will be considered

◆ GetChildClasses() [2/3]

void FClassTree::GetChildClasses ( TArray< FClassTree * > &  ChildClasses,
bool  bRecurse = false 
)
inline

Retrieve the child nodes of this node

Parameters
ChildClasses[out] this node's children
bRecurseif false, only direct children of this node's class will be considered

◆ GetChildClasses() [3/3]

template<class Comparator >
void FClassTree::GetChildClasses ( TArray< UClass * > &  ChildClasses,
const Comparator Mask,
bool  bRecurse = false 
) const
inline

Retrieve the child nodes of this node that match the flags specified

Parameters
ChildClasses[out] array of child classes with class flags matching the flags specified
Maskinfo on how to determine whether classes are included in the results. Must implement bool IsValidClass(const FClassTree* Node) const.
bRecurseif false, only direct children of this node's class will be considered

◆ GetClass()

UClass * FClassTree::GetClass ( ) const
inline

Get the class associated with this node

Returns
a pointer to the class associated with this node

◆ GetNode()

FClassTree * FClassTree::GetNode ( UClass SearchClass)
inline

Find the node associated with the class specified

Parameters
SearchClassthe class to search for
Returns
a pointer to the node associated with the class specified, or NULL if this branch doesn't contain that class

◆ GetRootNode() [1/2]

FClassTree * FClassTree::GetRootNode ( )
inline

Gets the root node for this class tree

◆ GetRootNode() [2/2]

const FClassTree * FClassTree::GetRootNode ( ) const
inline

Gets the root node for this class tree

◆ Num()

int32 FClassTree::Num ( ) const
inline

Get the number of classes represented by this node, including any child nodes

Returns
the number of classes represented by this node, including any child nodes

◆ NumChildren()

UE_FORCEINLINE_HINT int32 FClassTree::NumChildren ( ) const
inline

Get the number of child nodes of this node

Returns
the number of child nodes of this node

◆ PopulateTree()

void FClassTree::PopulateTree ( )
inline

Utility/convenience method for populating a class tree.

◆ Validate()

void FClassTree::Validate ( ) const
inline

Verify that this node is at the correct location in the class tree


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