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

#include <ScriptDelegates.h>

+ Inheritance diagram for TScriptDelegate< InThreadSafetyMode >:

Public Types

using ThreadSafetyMode = typename UE::Core::Private::TScriptDelegateTraits< InThreadSafetyMode >::ThreadSafetyMode
 
using WeakPtrType = typename UE::Core::Private::TScriptDelegateTraits< InThreadSafetyMode >::WeakPtrType
 

Public Member Functions

 TScriptDelegate ()
 
 TScriptDelegate (const TScriptDelegate &Other)
 
template<typename OtherThreadSafetyMode >
 TScriptDelegate (const TScriptDelegate< OtherThreadSafetyMode > &Other)
 
TScriptDelegateoperator= (const TScriptDelegate &Other)
 
template<typename OtherThreadSafetyMode >
TScriptDelegateoperator= (const TScriptDelegate< OtherThreadSafetyMode > &Other)
 
void BindUFunction (UObject *InObject, const FName &InFunctionName)
 
bool IsBound () const
 
bool IsBoundToObject (void const *InUserObject) const
 
bool IsBoundToObjectEvenIfUnreachable (void const *InUserObject) const
 
bool IsCompactable () const
 
void Unbind ()
 
void Clear ()
 
template<class UObjectTemplate >
FString ToString () const
 
bool operator== (const TScriptDelegate &Other) const
 
template<typename OtherThreadSafetyMode >
bool operator== (const TScriptDelegate< OtherThreadSafetyMode > &Other) const
 
UE_FORCEINLINE_HINT bool operator!= (const TScriptDelegate &Other) const
 
template<typename OtherThreadSafetyMode >
UE_FORCEINLINE_HINT bool operator!= (const TScriptDelegate< OtherThreadSafetyMode > &Other) const
 
UObjectGetUObject ()
 
const UObjectGetUObject () const
 
UObjectGetUObjectEvenIfUnreachable ()
 
const UObjectGetUObjectEvenIfUnreachable () const
 
WeakPtrTypeGetUObjectRef ()
 
const WeakPtrTypeGetUObjectRef () const
 
FName GetFunctionName () const
 
template<class UObjectTemplate >
void ProcessDelegate (void *Parameters) const
 

Static Public Member Functions

template<typename OtherThreadSafetyMode >
static TScriptDelegate CopyFrom (const TScriptDelegate< OtherThreadSafetyMode > &Other)
 

Protected Attributes

WeakPtrType Object
 
FName FunctionName
 

Friends

template<typename >
class TScriptDelegate
 
template<typename >
class TMulticastScriptDelegate
 
class FCallDelegateHelper
 
struct TIsZeroConstructType< TScriptDelegate >
 
FArchiveoperator<< (FArchive &Ar, TScriptDelegate &D)
 
void operator<< (FStructuredArchive::FSlot Slot, TScriptDelegate &D)
 
uint32 GetTypeHash (const TScriptDelegate &Delegate)
 

Detailed Description

template<typename InThreadSafetyMode>
class TScriptDelegate< InThreadSafetyMode >

Script delegate base class.

Member Typedef Documentation

◆ ThreadSafetyMode

◆ WeakPtrType

Constructor & Destructor Documentation

◆ TScriptDelegate() [1/3]

Default constructor.

◆ TScriptDelegate() [2/3]

◆ TScriptDelegate() [3/3]

Member Function Documentation

◆ BindUFunction()

void TScriptDelegate< InThreadSafetyMode >::BindUFunction ( UObject InObject,
const FName InFunctionName 
)
inline

Binds a UFunction to this delegate.

Parameters
InObjectThe object to call the function on.
InFunctionNameThe name of the function to call.

◆ Clear()

Unbinds this delegate (another name to provide a similar interface to TMulticastScriptDelegate)

◆ CopyFrom()

◆ GetFunctionName()

FName TScriptDelegate< InThreadSafetyMode >::GetFunctionName ( ) const
inline

Gets the name of the function to call on the bound object

Returns
Function name

◆ GetUObject() [1/2]

UObject * TScriptDelegate< InThreadSafetyMode >::GetUObject ( )
inline

Gets the object bound to this delegate

Returns
The object

◆ GetUObject() [2/2]

const UObject * TScriptDelegate< InThreadSafetyMode >::GetUObject ( ) const
inline

Gets the object bound to this delegate (const)

Returns
The object

◆ GetUObjectEvenIfUnreachable() [1/2]

UObject * TScriptDelegate< InThreadSafetyMode >::GetUObjectEvenIfUnreachable ( )
inline

Gets the object bound to this delegate, even if the object is unreachable

Returns
The object

◆ GetUObjectEvenIfUnreachable() [2/2]

const UObject * TScriptDelegate< InThreadSafetyMode >::GetUObjectEvenIfUnreachable ( ) const
inline

Gets the object bound to this delegate (const), even if the object is unreachable

Returns
The object

◆ GetUObjectRef() [1/2]

WeakPtrType & TScriptDelegate< InThreadSafetyMode >::GetUObjectRef ( )
inline

◆ GetUObjectRef() [2/2]

const WeakPtrType & TScriptDelegate< InThreadSafetyMode >::GetUObjectRef ( ) const
inline

◆ IsBound()

bool TScriptDelegate< InThreadSafetyMode >::IsBound ( ) const
inline

Checks to see if the user object bound to this delegate is still valid

Returns
True if the object is still valid and it's safe to execute the function call

◆ IsBoundToObject()

bool TScriptDelegate< InThreadSafetyMode >::IsBoundToObject ( void const *  InUserObject) const
inline

Checks to see if this delegate is bound to the given user object.

Returns
True if this delegate is bound to InUserObject, false otherwise.

◆ IsBoundToObjectEvenIfUnreachable()

bool TScriptDelegate< InThreadSafetyMode >::IsBoundToObjectEvenIfUnreachable ( void const *  InUserObject) const
inline

Checks to see if this delegate is bound to the given user object, even if the object is unreachable.

Returns
True if this delegate is bound to InUserObject, false otherwise.

◆ IsCompactable()

bool TScriptDelegate< InThreadSafetyMode >::IsCompactable ( ) const
inline

Checks to see if the user object bound to this delegate will ever be valid again

Returns
True if the object is still valid and it's safe to execute the function call

◆ operator!=() [1/2]

◆ operator!=() [2/2]

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ operator==() [1/2]

bool TScriptDelegate< InThreadSafetyMode >::operator== ( const TScriptDelegate< InThreadSafetyMode > &  Other) const
inline

Comparison operators

◆ operator==() [2/2]

◆ ProcessDelegate()

template<class UObjectTemplate >
void TScriptDelegate< InThreadSafetyMode >::ProcessDelegate ( void Parameters) const
inline

Executes a delegate by calling the named function on the object bound to the delegate. You should always first verify that the delegate is safe to execute by calling IsBound() before calling this function. In general, you should never call this function directly. Instead, call Execute() on a derived class.

Parameters
ParametersParameter structure

◆ ToString()

template<class UObjectTemplate >
FString TScriptDelegate< InThreadSafetyMode >::ToString ( ) const
inline

Converts this delegate to a string representation

Returns
Delegate in string format

◆ Unbind()

Unbinds this delegate

Friends And Related Symbol Documentation

◆ FCallDelegateHelper

◆ GetTypeHash

uint32 GetTypeHash ( const TScriptDelegate< InThreadSafetyMode > &  Delegate)
friend

◆ operator<< [1/2]

FArchive & operator<< ( FArchive Ar,
TScriptDelegate< InThreadSafetyMode > &  D 
)
friend

Delegate serialization

◆ operator<< [2/2]

void operator<< ( FStructuredArchive::FSlot  Slot,
TScriptDelegate< InThreadSafetyMode > &  D 
)
friend

Delegate serialization

◆ TIsZeroConstructType< TScriptDelegate >

◆ TMulticastScriptDelegate

◆ TScriptDelegate

template<typename >
friend class TScriptDelegate
friend

Member Data Documentation

◆ FunctionName

FName TScriptDelegate< InThreadSafetyMode >::FunctionName
protected

Name of the function to call on the bound object

◆ Object

The object bound to this delegate, or nullptr if no object is bound


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