MCRO
C++23 utilities for Unreal Engine.
|
#include <AutoModularFeature.h>
Public Types | |
using | Feature = FeatureIn |
using | AutoModularFeature = TAutoModularFeature |
Public Member Functions | |
template<typename Implementation > requires CDerivedFrom<Implementation, Feature> | |
void | Register (this Implementation &&self) |
virtual | ~TAutoModularFeature () |
Static Public Member Functions | |
static FORCEINLINE const FName & | FeatureName () |
static FORCEINLINE int32 | ImplementationCount () |
static FORCEINLINE Feature & | Get () |
static FORCEINLINE Feature * | TryGet (const int32 index) |
static FORCEINLINE TArray< Feature * > | GetAll () |
static FORCEINLINE TFuture< Feature * > | GetBelated () |
Auto Modular Features are a workflow with Modular Features where the developer doesn't have to rely on string identifiers. TAutoModularFeature and TFeatureImplementation templates take care of naming the feature and introduces some common functionality, like getter functions and runtime validations.
FeatureIn | Curiously Recurring Template argument of the feature |
Definition at line 89 of file AutoModularFeature.h.
using Mcro::AutoModularFeature::TAutoModularFeature< FeatureIn >::AutoModularFeature = TAutoModularFeature |
Definition at line 93 of file AutoModularFeature.h.
using Mcro::AutoModularFeature::TAutoModularFeature< FeatureIn >::Feature = FeatureIn |
Definition at line 92 of file AutoModularFeature.h.
|
inlinevirtual |
Definition at line 154 of file AutoModularFeature.h.
|
inlinestatic |
Gert the name of the feature
Definition at line 96 of file AutoModularFeature.h.
|
inlinestatic |
Get the first existing implementation of this feature. If there are no implementations a check will fail.
Definition at line 112 of file AutoModularFeature.h.
|
inlinestatic |
Definition at line 128 of file AutoModularFeature.h.
|
inlinestatic |
Get the first implementation once it is registered, or return the first implementation immediately if there's already one registered.
Definition at line 165 of file AutoModularFeature.h.
|
inlinestatic |
Definition at line 104 of file AutoModularFeature.h.
|
inline |
Call this function in implementation constructors. This is a necessary boilerplate to maintain polymorphism of implementations. Otherwise, if the native registration function would be called directly in TAutoModularFeature default constructor, virtual function overrides are not yet known, and "deducing this" is not meant for constructors.
Implementation | Derived type of the implementation |
self | Pointer to implementation registering itself |
Definition at line 143 of file AutoModularFeature.h.
|
inlinestatic |
Get the first existing implementation of this feature. Return nullptr If there are no implementations.
Definition at line 120 of file AutoModularFeature.h.