Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TMulticastDelegateBase< UserPolicy > Class Template Reference

#include <MulticastDelegateBase.h>

+ Inheritance diagram for TMulticastDelegateBase< UserPolicy >:
+ Collaboration diagram for TMulticastDelegateBase< UserPolicy >:

Public Member Functions

void Clear ()
 
bool IsBound () const
 
bool IsBoundToObject (void const *InUserObject) const
 
int32 RemoveAll (const void *InUserObject)
 
SIZE_T GetAllocatedSize () const
 

Protected Types

using InvocationListType = TArray<TDelegateBase<UserPolicy>, FMulticastInvocationListAllocatorType>
 

Protected Member Functions

 TMulticastDelegateBase ()
 
template<typename DelegateInstanceInterfaceType , typename DelegateType >
void CopyFrom (const TMulticastDelegateBase &Other)
 
template<typename DelegateInstanceInterfaceType , typename DelegateBaseType , typename... ParamTypes>
void Broadcast (ParamTypes... Params) const
 
FDelegateHandle AddDelegateInstance (TDelegateBase< UserPolicy > &&NewDelegateBaseRef)
 
bool RemoveDelegateInstance (FDelegateHandle Handle)
 

Static Protected Member Functions

template<typename DelegateType >
static FORCEINLINE autoGetDelegateInstanceProtectedHelper (const DelegateType &Base)
 

Private Member Functions

void CompactInvocationList (bool CheckThreshold=false)
 
InvocationListTypeGetInvocationList ()
 
const InvocationListTypeGetInvocationList () const
 
void LockInvocationList () const
 
void UnlockInvocationList () const
 
int32 GetInvocationListLockCount () const
 
 UE_DELEGATES_MT_ACCESS_DETECTOR (AccessDetector)
 

Private Attributes

InvocationListType InvocationList
 
int32 CompactionThreshold
 
int32 InvocationListLockCount
 

Detailed Description

template<typename UserPolicy>
class TMulticastDelegateBase< UserPolicy >

Abstract base class for multicast delegates.

Definition at line 24 of file MulticastDelegateBase.h.

Member Typedef Documentation

◆ InvocationListType

template<typename UserPolicy >
using TMulticastDelegateBase< UserPolicy >::InvocationListType = TArray<TDelegateBase<UserPolicy>, FMulticastInvocationListAllocatorType>
protected

Definition at line 27 of file MulticastDelegateBase.h.

Constructor & Destructor Documentation

◆ TMulticastDelegateBase()

template<typename UserPolicy >
TMulticastDelegateBase< UserPolicy >::TMulticastDelegateBase ( )
inlineprotected

Hidden default constructor.

Definition at line 160 of file MulticastDelegateBase.h.

Member Function Documentation

◆ AddDelegateInstance()

template<typename UserPolicy >
FDelegateHandle TMulticastDelegateBase< UserPolicy >::AddDelegateInstance ( TDelegateBase< UserPolicy > && NewDelegateBaseRef)
inlineprotected

Adds the given delegate instance to the invocation list.

Parameters
NewDelegateBaseRefThe delegate instance to add.

Definition at line 223 of file MulticastDelegateBase.h.

◆ Broadcast()

template<typename UserPolicy >
template<typename DelegateInstanceInterfaceType , typename DelegateBaseType , typename... ParamTypes>
void TMulticastDelegateBase< UserPolicy >::Broadcast ( ParamTypes... Params) const
inlineprotected

Definition at line 187 of file MulticastDelegateBase.h.

◆ Clear()

template<typename UserPolicy >
void TMulticastDelegateBase< UserPolicy >::Clear ( )
inline

Removes all functions from this delegate's invocation list.

Definition at line 31 of file MulticastDelegateBase.h.

◆ CompactInvocationList()

template<typename UserPolicy >
void TMulticastDelegateBase< UserPolicy >::CompactInvocationList ( bool CheckThreshold = false)
inlineprivate

Removes any expired or deleted functions from the invocation list.

See also
RequestCompaction

Definition at line 280 of file MulticastDelegateBase.h.

◆ CopyFrom()

template<typename UserPolicy >
template<typename DelegateInstanceInterfaceType , typename DelegateType >
void TMulticastDelegateBase< UserPolicy >::CopyFrom ( const TMulticastDelegateBase< UserPolicy > & Other)
inlineprotected

Definition at line 167 of file MulticastDelegateBase.h.

◆ GetAllocatedSize()

template<typename UserPolicy >
SIZE_T TMulticastDelegateBase< UserPolicy >::GetAllocatedSize ( ) const
inline

Returns the amount of memory allocated by this delegate's invocation list and the delegates stored within it, not including sizeof(*this).

Definition at line 146 of file MulticastDelegateBase.h.

◆ GetDelegateInstanceProtectedHelper()

template<typename UserPolicy >
template<typename DelegateType >
static FORCEINLINE auto * TMulticastDelegateBase< UserPolicy >::GetDelegateInstanceProtectedHelper ( const DelegateType & Base)
inlinestaticprotected

Helper function for derived classes of TMulticastDelegateBase to get at the delegate instance.

Definition at line 269 of file MulticastDelegateBase.h.

◆ GetInvocationList() [1/2]

template<typename UserPolicy >
InvocationListType & TMulticastDelegateBase< UserPolicy >::GetInvocationList ( )
inlineprivate

Gets a read-only reference to the invocation list.

Returns
The invocation list.

Definition at line 327 of file MulticastDelegateBase.h.

◆ GetInvocationList() [2/2]

template<typename UserPolicy >
const InvocationListType & TMulticastDelegateBase< UserPolicy >::GetInvocationList ( ) const
inlineprivate

Definition at line 332 of file MulticastDelegateBase.h.

◆ GetInvocationListLockCount()

template<typename UserPolicy >
int32 TMulticastDelegateBase< UserPolicy >::GetInvocationListLockCount ( ) const
inlineprivate

Returns the lock counter for the invocation list.

Definition at line 350 of file MulticastDelegateBase.h.

◆ IsBound()

template<typename UserPolicy >
bool TMulticastDelegateBase< UserPolicy >::IsBound ( ) const
inline

Checks to see if any functions are bound to this multi-cast delegate.

Returns
true if any functions are bound, false otherwise.

Definition at line 48 of file MulticastDelegateBase.h.

◆ IsBoundToObject()

template<typename UserPolicy >
bool TMulticastDelegateBase< UserPolicy >::IsBoundToObject ( void const * InUserObject) const
inline

Checks to see if any functions are bound to the given user object.

Returns
True if any functions are bound to InUserObject, false otherwise.

Definition at line 67 of file MulticastDelegateBase.h.

◆ LockInvocationList()

template<typename UserPolicy >
void TMulticastDelegateBase< UserPolicy >::LockInvocationList ( ) const
inlineprivate

Increments the lock counter for the invocation list.

Definition at line 338 of file MulticastDelegateBase.h.

◆ RemoveAll()

template<typename UserPolicy >
int32 TMulticastDelegateBase< UserPolicy >::RemoveAll ( const void * InUserObject)
inline

Removes all functions from this multi-cast delegate's invocation list that are bound to the specified UserObject. Note that the order of the delegates may not be preserved!

Parameters
InUserObjectThe object to remove all delegates for.
Returns
The number of delegates successfully removed.

Definition at line 90 of file MulticastDelegateBase.h.

◆ RemoveDelegateInstance()

template<typename UserPolicy >
bool TMulticastDelegateBase< UserPolicy >::RemoveDelegateInstance ( FDelegateHandle Handle)
inlineprotected

Removes a function from this multi-cast delegate's invocation list (performance is O(N)).

Parameters
HandleThe handle of the delegate instance to remove.
Returns
true if the delegate was successfully removed.

Definition at line 244 of file MulticastDelegateBase.h.

◆ UE_DELEGATES_MT_ACCESS_DETECTOR()

template<typename UserPolicy >
TMulticastDelegateBase< UserPolicy >::UE_DELEGATES_MT_ACCESS_DETECTOR ( AccessDetector )
private

◆ UnlockInvocationList()

template<typename UserPolicy >
void TMulticastDelegateBase< UserPolicy >::UnlockInvocationList ( ) const
inlineprivate

Decrements the lock counter for the invocation list.

Definition at line 344 of file MulticastDelegateBase.h.

Member Data Documentation

◆ CompactionThreshold

template<typename UserPolicy >
int32 TMulticastDelegateBase< UserPolicy >::CompactionThreshold
private

Used to determine when a compaction should happen.

Definition at line 361 of file MulticastDelegateBase.h.

◆ InvocationList

template<typename UserPolicy >
InvocationListType TMulticastDelegateBase< UserPolicy >::InvocationList
private

Holds the collection of delegate instances to invoke.

Definition at line 358 of file MulticastDelegateBase.h.

◆ InvocationListLockCount

template<typename UserPolicy >
int32 TMulticastDelegateBase< UserPolicy >::InvocationListLockCount
mutableprivate

Holds a lock counter for the invocation list.

Definition at line 364 of file MulticastDelegateBase.h.


The documentation for this class was generated from the following file: