engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 静态 Protected 成员函数 | 所有成员列表
TSharedFromThis< ObjectType, Mode > 模板类 参考

Derive your class from TSharedFromThis to enable access to a TSharedRef directly from an object instance that's already been allocated. 更多...

#include <SharedPointer.h>

被 TGenericQueuedLocalFileRequest< TLocalFileRequestCommonData< DelegateResultType > > 继承.

Public 成员函数

TSharedRef< ObjectType, Mode > AsShared ()
 Provides access to a shared reference to this object. 更多...
 
TSharedRef< ObjectType const, Mode > AsShared () const
 Provides access to a shared reference to this object (const.) Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created. 更多...
 
FORCEINLINE bool DoesSharedInstanceExist () const
 Checks whether our referenced instance is valid (ie, whether it's safe to call AsShared). 更多...
 
template<class SharedPtrType , class OtherType >
FORCEINLINE void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, Mode > const *InSharedPtr, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 
template<class SharedRefType , class OtherType >
FORCEINLINE void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, Mode > const *InSharedRef, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 

Protected 成员函数

FORCEINLINE TSharedFromThis & operator= (TSharedFromThis const &)
 Hidden stub assignment operator
 
 TSharedFromThis ()
 Hidden stub constructor
 
 TSharedFromThis (TSharedFromThis const &)
 Hidden stub copy constructor
 
 ~TSharedFromThis ()
 Hidden destructor
 

静态 Protected 成员函数

template<class OtherType >
static FORCEINLINE TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 
template<class OtherType >
static FORCEINLINE TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 

详细描述

template<class ObjectType, ESPMode Mode>
class TSharedFromThis< ObjectType, Mode >

Derive your class from TSharedFromThis to enable access to a TSharedRef directly from an object instance that's already been allocated.

Use the optional Mode template argument for thread-safety.

成员函数说明

◆ AsShared() [1/2]

template<class ObjectType , ESPMode Mode>
TSharedRef< ObjectType, Mode > TSharedFromThis< ObjectType, Mode >::AsShared ( )
inline

Provides access to a shared reference to this object.

Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created. Also note that it is illegal to call this in the object's destructor.

返回
Returns this object as a shared pointer

◆ AsShared() [2/2]

template<class ObjectType , ESPMode Mode>
TSharedRef< ObjectType const, Mode > TSharedFromThis< ObjectType, Mode >::AsShared ( ) const
inline

Provides access to a shared reference to this object (const.) Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created.

Also note that it is illegal to call this in the object's destructor.

返回
Returns this object as a shared pointer (const)

◆ DoesSharedInstanceExist()

template<class ObjectType , ESPMode Mode>
FORCEINLINE bool TSharedFromThis< ObjectType, Mode >::DoesSharedInstanceExist ( ) const
inline

Checks whether our referenced instance is valid (ie, whether it's safe to call AsShared).

If this returns false, it means that your instance has either:

  • Not yet been assigned to a shared pointer (via MakeShared or MakeShareable).
  • Is currently within its constructor (so the shared instance isn't yet available).
  • Is currently within its destructor (so the shared instance is no longer available).

◆ SharedThis() [1/2]

template<class ObjectType , ESPMode Mode>
template<class OtherType >
static FORCEINLINE TSharedRef< OtherType const, Mode > TSharedFromThis< ObjectType, Mode >::SharedThis ( const OtherType *  ThisPtr)
inlinestaticprotected

Provides access to a shared reference to an object, given the object's 'this' pointer.

Uses the 'this' pointer to derive the object's actual type, then casts and returns an appropriately typed shared reference. Intentionally declared 'protected', as should only be called when the 'this' pointer can be passed.

返回
Returns this object as a shared pointer (const)

◆ SharedThis() [2/2]

template<class ObjectType , ESPMode Mode>
template<class OtherType >
static FORCEINLINE TSharedRef< OtherType, Mode > TSharedFromThis< ObjectType, Mode >::SharedThis ( OtherType *  ThisPtr)
inlinestaticprotected

Provides access to a shared reference to an object, given the object's 'this' pointer.

Uses the 'this' pointer to derive the object's actual type, then casts and returns an appropriately typed shared reference. Intentionally declared 'protected', as should only be called when the 'this' pointer can be passed.

返回
Returns this object as a shared pointer

◆ UpdateWeakReferenceInternal() [1/2]

template<class ObjectType , ESPMode Mode>
template<class SharedPtrType , class OtherType >
FORCEINLINE void TSharedFromThis< ObjectType, Mode >::UpdateWeakReferenceInternal ( TSharedPtr< SharedPtrType, Mode > const *  InSharedPtr,
OtherType *  InObject 
) const
inline

INTERNAL USE ONLY – Do not call this method.

Freshens the internal weak pointer object using the supplied object pointer along with the authoritative shared reference to the object. Note that until this function is called, calls to AsShared() will result in an empty pointer.

◆ UpdateWeakReferenceInternal() [2/2]

template<class ObjectType , ESPMode Mode>
template<class SharedRefType , class OtherType >
FORCEINLINE void TSharedFromThis< ObjectType, Mode >::UpdateWeakReferenceInternal ( TSharedRef< SharedRefType, Mode > const *  InSharedRef,
OtherType *  InObject 
) const
inline

INTERNAL USE ONLY – Do not call this method.

Freshens the internal weak pointer object using the supplied object pointer along with the authoritative shared reference to the object. Note that until this function is called, calls to AsShared() will result in an empty pointer.


该类的文档由以下文件生成: