UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMassProcessorDependencySolver Struct Reference

#include <MassProcessorDependencySolver.h>

Classes

struct  FNode
 
struct  FResult
 

Public Member Functions

MASSENTITY_API FMassProcessorDependencySolver (TArrayView< UMassProcessor *const > InProcessors, const bool bIsGameRuntime=true)
 
MASSENTITY_API void ResolveDependencies (TArray< FMassProcessorOrderInfo > &OutResult, TSharedPtr< FMassEntityManager > EntityManager=nullptr, FResult *InOutOptionalResult=nullptr)
 
bool IsSolvingForSingleThread () const
 

Static Public Member Functions

static MASSENTITY_API void CreateSubGroupNames (FName InGroupName, TArray< FString > &SubGroupNames)
 
static bool IsResultUpToDate (const FResult &InResult, TSharedPtr< FMassEntityManager > EntityManager)
 

Protected Member Functions

bool PerformSolverStep (FResourceUsage &ResourceUsage, TArray< int32 > &InOutIndicesRemaining, TArray< int32 > &OutNodeIndices)
 
int32 CreateNodes (UMassProcessor &Processor)
 
void BuildDependencies ()
 
void Solve (TArray< FMassProcessorOrderInfo > &OutResult)
 
void LogNode (const FNode &Node, int Indent=0)
 
void GatherSubsystemInformation (const UE::Mass::FTypeManager &TypeManager)
 

Protected Attributes

TArrayView< UMassProcessor *const > Processors
 
const bool bSingleThreadTarget = bool(!MASS_DO_PARALLEL)
 
const bool bGameRuntime = true
 
FString DependencyGraphFileName
 
TArray< FNodeAllNodes
 
TMap< FName, int32NodeIndexMap
 
FMassExternalSubsystemBitSet MultiThreadedSystemsBitSet
 

Constructor & Destructor Documentation

◆ FMassProcessorDependencySolver()

FMassProcessorDependencySolver::FMassProcessorDependencySolver ( TArrayView< UMassProcessor *const >  InProcessors,
const bool  bIsGameRuntime = true 
)

Member Function Documentation

◆ BuildDependencies()

void FMassProcessorDependencySolver::BuildDependencies ( )
protected

◆ CreateNodes()

int32 FMassProcessorDependencySolver::CreateNodes ( UMassProcessor Processor)
protected

◆ CreateSubGroupNames()

void FMassProcessorDependencySolver::CreateSubGroupNames ( FName  InGroupName,
TArray< FString > &  SubGroupNames 
)
static

◆ GatherSubsystemInformation()

void FMassProcessorDependencySolver::GatherSubsystemInformation ( const UE::Mass::FTypeManager TypeManager)
protected

Finds out which subsystems handle multithreaded RW operations, and caches the result in MultiThreadedSystemsBitSet

◆ IsResultUpToDate()

bool FMassProcessorDependencySolver::IsResultUpToDate ( const FResult InResult,
TSharedPtr< FMassEntityManager EntityManager 
)
static

Determines whether the dependency solving that produced InResult will produce different results if run with a given EntityManager

◆ IsSolvingForSingleThread()

bool FMassProcessorDependencySolver::IsSolvingForSingleThread ( ) const
inline

◆ LogNode()

void FMassProcessorDependencySolver::LogNode ( const FNode Node,
int  Indent = 0 
)
protected

◆ PerformSolverStep()

bool FMassProcessorDependencySolver::PerformSolverStep ( FResourceUsage &  ResourceUsage,
TArray< int32 > &  InOutIndicesRemaining,
TArray< int32 > &  OutNodeIndices 
)
protected

Traverses InOutIndicesRemaining in search of the first RootNode's node that has no dependencies left. Once found the node's index gets added to OutNodeIndices, removed from dependency lists from all other nodes and the function quits.

Returns
'true' if a dependency-less node has been found and added to OutNodeIndices; 'false' otherwise.

◆ ResolveDependencies()

void FMassProcessorDependencySolver::ResolveDependencies ( TArray< FMassProcessorOrderInfo > &  OutResult,
TSharedPtr< FMassEntityManager EntityManager = nullptr,
FMassProcessorDependencySolver::FResult InOutOptionalResult = nullptr 
)

◆ Solve()

void FMassProcessorDependencySolver::Solve ( TArray< FMassProcessorOrderInfo > &  OutResult)
protected

Member Data Documentation

◆ AllNodes

TArray<FNode> FMassProcessorDependencySolver::AllNodes
protected

◆ bGameRuntime

const bool FMassProcessorDependencySolver::bGameRuntime = true
protected

◆ bSingleThreadTarget

const bool FMassProcessorDependencySolver::bSingleThreadTarget = bool(!MASS_DO_PARALLEL)
protected

indicates whether we're generating processor order to be run in single-threaded or multithreaded environment (usually this means Dedicated Server vs Any other configuration). In Single-Threaded mode we can skip a bunch of expensive, fine-tuning tests. @Note currently the value depends on MASS_DO_PARALLEL and there's no way to configure it otherwise, but there's nothing inherently stopping us from letting users configure it.

◆ DependencyGraphFileName

FString FMassProcessorDependencySolver::DependencyGraphFileName
protected

◆ MultiThreadedSystemsBitSet

FMassExternalSubsystemBitSet FMassProcessorDependencySolver::MultiThreadedSystemsBitSet
protected

Stores the subsystems we know of that handle multithreaded access well - we filter those out, we don't need to consider them.

◆ NodeIndexMap

TMap<FName, int32> FMassProcessorDependencySolver::NodeIndexMap
protected

◆ Processors

TArrayView<UMassProcessor* const> FMassProcessorDependencySolver::Processors
protected

The documentation for this struct was generated from the following files: