5#include "Containers/Array.h"
6#include "Containers/Map.h"
86 virtual ~FObjectListener();
88 virtual void OnUObjectArrayShutdown();
89 void EnableListener();
90 void DisableListener();
92 virtual SIZE_T GetAllocatedSize()
const override
196template <
typename MulticastDelegate,
typename OwningClass,
typename DelegateInfoClass>
200 typedef typename MulticastDelegate::FDelegate
FDelegate;
210 UObject* GetDelegateOwner()
const
328 template<
typename... ParamTypes>
348 template<
class UserClass >
368 template<
class UserClass >
378 this->
Add( NewDelegate );
391 template<
class UserClass >
414 template<
class UserClass >
431#define FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE(SparseDelegateClassName, OwningClass, DelegateName, FuncParamList, FuncParamPassThru, ...) \
432 FUNC_DECLARE_DYNAMIC_MULTICAST_DELEGATE(SparseDelegateClassName##_MCSignature, SparseDelegateClassName##_DelegateWrapper, FUNC_CONCAT(FuncParamList), FUNC_CONCAT(FuncParamPassThru), __VA_ARGS__) \
433 struct SparseDelegateClassName##InfoGetter \
435 static const char* GetDelegateName() { return #DelegateName; } \
436 template<typename T> \
437 static size_t GetDelegateOffset() { return offsetof(T, DelegateName); } \
439 struct SparseDelegateClassName : public TSparseDynamicDelegate<SparseDelegateClassName##_MCSignature, OwningClass, SparseDelegateClassName##InfoGetter> \
444#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, , FUNC_CONCAT( *this ), void )
446#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_OneParam( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1 ), FUNC_CONCAT( *this, InParam1 ), void, Param1Type )
447#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_TwoParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2 ), FUNC_CONCAT( *this, InParam1, InParam2 ), void, Param1Type, Param2Type )
448#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_ThreeParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3 ), void, Param1Type, Param2Type, Param3Type )
449#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FourParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3, Param4Type InParam4 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3, InParam4 ), void, Param1Type, Param2Type, Param3Type, Param4Type )
450#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FiveParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3, Param4Type InParam4, Param5Type InParam5 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3, InParam4, InParam5 ), void, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type )
451#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SixParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name, Param6Type, Param6Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3, Param4Type InParam4, Param5Type InParam5, Param6Type InParam6 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3, InParam4, InParam5, InParam6 ), void, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type, Param6Type )
452#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SevenParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name, Param6Type, Param6Name, Param7Type, Param7Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3, Param4Type InParam4, Param5Type InParam5, Param6Type InParam6, Param7Type InParam7 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3, InParam4, InParam5, InParam6, InParam7 ), void, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type, Param6Type, Param7Type )
453#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_EightParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name, Param6Type, Param6Name, Param7Type, Param7Name, Param8Type, Param8Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3, Param4Type InParam4, Param5Type InParam5, Param6Type InParam6, Param7Type InParam7, Param8Type InParam8 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3, InParam4, InParam5, InParam6, InParam7, InParam8 ), void, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type, Param6Type, Param7Type, Param8Type )
454#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_NineParams( SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name, Param6Type, Param6Name, Param7Type, Param7Name, Param8Type, Param8Name, Param9Type, Param9Name ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE( SparseDelegateClass, OwningClass, DelegateName, FUNC_CONCAT( Param1Type InParam1, Param2Type InParam2, Param3Type InParam3, Param4Type InParam4, Param5Type InParam5, Param6Type InParam6, Param7Type InParam7, Param8Type InParam8, Param9Type InParam9 ), FUNC_CONCAT( *this, InParam1, InParam2, InParam3, InParam4, InParam5, InParam6, InParam7, InParam8, InParam9 ), void, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type, Param6Type, Param7Type, Param8Type, Param9Type )
#define check(expr)
Definition AssertionMacros.h:314
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
::FCriticalSection FTransactionallySafeCriticalSection
Definition TransactionallySafeCriticalSection.h:16
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition UnrealType.h:6643
Definition NameTypes.h:617
Definition OutputDevice.h:133
Definition UObjectArray.h:984
Definition UnrealString.h.inl:34
Definition ScriptDelegates.h:509
Definition ScriptDelegates.h:66
Definition SharedPointer.h:692
Definition UObjectBase.h:59
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition SparseDelegate.h:38
static COREUOBJECT_API TSharedPtr< FMulticastScriptDelegate > GetSharedMulticastDelegate(const UObject *DelegateOwner, const FName DelegateName)
Definition SparseDelegate.cpp:99
static COREUOBJECT_API void SparseDelegateReport(const TArray< FString > &, UWorld *, FOutputDevice &)
Definition SparseDelegate.cpp:360
static COREUOBJECT_API FSparseDelegate * ResolveSparseDelegate(const UObject *OwningObject, FName DelegateName)
Definition SparseDelegate.cpp:56
static COREUOBJECT_API FMulticastScriptDelegate * GetMulticastDelegate(const UObject *DelegateOwner, const FName DelegateName)
Definition SparseDelegate.cpp:85
static COREUOBJECT_API bool Remove(const UObject *DelegateOwner, const FName DelegateName, const FScriptDelegate &Delegate)
Definition SparseDelegate.cpp:223
static COREUOBJECT_API void RegisterDelegateOffset(const UObject *OwningObject, FName DelegateName, size_t OffsetToOwner)
Definition SparseDelegate.cpp:50
static COREUOBJECT_API void Clear(const UObject *DelegateOwner, const FName DelegateName)
Definition SparseDelegate.cpp:330
static COREUOBJECT_API bool Add(const UObject *DelegateOwner, const FName DelegateName, FScriptDelegate Delegate)
Definition SparseDelegate.cpp:134
static COREUOBJECT_API bool AddUnique(const UObject *DelegateOwner, const FName DelegateName, FScriptDelegate Delegate)
Definition SparseDelegate.cpp:160
friend struct FObjectListener
Definition SparseDelegate.h:99
static COREUOBJECT_API bool RemoveAll(const UObject *DelegateOwner, const FName DelegateName, const UObject *UserObject)
Definition SparseDelegate.cpp:295
static COREUOBJECT_API bool Contains(const UObject *DelegateOwner, const FName DelegateName, const FScriptDelegate &Delegate)
Definition SparseDelegate.cpp:186
static COREUOBJECT_API UObject * ResolveSparseOwner(const FSparseDelegate &SparseDelegate, const FName OwningClassName, const FName DelegateName)
Definition SparseDelegate.cpp:75
static COREUOBJECT_API void SetMulticastDelegate(const UObject *DelegateOwner, const FName DelegateName, FMulticastScriptDelegate Delegate)
Definition SparseDelegate.cpp:114
Definition SparseDelegate.h:119
FSparseDelegate()
Definition SparseDelegate.h:121
bool bIsBound
Definition SparseDelegate.h:192
void __Internal_Clear(const UObject *DelegateOwner, FName DelegateName)
Definition SparseDelegate.h:180
void __Internal_AddUnique(const UObject *DelegateOwner, FName DelegateName, FScriptDelegate InDelegate)
Definition SparseDelegate.h:147
void __Internal_Remove(const UObject *DelegateOwner, FName DelegateName, const FScriptDelegate &InDelegate)
Definition SparseDelegate.h:163
bool IsBound() const
Definition SparseDelegate.h:131
Definition SparseDelegate.h:198
TSharedPtr< MulticastDelegate > GetShared() const
Definition SparseDelegate.h:221
void Remove(const FScriptDelegate &InDelegate)
Definition SparseDelegate.h:281
FName GetDelegateName() const
Definition SparseDelegate.h:203
void __Internal_AddDynamic(UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName)
Definition SparseDelegate.h:369
void __Internal_RemoveDynamic(UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName)
Definition SparseDelegate.h:415
void Clear()
Definition SparseDelegate.h:320
MulticastDelegate::FDelegate FDelegate
Definition SparseDelegate.h:200
void RemoveAll(const UObject *Object)
Definition SparseDelegate.h:309
bool __Internal_IsAlreadyBound(UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName) const
Definition SparseDelegate.h:349
bool Contains(const FScriptDelegate &InDelegate) const
Definition SparseDelegate.h:237
void AddUnique(FScriptDelegate InDelegate)
Definition SparseDelegate.h:270
void Add(FScriptDelegate InDelegate)
Definition SparseDelegate.h:259
bool Contains(const UObject *InObject, FName InFunctionName) const
Definition SparseDelegate.h:249
void __Internal_AddUniqueDynamic(UserClass *InUserObject, typename FDelegate::template TMethodPtrResolver< UserClass >::FMethodPtr InMethodPtr, FName InFunctionName)
Definition SparseDelegate.h:392
void Remove(const UObject *InObject, FName InFunctionName)
Definition SparseDelegate.h:293
void Broadcast(ParamTypes... Params)
Definition SparseDelegate.h:329