#include <WeakObjectPtrTemplates.h>
|
| | TWeakObjectPtr ()=default |
| |
| | TWeakObjectPtr (const TWeakObjectPtr &)=default |
| |
| TWeakObjectPtr & | operator= (const TWeakObjectPtr &)=default |
| |
| | ~TWeakObjectPtr ()=default |
| |
| FORCEINLINE | TWeakObjectPtr (TYPE_OF_NULLPTR) |
| |
| template<typename U > |
| FORCEINLINE | TWeakObjectPtr (U Object) |
| |
| template<typename OtherT > |
| FORCEINLINE | TWeakObjectPtr (const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &Other) |
| |
| FORCEINLINE void | Reset () |
| |
| template<typename U > |
| FORCEINLINE TWeakObjectPtr & | operator= (U *Object) |
| |
| template<typename OtherT > |
| FORCEINLINE TWeakObjectPtr & | operator= (const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &Other) |
| |
| FORCEINLINE T * | Get (bool bEvenIfPendingKill) const |
| |
| FORCEINLINE T * | Get () const |
| |
| FORCEINLINE TStrongObjectPtr< T > | Pin (bool bEvenIfPendingKill) const |
| |
| FORCEINLINE TStrongObjectPtr< T > | Pin () const |
| |
| FORCEINLINE TStrongObjectPtr< T > | TryPin (bool &bOutPinValid, bool bEvenIfPendingKill) const |
| |
| FORCEINLINE TStrongObjectPtr< T > | TryPin (bool &bOutPinValid) const |
| |
| FORCEINLINE T * | GetEvenIfUnreachable () const |
| |
| FORCEINLINE T & | operator* () const |
| |
| FORCEINLINE T * | operator-> () const |
| |
| | operator bool () const =delete |
| |
| | operator TWeakObjectPtrBase () const |
| |
| FORCEINLINE bool | IsValid (bool bEvenIfPendingKill, bool bThreadsafeTest=false) const |
| |
| FORCEINLINE bool | IsValid () const |
| |
| FORCEINLINE bool | IsStale (bool bIncludingIfPendingKill=true, bool bThreadsafeTest=false) const |
| |
| FORCEINLINE bool | IsExplicitlyNull () const |
| |
| FORCEINLINE bool | HasSameIndexAndSerialNumber (const TWeakObjectPtr &Other) const |
| |
| template<typename OtherT UE_REQUIRES> |
| FORCEINLINE bool | HasSameIndexAndSerialNumber (const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &Other) const |
| |
| FORCEINLINE bool | IsRemote () const |
| |
| FORCEINLINE void | Serialize (FArchive &Ar) |
| |
| FORCEINLINE uint32 | GetWeakPtrTypeHash () const |
| |
| template<typename RhsT , typename = decltype((T*)nullptr == (RhsT*)nullptr)> |
| FORCENOINLINE bool | UEOpEquals (const TWeakObjectPtr< RhsT, TWeakObjectPtrBase > &Rhs) const |
| |
| template<typename RhsT , typename = decltype((T*)nullptr == (RhsT*)nullptr)> |
| FORCENOINLINE bool | UEOpEquals (const RhsT *Rhs) const |
| |
| FORCENOINLINE bool | UEOpEquals (TYPE_OF_NULLPTR) const |
| |
| template<typename RhsT , typename = decltype((T*)nullptr != (RhsT*)nullptr)> |
| FORCEINLINE bool | operator!= (const TWeakObjectPtr< RhsT, TWeakObjectPtrBase > &Rhs) const |
| |
| template<typename RhsT , typename = decltype((T*)nullptr != (RhsT*)nullptr)> |
| FORCEINLINE bool | operator!= (const RhsT *Rhs) const |
| |
| FORCEINLINE bool | operator!= (TYPE_OF_NULLPTR) const |
| |
template<class T, class
TWeakObjectPtrBase>
struct TWeakObjectPtr< T, TWeakObjectPtrBase >
TWeakObjectPtr is the templated version of the generic FWeakObjectPtr
- Examples
- /work/Engine/Source/Runtime/UMG/Public/Components/Widget.h.
◆ ElementType
◆ TWeakObjectPtr() [1/5]
◆ TWeakObjectPtr() [2/5]
◆ ~TWeakObjectPtr()
◆ TWeakObjectPtr() [3/5]
Construct from a null pointer
◆ TWeakObjectPtr() [4/5]
Construct from an object pointer
- Parameters
-
| Object | object to create a weak pointer to |
◆ TWeakObjectPtr() [5/5]
Construct from another weak pointer of another type, intended for derived-to-base conversions
- Parameters
-
| Other | weak pointer to copy from |
◆ Get() [1/2]
Dereference the weak pointer. This is an optimized version implying bEvenIfPendingKill=false.
◆ Get() [2/2]
Dereference the weak pointer
- Parameters
-
| bEvenIfPendingKill | if this is true, pendingkill objects are considered valid |
- Returns
- nullptr if this object is gone or the weak pointer is explicitly null, otherwise a valid uobject pointer
◆ GetEvenIfUnreachable()
Deferences the weak pointer even if its marked RF_Unreachable. This is needed to resolve weak pointers during GC (such as AddReferenceObjects)
◆ GetWeakPtrTypeHash()
◆ HasSameIndexAndSerialNumber() [1/2]
Returns true if two weak pointers were originally set to the same object, even if they are now stale
- Parameters
-
| Other | weak pointer to compare to |
◆ HasSameIndexAndSerialNumber() [2/2]
Returns true if two weak pointers were originally set to the same object, even if they are now stale
- Parameters
-
| Other | weak pointer to compare to |
◆ IsExplicitlyNull()
Returns true if this pointer was explicitly assigned to null, was reset, or was never initialized. If this returns true, IsValid() and IsStale() will both return false.
◆ IsRemote()
◆ IsStale()
Slightly different than !IsValid(), returns true if this used to point to a UObject, but doesn't any more and has not been assigned or reset in the mean time.
- Parameters
-
| bIncludingIfPendingKill | if this is true, pendingkill objects are considered stale |
| bThreadsafeTest | set it to true when testing outside of Game Thread. Results in false if WeakObjPtr point to an existing object (no flags checked) |
- Returns
- true if this used to point at a real object but no longer does.
◆ IsValid() [1/2]
Test if this points to a live UObject. This is an optimized version implying bEvenIfPendingKill=false, bThreadsafeTest=false. This should be done only when needed as excess resolution of the underlying pointer can cause performance issues. Note that IsValid can not be used on another thread as it will incorrectly return false during the mark phase of the GC due to the Unreachable flag being set. (see bThreadsafeTest above)
- Returns
- true if Get() would return a valid non-null pointer
◆ IsValid() [2/2]
Test if this points to a live UObject. This should be done only when needed as excess resolution of the underlying pointer can cause performance issues.
- Parameters
-
| bEvenIfPendingKill | if this is true, pendingkill objects are considered valid |
| bThreadsafeTest | if true then function will just give you information whether referenced UObject is gone forever (return false) or if it is still there (return true, no object flags checked). This is required as without it IsValid can return false during the mark phase of the GC due to the presence of the Unreachable flag. |
- Returns
- true if Get() would return a valid non-null pointer
◆ operator bool()
◆ operator TWeakObjectPtrBase()
◆ operator!=() [1/3]
◆ operator!=() [2/3]
Compare weak pointers for inequality
- Parameters
-
| Other | weak pointer to compare to |
◆ operator!=() [3/3]
◆ operator*()
Dereference the weak pointer
◆ operator->()
Dereference the weak pointer
◆ operator=() [1/3]
◆ operator=() [2/3]
Assign from another weak pointer, intended for derived-to-base conversions
- Parameters
-
| Other | weak pointer to copy from |
◆ operator=() [3/3]
Copy from an object pointer
- Parameters
-
| Object | object to create a weak pointer to |
◆ Pin() [1/2]
Pin the weak pointer as a strong ptr. This is an optimized version implying bEvenIfPendingKill=false.
◆ Pin() [2/2]
Pin the weak pointer and get a strongptr.
- Parameters
-
| bEvenIfPendingKill | if this is true, pendingkill objects are considered valid |
- Returns
- nullptr if this object is gone or the weak pointer is explicitly null, otherwise a valid uobject pointer
◆ Reset()
Reset the weak pointer back to the null state
◆ Serialize()
◆ TryPin() [1/2]
Pin the weak pointer as a strong ptr. This is an optimized version implying bEvenIfPendingKill=false.
◆ TryPin() [2/2]
Pin the weak pointer and get a strongptr.
- Parameters
-
| bOutPinValid | true if garbage collection was not in progress, and OutResult was successfully captured, false if garbage collection was in progress and OutResult was not captured |
| bEvenIfPendingKill | if this is true, pendingkill objects are considered valid |
- Returns
- nullptr if this object is gone or the weak pointer is explicitly null, otherwise a valid uobject pointer
◆ UEOpEquals() [1/3]
◆ UEOpEquals() [2/3]
Compare weak pointers for equality. If both pointers would return nullptr from Get() they count as equal even if they were not initialized to the same object.
- Parameters
-
| Other | weak pointer to compare to |
◆ UEOpEquals() [3/3]
◆ FFieldPath
◆ TWeakObjectPtr
The documentation for this struct was generated from the following file: