![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <Factory.h>
Inheritance diagram for BuildPatchServices::TFactory< Product, DependencyTypes >:Public Member Functions | |
| virtual Product * | Create (DependencyTypes... Dependencies)=0 |
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; } };
|
pure virtual |