UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TScriptInterface< InInterfaceType > Class Template Reference

#include <ScriptInterface.h>

+ Inheritance diagram for TScriptInterface< InInterfaceType >:

Public Types

using InterfaceType = InInterfaceType
 
using UObjectType = TCopyQualifiersFromTo_T< InterfaceType, UObject >
 

Public Member Functions

 TScriptInterface ()=default
 
 TScriptInterface (TYPE_OF_NULLPTR)
 
template<typename U >
 TScriptInterface (U &&Source)
 
template<typename OtherInterfaceType >
 TScriptInterface (const TScriptInterface< OtherInterfaceType > &Other)
 
template<typename ObjectType >
 TScriptInterface (TObjectPtr< ObjectType > SourceObject)
 
 TScriptInterface (const TScriptInterface &)=default
 
TScriptInterfaceoperator= (const TScriptInterface &)=default
 
TScriptInterfaceoperator= (TYPE_OF_NULLPTR)
 
template<typename U >
TScriptInterfaceoperator= (U &&Source)
 
template<typename OtherInterfaceType >
TScriptInterfaceoperator= (const TScriptInterface< OtherInterfaceType > &Other)
 
template<typename ObjectType >
TScriptInterfaceoperator= (TObjectPtr< ObjectType > SourceObject)
 
template<typename OtherInterface >
UE_FORCEINLINE_HINT bool operator== (const OtherInterface *Other) const
 
template<typename OtherInterface >
UE_FORCEINLINE_HINT bool operator!= (const OtherInterface *Other) const
 
UE_FORCEINLINE_HINT bool operator== (const TScriptInterface &Other) const
 
UE_FORCEINLINE_HINT bool operator!= (const TScriptInterface &Other) const
 
UE_FORCEINLINE_HINT bool operator== (TYPE_OF_NULLPTR) const
 
UE_FORCEINLINE_HINT bool operator!= (TYPE_OF_NULLPTR) const
 
UE_FORCEINLINE_HINT InInterfaceTypeoperator-> () const
 
UE_FORCEINLINE_HINT InInterfaceTypeoperator* () const
 
UE_FORCEINLINE_HINT InInterfaceTypeGetInterface () const
 
UE_FORCEINLINE_HINT void SetInterface (InInterfaceType *InInterfacePointer)
 
UE_FORCEINLINE_HINT UObjectTypeGetObject () const
 
UE_FORCEINLINE_HINT TObjectPtr< UObjectType > & GetObjectRef ()
 
UE_FORCEINLINE_HINT void SetObject (UObjectType *InObjectPointer)
 
UE_FORCEINLINE_HINT operator bool () const
 
- Public Member Functions inherited from FScriptInterface
 FScriptInterface ()=default
 
 FScriptInterface (UObject *InObjectPointer, void *InInterfacePointer)
 
 FScriptInterface (const FScriptInterface &)=default
 
FScriptInterfaceoperator= (const FScriptInterface &)=default
 
UE_FORCEINLINE_HINT UObjectGetObject () const
 
UE_FORCEINLINE_HINT TObjectPtr< UObject > & GetObjectRef ()
 
UE_FORCEINLINE_HINT voidGetInterface () const
 
void SetObject (UObject *InObjectPointer)
 
UE_FORCEINLINE_HINT void SetInterface (void *InInterfacePointer)
 
UE_FORCEINLINE_HINT bool operator== (const FScriptInterface &Other) const
 
UE_FORCEINLINE_HINT bool operator!= (const FScriptInterface &Other) const
 
void AddReferencedObjects (FReferenceCollector &Collector)
 

Friends

FArchiveoperator<< (FArchive &Ar, TScriptInterface &Interface)
 

Additional Inherited Members

- Protected Member Functions inherited from FScriptInterface
COREUOBJECT_API FArchiveSerialize (FArchive &Ar, class UClass *InterfaceType)
 

Detailed Description

template<typename InInterfaceType>
class TScriptInterface< InInterfaceType >

Templated version of FScriptInterface, which provides accessors and operators for referencing the interface portion of an object implementing an interface. This type is only useful with native interfaces, UClass::ImplementsInterface should be used to check for blueprint interfaces.

Member Typedef Documentation

◆ InterfaceType

◆ UObjectType

Constructor & Destructor Documentation

◆ TScriptInterface() [1/6]

Default constructor

◆ TScriptInterface() [2/6]

Construction from nullptr

◆ TScriptInterface() [3/6]

template<typename U >
TScriptInterface< InInterfaceType >::TScriptInterface ( U &&  Source)
inline

Construction from an object type that may natively implement InterfaceType

◆ TScriptInterface() [4/6]

Construction from another script interface of a compatible interface type

◆ TScriptInterface() [5/6]

template<typename ObjectType >
TScriptInterface< InInterfaceType >::TScriptInterface ( TObjectPtr< ObjectType >  SourceObject)
inline

Assignment from an object type that may natively implement InterfaceType

◆ TScriptInterface() [6/6]

Member Function Documentation

◆ GetInterface()

Returns the pointer to the interface

◆ GetObject()

Returns the ObjectPointer contained by this TScriptInterface

◆ GetObjectRef()

Returns the ObjectPointer contained by this TScriptInterface

◆ operator bool()

UE_FORCEINLINE_HINT TScriptInterface< InInterfaceType >::operator bool ( ) const
inlineexplicit

Boolean operator, returns true if this object natively implements InterfaceType. This will return false for objects that only implement the interface in blueprint classes.

◆ operator!=() [1/3]

◆ operator!=() [2/3]

◆ operator!=() [3/3]

◆ operator*()

Dereference operator. Provides transparent access to the native interface pointer contained by this TScriptInterface

Returns
a reference (of type InterfaceType) to the object pointed to by InterfacePointer

◆ operator->()

Member access operator. Provides transparent access to the native interface pointer contained by this TScriptInterface

◆ operator=() [1/5]

◆ operator=() [2/5]

Assignment from another script interface of a compatible interface type

◆ operator=() [3/5]

template<typename ObjectType >
TScriptInterface & TScriptInterface< InInterfaceType >::operator= ( TObjectPtr< ObjectType >  SourceObject)
inline

Assignment from an object type that may natively implement InterfaceType

◆ operator=() [4/5]

Assignment from nullptr

◆ operator=() [5/5]

template<typename U >
TScriptInterface & TScriptInterface< InInterfaceType >::operator= ( U &&  Source)
inline

Assignment from an object type that may natively implement InterfaceType

◆ operator==() [1/3]

UE_FORCEINLINE_HINT bool TScriptInterface< InInterfaceType >::operator== ( const OtherInterface Other) const
inline

Comparison operator, taking a pointer to InterfaceType

◆ operator==() [2/3]

Comparison operator, taking a reference to another TScriptInterface

◆ operator==() [3/3]

Comparison operator, taking a nullptr

◆ SetInterface()

UE_FORCEINLINE_HINT void TScriptInterface< InInterfaceType >::SetInterface ( InInterfaceType InInterfacePointer)
inline

Sets the value of the InterfacePointer for this TScriptInterface

◆ SetObject()

UE_FORCEINLINE_HINT void TScriptInterface< InInterfaceType >::SetObject ( UObjectType InObjectPointer)
inline

Sets the value of the ObjectPointer for this TScriptInterface

Friends And Related Symbol Documentation

◆ operator<<

FArchive & operator<< ( FArchive Ar,
TScriptInterface< InInterfaceType > &  Interface 
)
friend

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