Windows C++ Library
|
A smart-pointer type for use with COM objects and interfaces. More...
#include <ComPtr.hpp>
Public Member Functions | |
ComPtr () | |
Default constructor. | |
ComPtr (T *pInterface, bool bAddRef=false) | |
Construction from an existing interface pointer. | |
ComPtr (const CLSID &rCLSID) | |
Construction by creating an object of the CLSID. | |
ComPtr (const ComPtr &rhs) | |
Copy constructor. | |
template<typename U > | |
ComPtr (const IFacePtr< U > &rhs) | |
Aquire a different interface for another COM object. | |
~ComPtr () | |
Destructor. | |
ComPtr & | operator= (const ComPtr &rhs) |
Assignment operator. | |
template<typename U > | |
ComPtr & | operator= (const IFacePtr< U > &rhs) |
Aquire a different interface for another COM object. | |
void | CreateInstance (const CLSID &rCLSID) |
Create an instance of the object. | |
template<typename U > | |
void | QueryInterface (const IFacePtr< U > &rhs) |
Aquire a different interface for another COM object. | |
Static Private Attributes | |
static const size_t | MAX_GUID_CHARS = 38 |
Maximum number of characters in a GUID string. |
A smart-pointer type for use with COM objects and interfaces.
This IFacePtr derived class adds the ability to create objects via their CLSIDs as well as managing the lifetimes of COM interfaces.
WCL::ComPtr< T >::ComPtr | ( | ) | [inline] |
Default constructor.
WCL::ComPtr< T >::ComPtr | ( | T * | pInterface, |
bool | bAddRef = false |
||
) | [inline, explicit] |
Construction from an existing interface pointer.
WCL::ComPtr< T >::ComPtr | ( | const CLSID & | rCLSID | ) | [inline, explicit] |
Construction by creating an object of the CLSID.
WCL::ComPtr< T >::ComPtr | ( | const ComPtr< T > & | rhs | ) | [inline] |
Copy constructor.
WCL::ComPtr< T >::ComPtr | ( | const IFacePtr< U > & | rhs | ) | [inline, explicit] |
Aquire a different interface for another COM object.
WCL::ComPtr< T >::~ComPtr | ( | ) | [inline] |
Destructor.
ComPtr< T > & WCL::ComPtr< T >::operator= | ( | const ComPtr< T > & | rhs | ) | [inline] |
Assignment operator.
ComPtr< T > & WCL::ComPtr< T >::operator= | ( | const IFacePtr< U > & | rhs | ) | [inline] |
Aquire a different interface for another COM object.
void WCL::ComPtr< T >::CreateInstance | ( | const CLSID & | rCLSID | ) | [inline] |
Create an instance of the object.
void WCL::ComPtr< T >::QueryInterface | ( | const IFacePtr< U > & | rhs | ) | [inline] |
Aquire a different interface for another COM object.
const size_t WCL::ComPtr< T >::MAX_GUID_CHARS = 38 [static, private] |
Maximum number of characters in a GUID string.