UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IModularFeatures Class Referenceabstract

#include <IModularFeatures.h>

+ Inheritance diagram for IModularFeatures:

Classes

struct  FScopedLockModularFeatureList
 

Public Member Functions

virtual ~IModularFeatures ()
 
bool IsModularFeatureAvailable (const FName Type)
 
template<typename TModularFeature >
TModularFeature & GetModularFeature (const FName Type)
 
template<typename TModularFeature >
TArray< TModularFeature * > GetModularFeatureImplementations (const FName Type)
 
virtual void LockModularFeatureList ()=0
 
virtual void UnlockModularFeatureList ()=0
 
virtual int32 GetModularFeatureImplementationCount (const FName Type)=0
 
virtual class IModularFeatureGetModularFeatureImplementation (const FName Type, const int32 Index)=0
 
virtual void RegisterModularFeature (const FName Type, class IModularFeature *ModularFeature)=0
 
virtual void UnregisterModularFeature (const FName Type, class IModularFeature *ModularFeature)=0
 
 DECLARE_EVENT_TwoParams (IModularFeatures, FOnModularFeatureRegistered, const FName &, class IModularFeature *)
 
virtual FOnModularFeatureRegisteredOnModularFeatureRegistered ()=0
 
 DECLARE_EVENT_TwoParams (IModularFeatures, FOnModularFeatureUnregistered, const FName &, class IModularFeature *)
 
virtual FOnModularFeatureUnregisteredOnModularFeatureUnregistered ()=0
 

Static Public Member Functions

static CORE_API IModularFeaturesGet ()
 

Detailed Description

Public interface to all known modular features

Constructor & Destructor Documentation

◆ ~IModularFeatures()

virtual IModularFeatures::~IModularFeatures ( )
inlinevirtual

Virtual destructor, to make polymorphism happy.

Member Function Documentation

◆ DECLARE_EVENT_TwoParams() [1/2]

IModularFeatures::DECLARE_EVENT_TwoParams ( IModularFeatures  ,
FOnModularFeatureRegistered  ,
const FName ,
class IModularFeature  
)

Event used to inform clients that a modular feature has been registered.

Parameters
TypeThe name of the modular feature type being registered.

◆ DECLARE_EVENT_TwoParams() [2/2]

IModularFeatures::DECLARE_EVENT_TwoParams ( IModularFeatures  ,
FOnModularFeatureUnregistered  ,
const FName ,
class IModularFeature  
)

Event used to inform clients that a modular feature has been unregistered.

Parameters
TypeThe name of the modular feature type being unregistered.

◆ Get()

IModularFeatures & IModularFeatures::Get ( )
static

Static: Access singleton instance

Returns
Reference to the singleton object

◆ GetModularFeature()

template<typename TModularFeature >
TModularFeature & IModularFeatures::GetModularFeature ( const FName  Type)
inline

Queries for a specific feature. If multiple implementations of the same feature were registered, this will return the first. Will assert or crash if the specified feature is not available! You should call IsModularFeatureAvailable() first!

Parameters
TypeThe type of feature we're looking for
Returns
The feature.

◆ GetModularFeatureImplementation()

virtual class IModularFeature * IModularFeatures::GetModularFeatureImplementation ( const FName  Type,
const int32  Index 
)
pure virtual

Queries for a specific modular feature. Returns NULL if the feature is not available. Does not assert. Usually you should just call GetModularFeature instead, after calling IsModularFeatureAvailable().

Parameters
TypeThe type of feature we're looking for
IndexThe index of the implementation (there may be multiple implementations of the same feature registered.)
Returns
Pointer to the feature interface, or NULL if it's not available right now.

Implemented in FModularFeatures.

◆ GetModularFeatureImplementationCount()

virtual int32 IModularFeatures::GetModularFeatureImplementationCount ( const FName  Type)
pure virtual

Returns the number of registered implementations of the specified feature type.

Parameters
TypeThe type of feature we're looking for
Returns
Number of implementations of this feature.

Implemented in FModularFeatures.

◆ GetModularFeatureImplementations()

template<typename TModularFeature >
TArray< TModularFeature * > IModularFeatures::GetModularFeatureImplementations ( const FName  Type)
inline

Queries for one or more implementations of a single feature. If no feature of this type is registered, will return an empty array.

Parameters
TypeThe type of feature we're looking for
Returns
List of available implementations of this feature.

◆ IsModularFeatureAvailable()

bool IModularFeatures::IsModularFeatureAvailable ( const FName  Type)
inline

Checks to see if the specified feature is available

Parameters
TypeThe type of feature we're looking for
Returns
True if the feature is available right now and it is safe to call GetModularFeature()

◆ LockModularFeatureList()

virtual void IModularFeatures::LockModularFeatureList ( )
pure virtual

Lock modular features for access from another thread

Implemented in FModularFeatures.

◆ OnModularFeatureRegistered()

virtual FOnModularFeatureRegistered & IModularFeatures::OnModularFeatureRegistered ( )
pure virtual

Implemented in FModularFeatures.

◆ OnModularFeatureUnregistered()

virtual FOnModularFeatureUnregistered & IModularFeatures::OnModularFeatureUnregistered ( )
pure virtual

Implemented in FModularFeatures.

◆ RegisterModularFeature()

virtual void IModularFeatures::RegisterModularFeature ( const FName  Type,
class IModularFeature ModularFeature 
)
pure virtual

Registers a feature. Usually called by plugins to augment or replace existing modular features.

Parameters
TypeThe type of feature we're registering
ModularFeatureInterface to the modular feature object. We do not assume ownership of this object. It's up to you to keep it allocated until it is unregistered later on.

Implemented in FModularFeatures.

◆ UnlockModularFeatureList()

virtual void IModularFeatures::UnlockModularFeatureList ( )
pure virtual

Unlock modular features when finished accessing from another thread

Implemented in FModularFeatures.

◆ UnregisterModularFeature()

virtual void IModularFeatures::UnregisterModularFeature ( const FName  Type,
class IModularFeature ModularFeature 
)
pure virtual

Unregisters a feature that was registered earlier on. After unregistering a feature, other systems will no longer be able to gain access to it through this interface.

Parameters
TypeThe type of feature we're unregistering
ModularFeatureInterface to the modular feature object

Implemented in FModularFeatures.


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