Sparse delegates can be used for infrequently bound dynamic delegates so that the object uses only 1 byte of storage instead of having the full overhead of the delegate invocation list. 更多...
#include <SparseDelegate.h>
静态 Public 成员函数 | |
| static bool | Add (const UObject *DelegateOwner, const FName DelegateName, FScriptDelegate Delegate) |
| Binds a sparse delegate to the owner. 更多... | |
| static bool | AddUnique (const UObject *DelegateOwner, const FName DelegateName, FScriptDelegate Delegate) |
| Binds a sparse delegate to the owner, verifying first that the delegate is not already bound. 更多... | |
| static void | Clear (const UObject *DelegateOwner, const FName DelegateName) |
| Clear all of the named sparse delegate bindings from the owner. | |
| static bool | Contains (const UObject *DelegateOwner, const FName DelegateName, const FScriptDelegate &Delegate) |
| Returns whether a sparse delegate is bound to the owner. | |
| static FMulticastScriptDelegate * | GetMulticastDelegate (const UObject *DelegateOwner, const FName DelegateName) |
| Acquires the actual Multicast Delegate from the annotation if any delegates are bound to it. 更多... | |
| static TSharedPtr< FMulticastScriptDelegate > | GetSharedMulticastDelegate (const UObject *DelegateOwner, const FName DelegateName) |
| Acquires the actual Multicast Delegate from the annotation if any delegates are bound to it as a shared pointer. 更多... | |
| static void | RegisterDelegateOffset (const UObject *OwningObject, FName DelegateName, size_t OffsetToOwner) |
| Registers the sparse delegate so that the offset can be determined. | |
| static bool | Remove (const UObject *DelegateOwner, const FName DelegateName, const FScriptDelegate &Delegate) |
| Removes a delegate binding from the owner's sparse delegate storage. 更多... | |
| static bool | RemoveAll (const UObject *DelegateOwner, const FName DelegateName, const UObject *UserObject) |
| Removes all sparse delegate binding from the owner for a given object. 更多... | |
| static FSparseDelegate * | ResolveSparseDelegate (const UObject *OwningObject, FName DelegateName) |
| Using the registry of sparse delegates recover the FSparseDelegate address from the UObject and name. | |
| static UObject * | ResolveSparseOwner (const FSparseDelegate &SparseDelegate, const FName OwningClassName, const FName DelegateName) |
| Using the registry of sparse delegates recover the UObject owner from the FSparseDelegate address owning class and delegate names. | |
| static void | SetMulticastDelegate (const UObject *DelegateOwner, const FName DelegateName, FMulticastScriptDelegate Delegate) |
| Directly sets the Multicast Delegate for this object/delegatename pair. 更多... | |
| static void | SparseDelegateReport (const TArray< FString > &, UWorld *, FOutputDevice &) |
| Outputs a report about which delegates are bound. | |
友元 | |
| struct | FObjectListener |
| Allow the object listener to use the critical section and remove objects from the map | |
Sparse delegates can be used for infrequently bound dynamic delegates so that the object uses only 1 byte of storage instead of having the full overhead of the delegate invocation list.
The cost to invoke, add, remove, etc. from the delegate is higher than using the delegate directly and thus the memory savings benefit should be traded off against the frequency with which you would expect the delegate to be bound. Helper class for handling sparse delegate bindings
|
static |
Binds a sparse delegate to the owner.
Returns if the delegate was successfully bound.
|
static |
Binds a sparse delegate to the owner, verifying first that the delegate is not already bound.
Returns if the delegate was successfully bound.
|
static |
Acquires the actual Multicast Delegate from the annotation if any delegates are bound to it.
Will be null if no entry exists in the annotation for this object/delegatename.
|
static |
Acquires the actual Multicast Delegate from the annotation if any delegates are bound to it as a shared pointer.
Will be null if no entry exists in the annotation for this object/delegatename.
|
static |
Removes a delegate binding from the owner's sparse delegate storage.
Returns true if there are still bindings to the delegate.
|
static |
Removes all sparse delegate binding from the owner for a given object.
Returns true if there are still bindings to the delegate.
|
static |
Directly sets the Multicast Delegate for this object/delegatename pair.
If the delegate is unbound it will be assigned/inserted anyways.