engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 友元 | 所有成员列表
TWeakObjectPtr< T, TWeakObjectPtrBase > 模板结构体 参考

TWeakObjectPtr is the templated version of the generic FWeakObjectPtr 更多...

#include <WeakObjectPtrTemplates.h>

继承自 TWeakObjectPtrBase .

Public 成员函数

FORCEINLINE T * Get () const
 Dereference the weak pointer. 更多...
 
FORCEINLINE T * Get (bool bEvenIfPendingKill) const
 Dereference the weak pointer 更多...
 
FORCEINLINE T * GetEvenIfUnreachable () const
 Deferences the weak pointer even if its marked RF_Unreachable. 更多...
 
FORCEINLINE bool HasSameIndexAndSerialNumber (const TWeakObjectPtr &Other) const
 Returns true if two weak pointers were originally set to the same object, even if they are now stale 更多...
 
FORCEINLINE bool IsExplicitlyNull () const
 Returns true if this pointer was explicitly assigned to null, was reset, or was never initialized. 更多...
 
FORCEINLINE bool IsStale (bool bIncludingIfPendingKill=true, bool bThreadsafeTest=false) const
 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. 更多...
 
FORCEINLINE bool IsValid () const
 Test if this points to a live UObject. 更多...
 
FORCEINLINE bool IsValid (bool bEvenIfPendingKill, bool bThreadsafeTest=false) const
 Test if this points to a live UObject 更多...
 
FORCEINLINE T & operator* () const
 Dereference the weak pointer
 
FORCEINLINE T * operator-> () const
 Dereference the weak pointer
 
template<typename OtherT , typename = decltype(ImplicitConv<T*>((OtherT*)nullptr))>
FORCEINLINE TWeakObjectPtr & operator= (const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &Other)
 Assign from another weak pointer, intended for derived-to-base conversions 更多...
 
template<class U >
FORCEINLINE TEnableIf<!TLosesQualifiersFromTo< U, T >::Value, TWeakObjectPtr & >::Type operator= (U *Object)
 Copy from an object pointer 更多...
 
FORCEINLINE void Reset ()
 Reset the weak pointer back to the null state
 
template<typename OtherT , typename = decltype(ImplicitConv<T*>((OtherT*)nullptr))>
FORCEINLINE TWeakObjectPtr (const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &Other)
 Construct from another weak pointer of another type, intended for derived-to-base conversions 更多...
 
FORCEINLINE TWeakObjectPtr (TYPE_OF_NULLPTR)
 Construct from a null pointer
 
template<typename U , typename = decltype(ImplicitConv<T*>((U*)nullptr))>
FORCEINLINE TWeakObjectPtr (U *Object)
 Construct from an object pointer 更多...
 

友元

FORCEINLINE friend uint32 GetTypeHash (const TWeakObjectPtr &WeakObjectPtr)
 Hash function.
 
FArchive & operator<< (FArchive &Ar, TWeakObjectPtr &WeakObjectPtr)
 Weak object pointer serialization, this forwards to FArchive::operator<<(struct FWeakObjectPtr&) or an override
 

详细描述

template<class T, class TWeakObjectPtrBase>
struct TWeakObjectPtr< T, TWeakObjectPtrBase >

TWeakObjectPtr is the templated version of the generic FWeakObjectPtr

示例
/github/workspace/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

构造及析构函数说明

◆ TWeakObjectPtr() [1/2]

template<class T , class TWeakObjectPtrBase >
template<typename U , typename = decltype(ImplicitConv<T*>((U*)nullptr))>
FORCEINLINE TWeakObjectPtr< T, TWeakObjectPtrBase >::TWeakObjectPtr ( U *  Object)
inline

Construct from an object pointer

参数
Objectobject to create a weak pointer to

◆ TWeakObjectPtr() [2/2]

template<class T , class TWeakObjectPtrBase >
template<typename OtherT , typename = decltype(ImplicitConv<T*>((OtherT*)nullptr))>
FORCEINLINE TWeakObjectPtr< T, TWeakObjectPtrBase >::TWeakObjectPtr ( const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &  Other)
inline

Construct from another weak pointer of another type, intended for derived-to-base conversions

参数
Otherweak pointer to copy from

成员函数说明

◆ Get() [1/2]

template<class T , class TWeakObjectPtrBase >
FORCEINLINE T * TWeakObjectPtr< T, TWeakObjectPtrBase >::Get ( ) const
inline

Dereference the weak pointer.

This is an optimized version implying bEvenIfPendingKill=false.

◆ Get() [2/2]

template<class T , class TWeakObjectPtrBase >
FORCEINLINE T * TWeakObjectPtr< T, TWeakObjectPtrBase >::Get ( bool  bEvenIfPendingKill) const
inline

Dereference the weak pointer

参数
bEvenIfPendingKillif this is true, pendingkill objects are considered valid
返回
nullptr if this object is gone or the weak pointer is explicitly null, otherwise a valid uobject pointer

◆ GetEvenIfUnreachable()

template<class T , class TWeakObjectPtrBase >
FORCEINLINE T * TWeakObjectPtr< T, TWeakObjectPtrBase >::GetEvenIfUnreachable ( ) const
inline

Deferences the weak pointer even if its marked RF_Unreachable.

This is needed to resolve weak pointers during GC (such as ::AddReferenceObjects)

◆ HasSameIndexAndSerialNumber()

template<class T , class TWeakObjectPtrBase >
FORCEINLINE bool TWeakObjectPtr< T, TWeakObjectPtrBase >::HasSameIndexAndSerialNumber ( const TWeakObjectPtr< T, TWeakObjectPtrBase > &  Other) const
inline

Returns true if two weak pointers were originally set to the same object, even if they are now stale

参数
Otherweak pointer to compare to

◆ IsExplicitlyNull()

template<class T , class TWeakObjectPtrBase >
FORCEINLINE bool TWeakObjectPtr< T, TWeakObjectPtrBase >::IsExplicitlyNull ( ) const
inline

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.

◆ IsStale()

template<class T , class TWeakObjectPtrBase >
FORCEINLINE bool TWeakObjectPtr< T, TWeakObjectPtrBase >::IsStale ( bool  bIncludingIfPendingKill = true,
bool  bThreadsafeTest = false 
) const
inline

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.

参数
bIncludingIfPendingKillif this is true, pendingkill objects are considered stale
bThreadsafeTestset it to true when testing outside of Game Thread. Results in false if WeakObjPtr point to an existing object (no flags checked)
返回
true if this used to point at a real object but no longer does.

◆ IsValid() [1/2]

template<class T , class TWeakObjectPtrBase >
FORCEINLINE bool TWeakObjectPtr< T, TWeakObjectPtrBase >::IsValid ( ) const
inline

Test if this points to a live UObject.

This is an optimized version implying bEvenIfPendingKill=false, bThreadsafeTest=false.

返回
true if Get() would return a valid non-null pointer

◆ IsValid() [2/2]

template<class T , class TWeakObjectPtrBase >
FORCEINLINE bool TWeakObjectPtr< T, TWeakObjectPtrBase >::IsValid ( bool  bEvenIfPendingKill,
bool  bThreadsafeTest = false 
) const
inline

Test if this points to a live UObject

参数
bEvenIfPendingKillif this is true, pendingkill objects are considered valid
bThreadsafeTestif 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).
返回
true if Get() would return a valid non-null pointer

◆ operator=() [1/2]

template<class T , class TWeakObjectPtrBase >
template<typename OtherT , typename = decltype(ImplicitConv<T*>((OtherT*)nullptr))>
FORCEINLINE TWeakObjectPtr & TWeakObjectPtr< T, TWeakObjectPtrBase >::operator= ( const TWeakObjectPtr< OtherT, TWeakObjectPtrBase > &  Other)
inline

Assign from another weak pointer, intended for derived-to-base conversions

参数
Otherweak pointer to copy from

◆ operator=() [2/2]

template<class T , class TWeakObjectPtrBase >
template<class U >
FORCEINLINE TEnableIf<!TLosesQualifiersFromTo< U, T >::Value, TWeakObjectPtr & >::Type TWeakObjectPtr< T, TWeakObjectPtrBase >::operator= ( U *  Object)
inline

Copy from an object pointer

参数
Objectobject to create a weak pointer to

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