Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/UObject
References
| Module | CoreUObject |
| Header | /Engine/Source/Runtime/CoreUObject/Public/UObject/SparseDelegate.h |
| Include | #include "UObject/SparseDelegate.h" |
Syntax
struct FSparseDelegateStorage
Remarks
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
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Binds a sparse delegate to the owner. Returns if the delegate was successfully bound. | ||
| bool | Binds a sparse delegate to the owner, verifying first that the delegate is not already bound. | ||
| void | Clear all of the named sparse delegate bindings from the owner. | ||
| bool | Returns whether a sparse delegate is bound to the owner. | ||
| bool | Returns whether a sparse delegate is bound to the owner. | ||
| FMulticastScriptDelegate * | GetMulticastDelegate
(
const UObject* DelegateOwner, |
Acquires the actual Multicast Delegate from the annotation if any delegates are bound to it. | |
| TSharedPtr< FMulticastScriptDelegate > | GetSharedMulticastDelegate
(
const UObject* DelegateOwner, |
Acquires the actual Multicast Delegate from the annotation if any delegates are bound to it as a shared pointer. | |
| void | RegisterDelegateOffset
(
const UObject* OwningObject, |
Registers the sparse delegate so that the offset can be determined. | |
| bool | Removes a delegate binding from the owner's sparse delegate storage. | ||
| bool | Removes a delegate binding from the owner's sparse delegate storage. | ||
| bool | Removes all sparse delegate binding from the owner for a given object. | ||
| FSparseDelegate * | ResolveSparseDelegate
(
const UObject* OwningObject, |
Using the registry of sparse delegates recover the FSparseDelegate address from the UObject and name. | |
| UObject * | ResolveSparseOwner
(
const FSparseDelegate& SparseDelegate, |
Using the registry of sparse delegates recover the UObject owner from the FSparseDelegate address owning class and delegate names. | |
| void | SetMulticastDelegate
(
const UObject* DelegateOwner, |
Directly sets the Multicast Delegate for this object/delegatename pair. | |
| void | SparseDelegateReport
(
const TArray< FString >&, |
Outputs a report about which delegates are bound. |
Typedefs
| Name | Description |
|---|---|
| FSparseDelegateMap | Delegate map is a map of Delegate names to a shared pointer of the multicast script delegate |
Constants
| Name | Description |
|---|---|
| SparseDelegateMapCritical | Critical Section for locking access to the sparse delegate map |
| SparseDelegateObjectListener | A listener to get notified when objects have been deleted and remove them from the map |
| SparseDelegateObjectOffsets | Sparse delegate offsets are indexed by ActorClass/DelegateName pair |
| SparseDelegates | Map of objects to the map of delegates that are bound to that object |