engine
 
载入中...
搜索中...
未找到
静态 Public 成员函数 | 友元 | 所有成员列表
FSparseDelegateStorage结构体 参考

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

成员函数说明

◆ Add()

static bool FSparseDelegateStorage::Add ( const UObject *  DelegateOwner,
const FName  DelegateName,
FScriptDelegate  Delegate 
)
static

Binds a sparse delegate to the owner.

Returns if the delegate was successfully bound.

◆ AddUnique()

static bool FSparseDelegateStorage::AddUnique ( const UObject *  DelegateOwner,
const FName  DelegateName,
FScriptDelegate  Delegate 
)
static

Binds a sparse delegate to the owner, verifying first that the delegate is not already bound.

Returns if the delegate was successfully bound.

◆ GetMulticastDelegate()

static FMulticastScriptDelegate * FSparseDelegateStorage::GetMulticastDelegate ( const UObject *  DelegateOwner,
const FName  DelegateName 
)
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.

◆ GetSharedMulticastDelegate()

static TSharedPtr< FMulticastScriptDelegate > FSparseDelegateStorage::GetSharedMulticastDelegate ( const UObject *  DelegateOwner,
const FName  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.

◆ Remove()

static bool FSparseDelegateStorage::Remove ( const UObject *  DelegateOwner,
const FName  DelegateName,
const FScriptDelegate &  Delegate 
)
static

Removes a delegate binding from the owner's sparse delegate storage.

Returns true if there are still bindings to the delegate.

◆ RemoveAll()

static bool FSparseDelegateStorage::RemoveAll ( const UObject *  DelegateOwner,
const FName  DelegateName,
const UObject *  UserObject 
)
static

Removes all sparse delegate binding from the owner for a given object.

Returns true if there are still bindings to the delegate.

◆ SetMulticastDelegate()

static void FSparseDelegateStorage::SetMulticastDelegate ( const UObject *  DelegateOwner,
const FName  DelegateName,
FMulticastScriptDelegate  Delegate 
)
static

Directly sets the Multicast Delegate for this object/delegatename pair.

If the delegate is unbound it will be assigned/inserted anyways.


该结构体的文档由以下文件生成: