UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
BuildPatchServices::TFactory< Product, DependencyTypes > Class Template Referenceabstract

#include <Factory.h>

+ Inheritance diagram for BuildPatchServices::TFactory< Product, DependencyTypes >:

Public Member Functions

virtual Product * Create (DependencyTypes... Dependencies)=0
 

Detailed Description

template<typename Product, typename... DependencyTypes>
class BuildPatchServices::TFactory< Product, DependencyTypes >

Templated factory interface declaration. This allows a system to declare the factory it requires a consumer to provide. For code readability, you should only use well defined types. For example, declare a config struct, use other IClassDependancies, or typedef a generic tye to name it. Example use: struct FClassConfig { uint32 RetryCount; uint32 TimeoutSeconds; }; typedef TArray<FString> FUriListToLoad; typedef TFactory<IClass, const FClassConfig&, FUriListToLoad, IUriHandlerClass*> IMyClassFactory; A consumer would then implement the factory: class FMyClassFactory : public IMyClassFactory { virtual IClass* Create(const FClassConfig& ClassConfig, FUriListToLoad UriListToLoad, IUriHandlerClass* UriHandlerClass) override { FClass* Class = new FClass(UriHandlerClass); Class->SetRetires(ClassConfig.RetryCount); Class->SetTimeout(ClassConfig.TimeoutSeconds); Class->LoadAll(UriListToLoad); return Class; } };

Member Function Documentation

◆ Create()

template<typename Product , typename... DependencyTypes>
virtual Product * BuildPatchServices::TFactory< Product, DependencyTypes >::Create ( DependencyTypes...  Dependencies)
pure virtual

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