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

#include <ScriptDelegates.h>

+ Collaboration diagram for TScriptDelegate< TWeakPtr >:

Public Member Functions

 TScriptDelegate ()
 
void BindUFunction (UObject *InObject, const FName &InFunctionName)
 
bool IsBound () const
 
bool IsBoundToObject (void const *InUserObject) const
 
bool IsBoundToObjectEvenIfUnreachable (void const *InUserObject) const
 
bool IsCompactable () const
 
void Unbind ()
 
void Clear ()
 
template<class UObjectTemplate >
FString ToString () const
 
FORCEINLINE bool operator== (const TScriptDelegate &Other) const
 
FORCEINLINE bool operator!= (const TScriptDelegate &Other) const
 
void operator= (const TScriptDelegate &Other)
 
UObjectGetUObject ()
 
const UObjectGetUObject () const
 
UObjectGetUObjectEvenIfUnreachable ()
 
const UObjectGetUObjectEvenIfUnreachable () const
 
FName GetFunctionName () const
 
template<class UObjectTemplate >
void ProcessDelegate (void *Parameters) const
 

Protected Member Functions

 UE_DELEGATES_MT_ACCESS_DETECTOR (AccessDetector)
 

Protected Attributes

TWeakPtr Object
 
FName FunctionName
 

Private Member Functions

template<class UObjectTemplate >
bool IsBound_Internal () const
 

Friends

class FCallDelegateHelper
 
FArchiveoperator<< (FArchive &Ar, TScriptDelegate &D)
 
void operator<< (FStructuredArchive::FSlot Slot, TScriptDelegate &D)
 
uint32 GetTypeHash (const TScriptDelegate &Delegate)
 

Detailed Description

template<typename TWeakPtr = FWeakObjectPtr>
class TScriptDelegate< TWeakPtr >

Script delegate base class.

Definition at line 21 of file ScriptDelegates.h.

Constructor & Destructor Documentation

◆ TScriptDelegate()

template<typename TWeakPtr = FWeakObjectPtr>
TScriptDelegate< TWeakPtr >::TScriptDelegate ( )
inline

Default constructor.

Definition at line 30 of file ScriptDelegates.h.

Member Function Documentation

◆ BindUFunction()

template<typename TWeakPtr = FWeakObjectPtr>
void TScriptDelegate< TWeakPtr >::BindUFunction ( UObject * InObject,
const FName & InFunctionName )
inline

Binds a UFunction to this delegate.

Parameters
InObjectThe object to call the function on.
InFunctionNameThe name of the function to call.

Definition at line 59 of file ScriptDelegates.h.

◆ Clear()

template<typename TWeakPtr = FWeakObjectPtr>
void TScriptDelegate< TWeakPtr >::Clear ( )
inline

Unbinds this delegate (another name to provide a similar interface to TMulticastScriptDelegate)

Definition at line 129 of file ScriptDelegates.h.

◆ GetFunctionName()

template<typename TWeakPtr = FWeakObjectPtr>
FName TScriptDelegate< TWeakPtr >::GetFunctionName ( ) const
inline

Gets the name of the function to call on the bound object

Returns
Function name

Definition at line 249 of file ScriptDelegates.h.

◆ GetUObject() [1/2]

template<typename TWeakPtr = FWeakObjectPtr>
UObject * TScriptDelegate< TWeakPtr >::GetUObject ( )
inline

Gets the object bound to this delegate

Returns
The object

Definition at line 197 of file ScriptDelegates.h.

◆ GetUObject() [2/2]

template<typename TWeakPtr = FWeakObjectPtr>
const UObject * TScriptDelegate< TWeakPtr >::GetUObject ( ) const
inline

Gets the object bound to this delegate (const)

Returns
The object

Definition at line 210 of file ScriptDelegates.h.

◆ GetUObjectEvenIfUnreachable() [1/2]

template<typename TWeakPtr = FWeakObjectPtr>
UObject * TScriptDelegate< TWeakPtr >::GetUObjectEvenIfUnreachable ( )
inline

Gets the object bound to this delegate, even if the object is unreachable

Returns
The object

Definition at line 223 of file ScriptDelegates.h.

◆ GetUObjectEvenIfUnreachable() [2/2]

template<typename TWeakPtr = FWeakObjectPtr>
const UObject * TScriptDelegate< TWeakPtr >::GetUObjectEvenIfUnreachable ( ) const
inline

Gets the object bound to this delegate (const), even if the object is unreachable

Returns
The object

Definition at line 236 of file ScriptDelegates.h.

◆ IsBound()

template<typename TWeakPtr = FWeakObjectPtr>
bool TScriptDelegate< TWeakPtr >::IsBound ( ) const
inline

Checks to see if the user object bound to this delegate is still valid

Returns
True if the object is still valid and it's safe to execute the function call

Definition at line 72 of file ScriptDelegates.h.

◆ IsBound_Internal()

template<typename TWeakPtr = FWeakObjectPtr>
template<class UObjectTemplate >
bool TScriptDelegate< TWeakPtr >::IsBound_Internal ( ) const
inlineprivate

Definition at line 38 of file ScriptDelegates.h.

◆ IsBoundToObject()

template<typename TWeakPtr = FWeakObjectPtr>
bool TScriptDelegate< TWeakPtr >::IsBoundToObject ( void const * InUserObject) const
inline

Checks to see if this delegate is bound to the given user object.

Returns
True if this delegate is bound to InUserObject, false otherwise.

Definition at line 84 of file ScriptDelegates.h.

◆ IsBoundToObjectEvenIfUnreachable()

template<typename TWeakPtr = FWeakObjectPtr>
bool TScriptDelegate< TWeakPtr >::IsBoundToObjectEvenIfUnreachable ( void const * InUserObject) const
inline

Checks to see if this delegate is bound to the given user object, even if the object is unreachable.

Returns
True if this delegate is bound to InUserObject, false otherwise.

Definition at line 96 of file ScriptDelegates.h.

◆ IsCompactable()

template<typename TWeakPtr = FWeakObjectPtr>
bool TScriptDelegate< TWeakPtr >::IsCompactable ( ) const
inline

Checks to see if the user object bound to this delegate will ever be valid again

Returns
True if the object is still valid and it's safe to execute the function call

Definition at line 108 of file ScriptDelegates.h.

◆ operator!=()

template<typename TWeakPtr = FWeakObjectPtr>
FORCEINLINE bool TScriptDelegate< TWeakPtr >::operator!= ( const TScriptDelegate< TWeakPtr > & Other) const
inline

Definition at line 177 of file ScriptDelegates.h.

◆ operator=()

template<typename TWeakPtr = FWeakObjectPtr>
void TScriptDelegate< TWeakPtr >::operator= ( const TScriptDelegate< TWeakPtr > & Other)
inline

Definition at line 184 of file ScriptDelegates.h.

◆ operator==()

template<typename TWeakPtr = FWeakObjectPtr>
FORCEINLINE bool TScriptDelegate< TWeakPtr >::operator== ( const TScriptDelegate< TWeakPtr > & Other) const
inline

Comparison operators

Definition at line 170 of file ScriptDelegates.h.

◆ ProcessDelegate()

template<typename TWeakPtr = FWeakObjectPtr>
template<class UObjectTemplate >
void TScriptDelegate< TWeakPtr >::ProcessDelegate ( void * Parameters) const
inline

Executes a delegate by calling the named function on the object bound to the delegate. You should always first verify that the delegate is safe to execute by calling IsBound() before calling this function. In general, you should never call this function directly. Instead, call Execute() on a derived class.

Parameters
ParametersParameter structure

Definition at line 265 of file ScriptDelegates.h.

◆ ToString()

template<typename TWeakPtr = FWeakObjectPtr>
template<class UObjectTemplate >
FString TScriptDelegate< TWeakPtr >::ToString ( ) const
inline

Converts this delegate to a string representation

Returns
Delegate in string format

Definition at line 140 of file ScriptDelegates.h.

◆ UE_DELEGATES_MT_ACCESS_DETECTOR()

template<typename TWeakPtr = FWeakObjectPtr>
TScriptDelegate< TWeakPtr >::UE_DELEGATES_MT_ACCESS_DETECTOR ( AccessDetector )
protected

◆ Unbind()

template<typename TWeakPtr = FWeakObjectPtr>
void TScriptDelegate< TWeakPtr >::Unbind ( )
inline

Unbinds this delegate

Definition at line 118 of file ScriptDelegates.h.

Friends And Related Symbol Documentation

◆ FCallDelegateHelper

template<typename TWeakPtr = FWeakObjectPtr>
friend class FCallDelegateHelper
friend

Definition at line 310 of file ScriptDelegates.h.

◆ GetTypeHash

template<typename TWeakPtr = FWeakObjectPtr>
uint32 GetTypeHash ( const TScriptDelegate< TWeakPtr > & Delegate)
friend

Definition at line 292 of file ScriptDelegates.h.

◆ operator<< [1/2]

template<typename TWeakPtr = FWeakObjectPtr>
FArchive & operator<< ( FArchive & Ar,
TScriptDelegate< TWeakPtr > & D )
friend

Delegate serialization

Definition at line 152 of file ScriptDelegates.h.

◆ operator<< [2/2]

template<typename TWeakPtr = FWeakObjectPtr>
void operator<< ( FStructuredArchive::FSlot Slot,
TScriptDelegate< TWeakPtr > & D )
friend

Delegate serialization

Definition at line 161 of file ScriptDelegates.h.

Member Data Documentation

◆ FunctionName

template<typename TWeakPtr = FWeakObjectPtr>
FName TScriptDelegate< TWeakPtr >::FunctionName
protected

Name of the function to call on the bound object

Definition at line 305 of file ScriptDelegates.h.

◆ Object

template<typename TWeakPtr = FWeakObjectPtr>
TWeakPtr TScriptDelegate< TWeakPtr >::Object
protected

The object bound to this delegate, or nullptr if no object is bound

Definition at line 302 of file ScriptDelegates.h.


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