UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass > Struct Template Reference

#include <SparseDelegate.h>

+ Inheritance diagram for TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >:

Public Types

typedef MulticastDelegate::FDelegate FDelegate
 

Public Member Functions

TSharedPtr< MulticastDelegate > GetShared () const
 
bool Contains (const FScriptDelegate &InDelegate) const
 
bool Contains (const UObject *InObject, FName InFunctionName) const
 
void Add (FScriptDelegate InDelegate)
 
void AddUnique (FScriptDelegate InDelegate)
 
void Remove (const FScriptDelegate &InDelegate)
 
void Remove (const UObject *InObject, FName InFunctionName)
 
void RemoveAll (const UObject *Object)
 
void Clear ()
 
template<typename... ParamTypes>
void Broadcast (ParamTypes... Params)
 
template<class UserClass >
bool __Internal_IsAlreadyBound (UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName) const
 
template<class UserClass >
void __Internal_AddDynamic (UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName)
 
template<class UserClass >
void __Internal_AddUniqueDynamic (UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName)
 
template<class UserClass >
void __Internal_RemoveDynamic (UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName)
 
- Public Member Functions inherited from FSparseDelegate
 FSparseDelegate ()
 
bool IsBound () const
 
void __Internal_AddUnique (const UObject *DelegateOwner, FName DelegateName, FScriptDelegate InDelegate)
 
void __Internal_Remove (const UObject *DelegateOwner, FName DelegateName, const FScriptDelegate &InDelegate)
 
void __Internal_Clear (const UObject *DelegateOwner, FName DelegateName)
 

Protected Member Functions

FName GetDelegateName () const
 

Additional Inherited Members

- Protected Attributes inherited from FSparseDelegate
bool bIsBound
 

Detailed Description

template<typename MulticastDelegate, typename OwningClass, typename DelegateInfoClass>
struct TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >

Sparse version of TBaseDynamicDelegate

Member Typedef Documentation

◆ FDelegate

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
typedef MulticastDelegate::FDelegate TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::FDelegate

Member Function Documentation

◆ __Internal_AddDynamic()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
template<class UserClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::__Internal_AddDynamic ( UserClass *  InUserObject,
typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr  InMethodPtr,
FName  InFunctionName 
)
inline

Binds a UObject instance and a UObject method address to this multi-cast delegate.

Parameters
InUserObjectUObject instance
InMethodPtrMember function address pointer
InFunctionNameName of member function, without class name

NOTE: Do not call this function directly. Instead, call AddDynamic() which is a macro proxy function that automatically sets the function name string for the caller.

◆ __Internal_AddUniqueDynamic()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
template<class UserClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::__Internal_AddUniqueDynamic ( UserClass *  InUserObject,
typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr  InMethodPtr,
FName  InFunctionName 
)
inline

Binds a UObject instance and a UObject method address to this multi-cast delegate, but only if it hasn't been bound before.

Parameters
InUserObjectUObject instance
InMethodPtrMember function address pointer
InFunctionNameName of member function, without class name

NOTE: Do not call this function directly. Instead, call AddUniqueDynamic() which is a macro proxy function that automatically sets the function name string for the caller.

◆ __Internal_IsAlreadyBound()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
template<class UserClass >
bool TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::__Internal_IsAlreadyBound ( UserClass *  InUserObject,
typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr  InMethodPtr,
FName  InFunctionName 
) const
inline

Tests if a UObject instance and a UObject method address pair are already bound to this multi-cast delegate.

Parameters
InUserObjectUObject instance
InMethodPtrMember function address pointer
InFunctionNameName of member function, without class name
Returns
True if the instance/method is already bound.

NOTE: Do not call this function directly. Instead, call IsAlreadyBound() which is a macro proxy function that automatically sets the function name string for the caller.

◆ __Internal_RemoveDynamic()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
template<class UserClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::__Internal_RemoveDynamic ( UserClass *  InUserObject,
typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr  InMethodPtr,
FName  InFunctionName 
)
inline

Unbinds a UObject instance and a UObject method address from this multi-cast delegate.

Parameters
InUserObjectUObject instance
InMethodPtrMember function address pointer
InFunctionNameName of member function, without class name

NOTE: Do not call this function directly. Instead, call RemoveDynamic() which is a macro proxy function that automatically sets the function name string for the caller.

◆ Add()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::Add ( FScriptDelegate  InDelegate)
inline

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

Parameters
InDelegateDelegate to add

◆ AddUnique()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::AddUnique ( FScriptDelegate  InDelegate)
inline

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

◆ Broadcast()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
template<typename... ParamTypes>
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::Broadcast ( ParamTypes...  Params)
inline

Broadcasts this delegate to all bound objects, except to those that may have expired.

◆ Clear()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::Clear ( )
inline

Removes all functions from this delegate's invocation list

◆ Contains() [1/2]

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
bool TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::Contains ( const FScriptDelegate 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() [2/2]

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
bool TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::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.

◆ GetDelegateName()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
FName TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::GetDelegateName ( ) const
inlineprotected

◆ GetShared()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
TSharedPtr< MulticastDelegate > TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::GetShared ( ) const
inline

Returns the multicast delegate if any delegates are bound to the sparse delegate

◆ Remove() [1/2]

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::Remove ( const FScriptDelegate InDelegate)
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
InDelegateDelegate to remove

◆ Remove() [2/2]

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::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()

template<typename MulticastDelegate , typename OwningClass , typename DelegateInfoClass >
void TSparseDynamicDelegate< MulticastDelegate, OwningClass, DelegateInfoClass >::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.

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