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

#include <ScriptDelegates.h>

+ Inheritance diagram for TMulticastScriptDelegate< InThreadSafetyMode >:

Public Types

using ThreadSafetyMode = typename UE::Core::Private::TScriptDelegateTraits< InThreadSafetyMode >::ThreadSafetyMode
 
using InvocationListType = TArray< UnicastDelegateType >
 

Public Member Functions

 TMulticastScriptDelegate ()=default
 
 TMulticastScriptDelegate (const TMulticastScriptDelegate &Other)
 
TMulticastScriptDelegateoperator= (const TMulticastScriptDelegate &Other)
 
 TMulticastScriptDelegate (TMulticastScriptDelegate &&Other)
 
TMulticastScriptDelegateoperator= (TMulticastScriptDelegate &&Other)
 
bool IsBound () const
 
bool Contains (const TScriptDelegate< ThreadSafetyMode > &InDelegate) const
 
template<typename OtherThreadSafetyMode >
bool Contains (const TScriptDelegate< OtherThreadSafetyMode > &InDelegate) const
 
bool Contains (const UObject *InObject, FName InFunctionName) const
 
void Add (const TScriptDelegate< ThreadSafetyMode > &InDelegate)
 
template<typename OtherThreadSafetyMode >
void Add (const TScriptDelegate< OtherThreadSafetyMode > &InDelegate)
 
void AddUnique (const TScriptDelegate< ThreadSafetyMode > &InDelegate)
 
template<typename OtherThreadSafetyMode >
void AddUnique (const TScriptDelegate< OtherThreadSafetyMode > &InDelegate)
 
void Remove (const TScriptDelegate< ThreadSafetyMode > &InDelegate)
 
template<typename OtherThreadSafetyMode >
void Remove (const TScriptDelegate< OtherThreadSafetyMode > &InDelegate)
 
void Remove (const UObject *InObject, FName InFunctionName)
 
void RemoveAll (const UObject *Object)
 
void Clear ()
 
template<typename UObjectTemplate >
FString ToString () const
 
template<class UObjectTemplate >
void ProcessMulticastDelegate (void *Parameters) const
 
TArray< UObject * > GetAllObjects () const
 
TArray< UObject * > GetAllObjectsEvenIfUnreachable () const
 
TArray< typename UnicastDelegateType::WeakPtrType * > GetAllObjectRefsEvenIfUnreachable () const
 
SIZE_T GetAllocatedSize () const
 

Protected Member Functions

void AddInternal (UnicastDelegateType &&InDelegate)
 
void AddUniqueInternal (UnicastDelegateType &&InDelegate)
 
void RemoveInternal (const UnicastDelegateType &InDelegate) const
 
void RemoveInternal (const UObject *InObject, FName InFunctionName) const
 
void CompactInvocationList () const
 

Protected Attributes

InvocationListType InvocationList
 

Friends

class FMulticastDelegateProperty
 
class FMulticastInlineDelegateProperty
 
class FMulticastSparseDelegateProperty
 
class FCallDelegateHelper
 
struct TIsZeroConstructType< TMulticastScriptDelegate >
 
FArchiveoperator<< (FArchive &Ar, TMulticastScriptDelegate &D)
 
void operator<< (FStructuredArchive::FSlot Slot, TMulticastScriptDelegate &D)
 

Detailed Description

template<typename InThreadSafetyMode>
class TMulticastScriptDelegate< InThreadSafetyMode >

Script multi-cast delegate base class

Member Typedef Documentation

◆ InvocationListType

◆ ThreadSafetyMode

Constructor & Destructor Documentation

◆ TMulticastScriptDelegate() [1/3]

◆ TMulticastScriptDelegate() [2/3]

◆ TMulticastScriptDelegate() [3/3]

Member Function Documentation

◆ Add() [1/2]

◆ Add() [2/2]

Adds a function delegate to this multi-cast delegate's invocation list

Parameters
InDelegateDelegate to add

◆ AddInternal()

void TMulticastScriptDelegate< InThreadSafetyMode >::AddInternal ( UnicastDelegateType &&  InDelegate)
inlineprotected

Adds a function delegate to this multi-cast delegate's invocation list

Parameters
InDelegateDelegate to add

◆ AddUnique() [1/2]

◆ AddUnique() [2/2]

Adds a function delegate to this multi-cast delegate's invocation list if a delegate with the same signature doesn't already exist in the invocation list

Parameters
InDelegateDelegate to add

◆ AddUniqueInternal()

void TMulticastScriptDelegate< InThreadSafetyMode >::AddUniqueInternal ( UnicastDelegateType &&  InDelegate)
inlineprotected

Adds a function delegate to this multi-cast delegate's invocation list, if a delegate with that signature doesn't already exist

Parameters
InDelegateDelegate to add

◆ Clear()

Removes all functions from this delegate's invocation list

◆ CompactInvocationList()

void TMulticastScriptDelegate< InThreadSafetyMode >::CompactInvocationList ( ) const
inlineprotected

Cleans up any delegates in our invocation list that have expired (performance is O(N))

◆ Contains() [1/3]

◆ Contains() [2/3]

bool TMulticastScriptDelegate< InThreadSafetyMode >::Contains ( const TScriptDelegate< ThreadSafetyMode > &  InDelegate) const
inline

Checks whether a function delegate is already a member of this multi-cast delegate's invocation list

Parameters
InDelegateDelegate to check
Returns
True if the delegate is already in the list.

◆ Contains() [3/3]

bool TMulticastScriptDelegate< InThreadSafetyMode >::Contains ( const UObject InObject,
FName  InFunctionName 
) const
inline

Checks whether a function delegate is already a member of this multi-cast delegate's invocation list

Parameters
InObjectObject of the delegate to check
InFunctionNameFunction name of the delegate to check
Returns
True if the delegate is already in the list.

◆ GetAllObjectRefsEvenIfUnreachable()

TArray< typename UnicastDelegateType::WeakPtrType * > TMulticastScriptDelegate< InThreadSafetyMode >::GetAllObjectRefsEvenIfUnreachable ( ) const
inline

◆ GetAllObjects()

TArray< UObject * > TMulticastScriptDelegate< InThreadSafetyMode >::GetAllObjects ( ) const
inline

Returns all objects associated with this multicast-delegate. For advanced uses only – you should never need call this function in normal circumstances.

Returns
List of objects bound to this delegate

◆ GetAllObjectsEvenIfUnreachable()

TArray< UObject * > TMulticastScriptDelegate< InThreadSafetyMode >::GetAllObjectsEvenIfUnreachable ( ) const
inline

Returns all objects associated with this multicast-delegate, even if unreachable. For advanced uses only – you should never need call this function in normal circumstances.

Returns
List of objects bound to this delegate

◆ GetAllocatedSize()

SIZE_T TMulticastScriptDelegate< InThreadSafetyMode >::GetAllocatedSize ( ) const
inline

Returns the amount of memory allocated by this delegate's invocation list, not including sizeof(*this).

◆ IsBound()

Checks to see if any functions are bound to this multi-cast delegate

Returns
True if any functions are bound

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ ProcessMulticastDelegate()

template<class UObjectTemplate >
void TMulticastScriptDelegate< InThreadSafetyMode >::ProcessMulticastDelegate ( void Parameters) const
inline

Executes a multi-cast delegate by calling all functions on objects bound to the delegate. Always safe to call, even if when no objects are bound, or if objects have expired. In general, you should never call this function directly. Instead, call Broadcast() on a derived class. Note that this function is not truly const because it will clean up any compactable entries in the invocation list.

Parameters
ParamsParameter structure

◆ Remove() [1/3]

◆ Remove() [2/3]

Removes a function from this multi-cast delegate's invocation list (performance is O(N)). Note that the order of the delegates may not be preserved!

Parameters
InDelegateDelegate to remove

◆ Remove() [3/3]

void TMulticastScriptDelegate< InThreadSafetyMode >::Remove ( const UObject InObject,
FName  InFunctionName 
)
inline

Removes a function from this multi-cast delegate's invocation list (performance is O(N)). Note that the order of the delegates may not be preserved!

Parameters
InObjectObject of the delegate to remove
InFunctionNameFunction name of the delegate to remove

◆ RemoveAll()

void TMulticastScriptDelegate< InThreadSafetyMode >::RemoveAll ( const UObject Object)
inline

Removes all delegate bindings from this multicast delegate's invocation list that are bound to the specified object.

This method also compacts the invocation list.

Parameters
InObjectThe object to remove bindings for.

◆ RemoveInternal() [1/2]

void TMulticastScriptDelegate< InThreadSafetyMode >::RemoveInternal ( const UnicastDelegateType InDelegate) const
inlineprotected

Removes a function from this multi-cast delegate's invocation list (performance is O(N)). Note that the order of the delegates may not be preserved!

Parameters
InDelegateDelegate to remove

◆ RemoveInternal() [2/2]

void TMulticastScriptDelegate< InThreadSafetyMode >::RemoveInternal ( const UObject InObject,
FName  InFunctionName 
) const
inlineprotected

Removes a function from this multi-cast delegate's invocation list (performance is O(N)). Note that the order of the delegates may not be preserved!

Parameters
InObjectObject of the delegate to remove
InFunctionNameFunction name of the delegate to remove

◆ ToString()

FString TMulticastScriptDelegate< InThreadSafetyMode >::ToString ( ) const
inline

Converts this delegate to a string representation

Returns
Delegate in string format

Friends And Related Symbol Documentation

◆ FCallDelegateHelper

◆ FMulticastDelegateProperty

◆ FMulticastInlineDelegateProperty

◆ FMulticastSparseDelegateProperty

◆ operator<< [1/2]

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

Multi-cast delegate serialization

◆ operator<< [2/2]

◆ TIsZeroConstructType< TMulticastScriptDelegate >

Member Data Documentation

◆ InvocationList

Ordered list functions to invoke when the Broadcast function is called


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