engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TComPtr< T > 模板类 参考

Smart COM object pointer. 更多...

#include <COMPointer.h>

Public 成员函数

void Attach (PointerType *Object)
 Set the pointer without adding a reference. 更多...
 
void Detach ()
 Reset the pointer without releasing a reference. 更多...
 
HRESULT FromQueryInterface (REFIID Riid, IUnknown *Unknown)
 Initialize this pointer from a COM interface to be queried. 更多...
 
FORCEINLINE PointerType * Get () const
 Get raw pointer to the object pointed to. 更多...
 
FORCEINLINE const bool IsValid () const
 Whether this pointer is pointing to an actual object. 更多...
 
TComPtr< PointerType > & operator= (const TComPtr< PointerType > &Other)
 Copy assignment operator. 更多...
 
TComPtr< PointerType > & operator= (PointerType *const Object)
 Assignment operator. 更多...
 
TComPtr< PointerType > & operator= (TComPtr< PointerType > &&Other)
 Move assignment operator. 更多...
 
void Reset ()
 Reset this pointer to null.
 
 TComPtr ()
 Default constructor (initialized to null).
 
 TComPtr (const TComPtr< PointerType > &Other)
 Copy constructor. 更多...
 
 TComPtr (PointerType *const Object)
 Create and initialize a new instance. 更多...
 
 TComPtr (TComPtr< PointerType > &&Other)
 Move constructor. 更多...
 
 ~TComPtr ()
 Destructor.
 

详细描述

template<typename T>
class TComPtr< T >

Smart COM object pointer.

构造及析构函数说明

◆ TComPtr() [1/3]

template<typename T >
TComPtr< T >::TComPtr ( PointerType *const  Object)
inline

Create and initialize a new instance.

参数
ObjectThe object to point to.

◆ TComPtr() [2/3]

template<typename T >
TComPtr< T >::TComPtr ( const TComPtr< PointerType > &  Other)
inline

Copy constructor.

参数
OtherThe instance to copy.

◆ TComPtr() [3/3]

template<typename T >
TComPtr< T >::TComPtr ( TComPtr< PointerType > &&  Other)
inline

Move constructor.

参数
OtherThe instance to move.

成员函数说明

◆ Attach()

template<typename T >
void TComPtr< T >::Attach ( PointerType *  Object)
inline

Set the pointer without adding a reference.

参数
InRawPointerThe object to point to.
参见
Detach

◆ Detach()

template<typename T >
void TComPtr< T >::Detach ( )
inline

Reset the pointer without releasing a reference.

参见
Attach

◆ FromQueryInterface()

template<typename T >
HRESULT TComPtr< T >::FromQueryInterface ( REFIID  Riid,
IUnknown *  Unknown 
)
inline

Initialize this pointer from a COM interface to be queried.

参数
RiidThe ID of the interface to be queried.
UnknownThe object to query the interface from.
返回
The result code of the query.

◆ Get()

template<typename T >
FORCEINLINE PointerType * TComPtr< T >::Get ( ) const
inline

Get raw pointer to the object pointed to.

返回
Pointer to the object, or NULL if not valid.
参见
IsValid

◆ IsValid()

template<typename T >
FORCEINLINE const bool TComPtr< T >::IsValid ( ) const
inline

Whether this pointer is pointing to an actual object.

返回
true if the pointer is valid, false otherwise.
参见
Get

◆ operator=() [1/3]

template<typename T >
TComPtr< PointerType > & TComPtr< T >::operator= ( const TComPtr< PointerType > &  Other)
inline

Copy assignment operator.

参数
OtherThe instance to copy.

◆ operator=() [2/3]

template<typename T >
TComPtr< PointerType > & TComPtr< T >::operator= ( PointerType *const  Object)
inline

Assignment operator.

参数
ObjectThe object to point to.

◆ operator=() [3/3]

template<typename T >
TComPtr< PointerType > & TComPtr< T >::operator= ( TComPtr< PointerType > &&  Other)
inline

Move assignment operator.

参数
OtherThe instance to move.

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