UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ScriptDelegates.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
8#include "PropertyPortFlags.h"
12#include "Templates/TypeHash.h"
14#include "UObject/NameTypes.h"
15
16namespace UE::Core::Private
17{
18 template <typename InThreadSafetyMode>
20 {
21 // Although templated, WeakPtrType is not intended to be anything other than FWeakObjectPtr,
22 // and is only a template for module organization reasons.
24
27 };
28
29 template <>
30 struct UE_DEPRECATED(5.3, "TScriptDelegate<FWeakObjectPtr> and TMulticastScriptDelegate<FWeakObjectPtr> have been deprecated, please use FScriptDelegate or FMulticastScriptDelegate respectively.") TScriptDelegateTraits<FWeakObjectPtr>
31 {
32 // After this deprecated specialization has been removed, all of the functions inside
33 // TMulticastScriptDelegate which take OtherDummy parameters should also be removed,
34 // and also the TScriptDelegate(const TScriptDelegate<FWeakObjectPtr>&) constructor.
35
36 using WeakPtrType = FWeakObjectPtr;
37 using ThreadSafetyMode = FNotThreadSafeDelegateMode;
38 using UnicastThreadSafetyModeForMulticasts = FNotThreadSafeNotCheckedDelegateMode;
39 };
40
41 // This function only exists to allow compatibility between multicast and unicast delegate types which use an explicit FWeakObjectPtr template parameter
42 template <typename From, typename To>
43 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
44 inline constexpr bool BackwardCompatibilityCheck()
45 {
46 if constexpr (std::is_same_v<From, FNotThreadSafeDelegateMode>)
47 {
48 return std::is_same_v<To, FWeakObjectPtr>;
49 }
50 else if constexpr (std::is_same_v<From, FWeakObjectPtr>)
51 {
52 return std::is_same_v<To, FNotThreadSafeDelegateMode>;
53 }
54 else
55 {
56 return false;
57 }
58 }
59}
60
64template <typename InThreadSafetyMode>
65class TScriptDelegate : public TDelegateAccessHandlerBase<typename UE::Core::Private::TScriptDelegateTraits<InThreadSafetyMode>::ThreadSafetyMode>
66{
67public:
70
71private:
72 template <typename>
73 friend class TScriptDelegate;
74
75 template<typename>
77
79 using typename Super::FReadAccessScope;
80 using Super::GetReadAccessScope;
81 using typename Super::FWriteAccessScope;
82 using Super::GetWriteAccessScope;
83
84public:
87 : Object( nullptr )
89 { }
90
92 {
93 FReadAccessScope OtherReadScope = Other.GetReadAccessScope();
94
95 Object = Other.Object;
96 FunctionName = Other.FunctionName;
97 }
98
99 template <
100 typename OtherThreadSafetyMode
101 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
102 >
103 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
111
113 {
116
117 {
118 FReadAccessScope OtherReadScope = Other.GetReadAccessScope();
119 OtherObject = Other.Object;
120 OtherFunctionName = Other.FunctionName;
121 }
122
123 {
124 FWriteAccessScope WriteScope = GetWriteAccessScope();
127 }
128
129 return *this;
130 }
131 template <
132 typename OtherThreadSafetyMode
133 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
134 >
135 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
137 {
140
141 {
144 OtherFunctionName = Other.FunctionName;
145 }
146
147 {
148 FWriteAccessScope WriteScope = GetWriteAccessScope();
151 }
152
153 return *this;
154 }
155
156private:
157
158 template <class UObjectTemplate>
159 inline bool IsBound_Internal() const
160 {
161 if (FunctionName != NAME_None)
162 {
163 if (UObject* ObjectPtr = Object.Get())
164 {
165 return ((UObjectTemplate*)ObjectPtr)->FindFunction(FunctionName) != nullptr;
166 }
167 }
168
169 return false;
170 }
171
172public:
173
180 void BindUFunction( UObject* InObject, const FName& InFunctionName )
181 {
182 FWriteAccessScope WriteScope = GetWriteAccessScope();
183
184 Object = InObject;
186 }
187
193 inline bool IsBound() const
194 {
195 FReadAccessScope ReadScope = GetReadAccessScope();
197 }
198
204 inline bool IsBoundToObject(void const* InUserObject) const
205 {
206 FReadAccessScope ReadScope = GetReadAccessScope();
207 return InUserObject && (InUserObject == GetUObject());
208 }
209
216 {
217 FReadAccessScope ReadScope = GetReadAccessScope();
219 }
220
226 inline bool IsCompactable() const
227 {
228 FReadAccessScope ReadScope = GetReadAccessScope();
229 return FunctionName == NAME_None ||
230#if UE_WITH_REMOTE_OBJECT_HANDLE
231 !Object.IsValid(true);
232#else
233 !Object.Get(true);
234#endif
235 }
236
240 void Unbind()
241 {
242 FWriteAccessScope WriteScope = GetWriteAccessScope();
243
244 Object = nullptr;
246 }
247
251 void Clear()
252 {
253 Unbind();
254 }
255
261 template <class UObjectTemplate>
262 inline FString ToString() const
263 {
264 if( IsBound() )
265 {
266 FReadAccessScope ReadScope = GetReadAccessScope();
267 return ((UObjectTemplate*)GetUObject())->GetPathName() + TEXT(".") + GetFunctionName().ToString();
268 }
269 return TEXT( "<Unbound>" );
270 }
271
274 {
275 FReadAccessScope ReadScope = D.GetReadAccessScope();
276
277 Ar << D.Object << D.FunctionName;
278 return Ar;
279 }
280
283 {
284 FReadAccessScope ReadScope = D.GetReadAccessScope();
285
287 Record << SA_VALUE(TEXT("Object"), D.Object) << SA_VALUE(TEXT("FunctionName"),D.FunctionName);
288 }
289
291 inline bool operator==( const TScriptDelegate& Other ) const
292 {
295
296 {
297 FReadAccessScope OtherReadScope = Other.GetReadAccessScope();
298 OtherObject = Other.Object;
299 OtherFunctionName = Other.FunctionName;
300 }
301
302 bool bResult;
303
304 {
305 FReadAccessScope ThisReadScope = GetReadAccessScope();
307 }
308
309 return bResult;
310 }
311 template <
312 typename OtherThreadSafetyMode
313 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
314 >
315 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
317 {
320
321 {
324 OtherFunctionName = Other.FunctionName;
325 }
326
327 bool bResult;
328
329 {
330 FReadAccessScope ThisReadScope = GetReadAccessScope();
332 }
333
334 return bResult;
335 }
336
338 {
339 return !operator==(Other);
340 }
341 template <
342 typename OtherThreadSafetyMode
343 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
344 >
345 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
350
357 {
358 FWriteAccessScope WriteScope = GetWriteAccessScope();
359
360 // Downcast UObjectBase to UObject
361 return static_cast< UObject* >( Object.Get() );
362 }
363
369 const UObject* GetUObject() const
370 {
371 FReadAccessScope ReadScope = GetReadAccessScope();
372
373 // Downcast UObjectBase to UObject
374 return static_cast< const UObject* >( Object.Get() );
375 }
376
383 {
384 FWriteAccessScope WriteScope = GetWriteAccessScope();
385
386 // Downcast UObjectBase to UObject
387 return static_cast< UObject* >( Object.GetEvenIfUnreachable() );
388 }
389
396 {
397 FReadAccessScope ReadScope = GetReadAccessScope();
398
399 // Downcast UObjectBase to UObject
400 return static_cast< const UObject* >( Object.GetEvenIfUnreachable() );
401 }
402
404 {
405 return Object;
406 }
407
409 {
410 return Object;
411 }
412
419 {
420 FReadAccessScope ReadScope = GetReadAccessScope();
421 return FunctionName;
422 }
423
431 //CORE_API void ProcessDelegate(void* Parameters) const;
432 template <class UObjectTemplate>
433 void ProcessDelegate( void* Parameters ) const
434 {
435 UObjectTemplate* ObjectPtr;
437
438 { // to avoid MT access check if the delegate is deleted from inside of its callback, we don't cover the callback execution
439 // by access protection scope
440 // the `const` on the method is a lie
441 FWriteAccessScope WriteScope = const_cast<TScriptDelegate*>(this)->GetWriteAccessScope();
442
443 checkf( Object.IsValid() != false, TEXT( "ProcessDelegate() called with no object bound to delegate!" ) );
444 checkf( FunctionName != NAME_None, TEXT( "ProcessDelegate() called with no function name set!" ) );
445
446 // Object was pending kill, so we cannot execute the delegate. Note that it's important to assert
447 // here and not simply continue execution, as memory may be left uninitialized if the delegate is
448 // not able to execute, resulting in much harder-to-detect code errors. Users should always make
449 // sure IsBound() returns true before calling ProcessDelegate()!
450 ObjectPtr = static_cast<UObjectTemplate*>(Object.Get()); // Down-cast
451 checkSlow( IsValid(ObjectPtr) );
452
453 // Object *must* implement the specified function
454 Function = ObjectPtr->FindFunctionChecked(FunctionName);
455 }
456
457 // Execute the delegate!
458 ObjectPtr->ProcessEvent(Function, Parameters);
459 }
460
461 [[nodiscard]] friend uint32 GetTypeHash(const TScriptDelegate& Delegate)
462 {
463 FReadAccessScope ReadScope = Delegate.GetReadAccessScope();
464
465 return HashCombine(GetTypeHash(Delegate.Object), GetTypeHash(Delegate.GetFunctionName()));
466 }
467
468 template<typename OtherThreadSafetyMode>
470 {
471 static_assert(std::is_same_v<ThreadSafetyMode, typename UE::Core::Private::TScriptDelegateTraits<ThreadSafetyMode>::UnicastThreadSafetyModeForMulticasts>);
472
474
476 Copy.Object = Other.Object;
477 Copy.FunctionName = Other.FunctionName;
478
479 return Copy;
480 }
481
482protected:
483
486
489
490 //
492
494};
495
496template<typename ThreadSafetyMode>
503
507template <typename InThreadSafetyMode>
508class TMulticastScriptDelegate : public TDelegateAccessHandlerBase<typename UE::Core::Private::TScriptDelegateTraits<InThreadSafetyMode>::ThreadSafetyMode>
509{
510private:
512 using typename Super::FReadAccessScope;
513 using Super::GetReadAccessScope;
514 using typename Super::FWriteAccessScope;
515 using Super::GetWriteAccessScope;
516
518
519public:
522
524
526 {
528
529 {
530 FReadAccessScope OtherReadScope = Other.GetReadAccessScope();
531 LocalCopy = Other.InvocationList;
532 }
533
535 }
536
538 {
540 {
541 FReadAccessScope OtherReadScope = Other.GetReadAccessScope();
542 LocalCopy = Other.InvocationList;
543 }
544
545 {
546 FWriteAccessScope WriteScope = GetWriteAccessScope();
548 }
549
550 return *this;
551 }
552
564
566 {
568
569 {
570 FReadAccessScope OtherReadScope = Other.GetReadAccessScope();
571 LocalStorage = MoveTemp(Other.InvocationList);
572 }
573
574 {
575 FWriteAccessScope WriteScope = GetWriteAccessScope();
577 }
578
579 return *this;
580 }
581
582public:
583
589 inline bool IsBound() const
590 {
591 FReadAccessScope ReadScope = GetReadAccessScope();
592
593 return InvocationList.Num() > 0;
594 }
595
603 {
604 const UObject* Object;
605 FName FunctionName;
606
607 {
608 FReadAccessScope OtherReadScope = InDelegate.GetReadAccessScope();
609 Object = InDelegate.Object.Get();
610 FunctionName = InDelegate.FunctionName;
611 }
612
613 return Contains(Object, FunctionName);
614 }
615 template <
616 typename OtherThreadSafetyMode
617 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
618 >
619 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
621 {
622 const UObject* Object;
623 FName FunctionName;
624
625 {
627 Object = InDelegate.Object.Get();
628 FunctionName = InDelegate.FunctionName;
629 }
630
631 return Contains(Object, FunctionName);
632 }
633
641 bool Contains( const UObject* InObject, FName InFunctionName ) const
642 {
643 FReadAccessScope ReadScope = GetReadAccessScope();
644
645 return InvocationList.ContainsByPredicate( [=]( const UnicastDelegateType& Delegate ){
646 return Delegate.GetFunctionName() == InFunctionName && Delegate.IsBoundToObjectEvenIfUnreachable(InObject);
647 } );
648 }
649
656 {
658
659 {
660 FWriteAccessScope WriteScope = GetWriteAccessScope();
661
662 // First check for any objects that may have expired
664
665 // Add the delegate
667 }
668 }
669 template <
670 typename OtherThreadSafetyMode
671 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
672 >
673 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
675 {
677
678 {
679 FWriteAccessScope WriteScope = GetWriteAccessScope();
680
681 // First check for any objects that may have expired
683
684 // Add the delegate
686 }
687 }
688
696 {
698
699 {
700 FWriteAccessScope WriteScope = GetWriteAccessScope();
701
702 // Add the delegate, if possible
704
705 // Then check for any objects that may have expired
707 }
708 }
709 template <
710 typename OtherThreadSafetyMode
711 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
712 >
713 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
715 {
717
718 {
719 FWriteAccessScope WriteScope = GetWriteAccessScope();
720
721 // Add the delegate
723
724 // Then check for any objects that may have expired
726 }
727 }
728
736 {
738
739 {
740 FWriteAccessScope WriteScope = GetWriteAccessScope();
741
742 // Remove the delegate
744
745 // Check for any delegates that may have expired
747 }
748 }
749 template <
750 typename OtherThreadSafetyMode
751 UE_REQUIRES(UE::Core::Private::BackwardCompatibilityCheck<InThreadSafetyMode, OtherThreadSafetyMode>())
752 >
753 /* UE_DEPRECATED(5.3, "Deprecated - remove after TScriptDelegateTraits<FWeakObjectPtr> is removed") */
755 {
757
758 {
759 FWriteAccessScope WriteScope = GetWriteAccessScope();
760
761 // Remove the delegate
763
764 // Check for any delegates that may have expired
766 }
767 }
768
776 void Remove( const UObject* InObject, FName InFunctionName )
777 {
778 FWriteAccessScope WriteScope = GetWriteAccessScope();
779
780 // Remove the delegate
781 RemoveInternal( InObject, InFunctionName );
782
783 // Check for any delegates that may have expired
785 }
786
796 {
797 FWriteAccessScope WriteScope = GetWriteAccessScope();
798
799 for (int32 BindingIndex = InvocationList.Num() - 1; BindingIndex >= 0; --BindingIndex)
800 {
801 const UnicastDelegateType& Binding = InvocationList[BindingIndex];
802
803 if (Binding.IsBoundToObject(Object) || Binding.IsCompactable())
804 {
805 InvocationList.RemoveAtSwap(BindingIndex);
806 }
807 }
808 }
809
813 void Clear()
814 {
815 FWriteAccessScope WriteScope = GetWriteAccessScope();
817 }
818
824 template <typename UObjectTemplate>
825 inline FString ToString() const
826 {
827 FReadAccessScope ReadScope = GetReadAccessScope();
828
829 if( IsBound() )
830 {
831 FString AllDelegatesString = TEXT( "[" );
832 bool bAddComma = false;
834 {
835 if (bAddComma)
836 {
837 AllDelegatesString += TEXT( ", " );
838 }
839 bAddComma = true;
841 }
842 AllDelegatesString += TEXT( "]" );
843 return AllDelegatesString;
844 }
845 return TEXT( "<Unbound>" );
846 }
847
850 {
851 // Note that !IsSaving is not the same as IsLoading. See, e.g., FArchiveReplaceObjectRef
852 if (!Ar.IsSaving())
853 {
854 FWriteAccessScope WriteScope = D.GetWriteAccessScope();
855 Ar << D.InvocationList;
856 // After loading the delegate, clean up the list to make sure there are no bad object references
857 // unless the archive is used to migrate remote objects in which case we don't want to resolve weak object pointers
858 // which may be pointing to objects that haven't been migrated yet
859 if (Ar.IsLoading()
862#endif
863 )
864 {
865 D.CompactInvocationList();
866 }
867 }
868 else
869 {
870 FReadAccessScope ReadScope = D.GetReadAccessScope();
871 // When saving the delegate, clean up the list to make sure there are no bad object references
872 // Don't do this in place because we don't want to require a write lock
875 for (const UnicastDelegateType& Delegate : D.InvocationList)
876 {
877 if (!Delegate.IsCompactable())
878 {
879 CompactedList.Add(Delegate);
880 }
881 }
882 Ar << CompactedList;
883 }
884 return Ar;
885 }
886
888 {
889 FWriteAccessScope WriteScope = D.GetWriteAccessScope();
890
891 FArchive& UnderlyingArchive = Slot.GetUnderlyingArchive();
892
893 if (UnderlyingArchive.IsSaving())
894 {
895 // When saving the delegate, clean up the list to make sure there are no bad object references
896 D.CompactInvocationList();
897 }
898
899 Slot << D.InvocationList;
900
901 if (UnderlyingArchive.IsLoading())
902 {
903 // After loading the delegate, clean up the list to make sure there are no bad object references
904 D.CompactInvocationList();
905 }
906 }
907
916 template <class UObjectTemplate>
917 void ProcessMulticastDelegate(void* Parameters) const
918 {
919 {
920 FReadAccessScope ReadScope = const_cast<TMulticastScriptDelegate*>(this)->GetReadAccessScope();
921
922 if( InvocationList.Num() > 0 )
923 {
924 // Create a copy of the invocation list, just in case the list is modified by one of the callbacks during the broadcast
927
928 // Invoke each bound function
929 for( typename FInlineInvocationList::TConstIterator FunctionIt( InvocationListCopy ); FunctionIt; ++FunctionIt )
930 {
931 if( FunctionIt->IsBound() )
932 {
933 // Invoke this delegate!
934 FunctionIt->template ProcessDelegate<UObjectTemplate>(Parameters);
935 }
936 }
937 }
938 }
939
940 {
941 FWriteAccessScope WriteScope = const_cast<TMulticastScriptDelegate*>(this)->GetWriteAccessScope();
942 // Removes need to occur under a separate write scope because we don't want to hold a write lock during execution
943 // We want to take the least restrictive lock (guard, really) possible in order to permit the callbacks to
944 // inspect the multicast delegate itself (e.g., when using the serialization system to inspect/explore data or find references)
946 }
947 }
948
955 {
956 FReadAccessScope ReadScope = GetReadAccessScope();
957
960 {
961 UObject* CurObject = CurDelegate->GetUObject();
962 if( CurObject != nullptr )
963 {
964 OutputList.Add( CurObject );
965 }
966 }
967 return OutputList;
968 }
969
976 {
977 FReadAccessScope ReadScope = GetReadAccessScope();
978 TArray<UObject*> Result;
979 for (auto* Ref : GetAllObjectRefsEvenIfUnreachable())
980 {
981 Result.Add(Ref->GetEvenIfUnreachable());
982 }
983 return Result;
984 }
985
987 {
988 FReadAccessScope ReadScope = GetReadAccessScope();
989 using WeakPtrType = typename UnicastDelegateType::WeakPtrType;
992 {
993 WeakPtrType& CurObject = CurDelegate->GetUObjectRef();
994 if( CurObject.GetEvenIfUnreachable() != nullptr )
995 {
997 }
998 }
999 return OutputList;
1000 }
1001
1006 {
1007 FReadAccessScope ReadScope = GetReadAccessScope();
1009 }
1010
1011protected:
1012
1019 {
1020#if DO_ENSURE
1021 // Verify same function isn't already bound
1022 const int32 NumFunctions = InvocationList.Num();
1023 for( int32 CurFunctionIndex = 0; CurFunctionIndex < NumFunctions; ++CurFunctionIndex )
1024 {
1026 }
1027#endif // DO_CHECK
1029 }
1030
1038 {
1039 // Add the item to the invocation list only if it is unique
1041 }
1042
1053
1061 void RemoveInternal( const UObject* InObject, FName InFunctionName ) const
1062 {
1064 return Delegate.GetFunctionName() == InFunctionName && Delegate.IsBoundToObjectEvenIfUnreachable(InObject);
1065 });
1066
1068 {
1070 }
1071 }
1072
1075 {
1077 return Delegate.IsCompactable();
1078 });
1079 }
1080
1081protected:
1082
1084 mutable InvocationListType InvocationList; // Mutable so that we can housekeep list even with 'const' broadcasts
1085
1086 // Declare ourselves as a friend of FMulticastDelegateProperty so that it can access our function list
1090
1091 //
1093
1095};
1096
1097
1098template<typename ThreadSafetyMode>
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define ensure( InExpression)
Definition AssertionMacros.h:464
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_WITH_REMOTE_OBJECT_HANDLE
Definition CoreMiscDefines.h:620
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ PPF_AvoidRemoteObjectMigration
Definition PropertyPortFlags.h:96
#define UE_REQUIRES(...)
Definition Requires.h:86
#define SA_VALUE(Name, Value)
Definition StructuredArchiveNameHelpers.h:77
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool HasAnyPortFlags(uint32 Flags) const
Definition Archive.h:480
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
UE_FORCEINLINE_HINT bool IsSaving() const
Definition Archive.h:248
Definition ScriptCore.cpp:3282
Definition UnrealType.h:6464
Definition UnrealType.h:6593
Definition UnrealType.h:6643
Definition NameTypes.h:617
CORE_API FString ToString() const
Definition UnrealNames.cpp:3537
bool IsValid() const
Definition NameTypes.h:842
Definition StructuredArchiveSlots.h:144
Definition StructuredArchiveSlots.h:52
UE_API FStructuredArchiveRecord EnterRecord()
Definition StructuredArchiveSlots.h:252
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_FORCEINLINE_HINT void RemoveAtSwap(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2185
SizeType RemoveSingleSwap(const ElementType &Item, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:3211
SizeType RemoveAllSwap(const PREDICATE_CLASS &Predicate, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:3163
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
UE_NODEBUG UE_FORCEINLINE_HINT SIZE_T GetAllocatedSize(void) const
Definition Array.h:1059
SizeType IndexOfByPredicate(Predicate Pred) const
Definition Array.h:1423
UE_FORCEINLINE_HINT SizeType AddUnique(ElementType &&Item)
Definition Array.h:2993
void Empty(SizeType Slack=0)
Definition Array.h:2273
UE_NODEBUG UE_FORCEINLINE_HINT bool ContainsByPredicate(Predicate Pred) const
Definition Array.h:1538
Definition DelegateAccessHandler.h:30
Definition Array.h:64
Definition ScriptDelegates.h:509
void AddUniqueInternal(UnicastDelegateType &&InDelegate)
Definition ScriptDelegates.h:1037
SIZE_T GetAllocatedSize() const
Definition ScriptDelegates.h:1005
TMulticastScriptDelegate & operator=(TMulticastScriptDelegate &&Other)
Definition ScriptDelegates.h:565
void RemoveAll(const UObject *Object)
Definition ScriptDelegates.h:795
typename UE::Core::Private::TScriptDelegateTraits< InThreadSafetyMode >::ThreadSafetyMode ThreadSafetyMode
Definition ScriptDelegates.h:520
void Remove(const TScriptDelegate< ThreadSafetyMode > &InDelegate)
Definition ScriptDelegates.h:735
TMulticastScriptDelegate(const TMulticastScriptDelegate &Other)
Definition ScriptDelegates.h:525
void AddUnique(const TScriptDelegate< ThreadSafetyMode > &InDelegate)
Definition ScriptDelegates.h:695
void Add(const TScriptDelegate< OtherThreadSafetyMode > &InDelegate)
Definition ScriptDelegates.h:674
bool Contains(const TScriptDelegate< OtherThreadSafetyMode > &InDelegate) const
Definition ScriptDelegates.h:620
TMulticastScriptDelegate()=default
void Add(const TScriptDelegate< ThreadSafetyMode > &InDelegate)
Definition ScriptDelegates.h:655
void ProcessMulticastDelegate(void *Parameters) const
Definition ScriptDelegates.h:917
TArray< UObject * > GetAllObjectsEvenIfUnreachable() const
Definition ScriptDelegates.h:975
void Remove(const TScriptDelegate< OtherThreadSafetyMode > &InDelegate)
Definition ScriptDelegates.h:754
void RemoveInternal(const UObject *InObject, FName InFunctionName) const
Definition ScriptDelegates.h:1061
TMulticastScriptDelegate & operator=(const TMulticastScriptDelegate &Other)
Definition ScriptDelegates.h:537
bool Contains(const TScriptDelegate< ThreadSafetyMode > &InDelegate) const
Definition ScriptDelegates.h:602
bool IsBound() const
Definition ScriptDelegates.h:589
void AddUnique(const TScriptDelegate< OtherThreadSafetyMode > &InDelegate)
Definition ScriptDelegates.h:714
void Clear()
Definition ScriptDelegates.h:813
TArray< UObject * > GetAllObjects() const
Definition ScriptDelegates.h:954
friend FArchive & operator<<(FArchive &Ar, TMulticastScriptDelegate &D)
Definition ScriptDelegates.h:849
bool Contains(const UObject *InObject, FName InFunctionName) const
Definition ScriptDelegates.h:641
TArray< typename UnicastDelegateType::WeakPtrType * > GetAllObjectRefsEvenIfUnreachable() const
Definition ScriptDelegates.h:986
InvocationListType InvocationList
Definition ScriptDelegates.h:1084
TMulticastScriptDelegate(TMulticastScriptDelegate &&Other)
Definition ScriptDelegates.h:553
void RemoveInternal(const UnicastDelegateType &InDelegate) const
Definition ScriptDelegates.h:1049
void AddInternal(UnicastDelegateType &&InDelegate)
Definition ScriptDelegates.h:1018
void CompactInvocationList() const
Definition ScriptDelegates.h:1074
friend void operator<<(FStructuredArchive::FSlot Slot, TMulticastScriptDelegate &D)
Definition ScriptDelegates.h:887
void Remove(const UObject *InObject, FName InFunctionName)
Definition ScriptDelegates.h:776
FString ToString() const
Definition ScriptDelegates.h:825
Definition ScriptDelegates.h:66
UObject * GetUObjectEvenIfUnreachable()
Definition ScriptDelegates.h:382
static TScriptDelegate CopyFrom(const TScriptDelegate< OtherThreadSafetyMode > &Other)
Definition ScriptDelegates.h:469
const UObject * GetUObjectEvenIfUnreachable() const
Definition ScriptDelegates.h:395
bool IsBoundToObjectEvenIfUnreachable(void const *InUserObject) const
Definition ScriptDelegates.h:215
UE_FORCEINLINE_HINT bool operator!=(const TScriptDelegate &Other) const
Definition ScriptDelegates.h:337
void Clear()
Definition ScriptDelegates.h:251
FName FunctionName
Definition ScriptDelegates.h:488
void Unbind()
Definition ScriptDelegates.h:240
friend void operator<<(FStructuredArchive::FSlot Slot, TScriptDelegate &D)
Definition ScriptDelegates.h:282
void BindUFunction(UObject *InObject, const FName &InFunctionName)
Definition ScriptDelegates.h:180
bool IsBound() const
Definition ScriptDelegates.h:193
UObject * GetUObject()
Definition ScriptDelegates.h:356
FName GetFunctionName() const
Definition ScriptDelegates.h:418
typename UE::Core::Private::TScriptDelegateTraits< InThreadSafetyMode >::ThreadSafetyMode ThreadSafetyMode
Definition ScriptDelegates.h:68
WeakPtrType Object
Definition ScriptDelegates.h:485
const WeakPtrType & GetUObjectRef() const
Definition ScriptDelegates.h:408
TScriptDelegate & operator=(const TScriptDelegate< OtherThreadSafetyMode > &Other)
Definition ScriptDelegates.h:136
UE_FORCEINLINE_HINT bool operator!=(const TScriptDelegate< OtherThreadSafetyMode > &Other) const
Definition ScriptDelegates.h:346
TScriptDelegate(const TScriptDelegate< OtherThreadSafetyMode > &Other)
Definition ScriptDelegates.h:104
friend FArchive & operator<<(FArchive &Ar, TScriptDelegate &D)
Definition ScriptDelegates.h:273
bool operator==(const TScriptDelegate &Other) const
Definition ScriptDelegates.h:291
bool IsCompactable() const
Definition ScriptDelegates.h:226
friend uint32 GetTypeHash(const TScriptDelegate &Delegate)
Definition ScriptDelegates.h:461
WeakPtrType & GetUObjectRef()
Definition ScriptDelegates.h:403
bool operator==(const TScriptDelegate< OtherThreadSafetyMode > &Other) const
Definition ScriptDelegates.h:316
TScriptDelegate & operator=(const TScriptDelegate &Other)
Definition ScriptDelegates.h:112
typename UE::Core::Private::TScriptDelegateTraits< InThreadSafetyMode >::WeakPtrType WeakPtrType
Definition ScriptDelegates.h:69
void ProcessDelegate(void *Parameters) const
Definition ScriptDelegates.h:433
const UObject * GetUObject() const
Definition ScriptDelegates.h:369
bool IsBoundToObject(void const *InUserObject) const
Definition ScriptDelegates.h:204
FString ToString() const
Definition ScriptDelegates.h:262
TScriptDelegate()
Definition ScriptDelegates.h:86
TScriptDelegate(const TScriptDelegate &Other)
Definition ScriptDelegates.h:91
CORE_API FArchive & GetUnderlyingArchive() const
Definition StructuredArchiveSlots.cpp:7
Definition Class.h:2476
Definition Object.h:95
implementation
Definition PlayInEditorLoadingScope.h:8
constexpr bool BackwardCompatibilityCheck()
Definition ScriptDelegates.h:44
Definition WeakObjectPtr.h:49
Definition UnrealTypeTraits.h:172
Definition ScriptDelegates.h:20
FNotThreadSafeNotCheckedDelegateMode UnicastThreadSafetyModeForMulticasts
Definition ScriptDelegates.h:26
InThreadSafetyMode ThreadSafetyMode
Definition ScriptDelegates.h:25