Windows C++ Library
|
A smart-pointer type for use with COM interfaces. More...
#include <IFacePtr.hpp>
Public Member Functions | |
IFacePtr () | |
Default constructor. | |
IFacePtr (T *pInterface, bool bAddRef=false) | |
Construction from an existing interface pointer. | |
IFacePtr (const IFacePtr &oPtr) | |
Copy constructor. | |
~IFacePtr () | |
Destructor. | |
IFacePtr & | operator= (const IFacePtr &oPtr) |
Assignment operator. | |
void | Release () |
Release the interface. | |
T * | Detach () |
Take ownership of the interface. | |
Private Member Functions | |
T ** | GetPtrMember () |
Access the underlying pointer member. | |
Friends | |
T ** | AttachTo (IFacePtr< T > &ptr) |
Allow attachment via an output parameter. |
A smart-pointer type for use with COM interfaces.
This class can only be used to manage the lifetime of COM interfaces, to create COM objects and aquire other interfaces use the ComPtr<T> class.
WCL::IFacePtr< T >::IFacePtr | ( | ) | [inline] |
Default constructor.
WCL::IFacePtr< T >::IFacePtr | ( | T * | pInterface, |
bool | bAddRef = false |
||
) | [inline, explicit] |
Construction from an existing interface pointer.
WCL::IFacePtr< T >::IFacePtr | ( | const IFacePtr< T > & | oPtr | ) | [inline] |
Copy constructor.
WCL::IFacePtr< T >::~IFacePtr | ( | ) | [inline] |
Destructor.
IFacePtr< T > & WCL::IFacePtr< T >::operator= | ( | const IFacePtr< T > & | oPtr | ) | [inline] |
Assignment operator.
void WCL::IFacePtr< T >::Release | ( | ) | [inline] |
Release the interface.
T * WCL::IFacePtr< T >::Detach | ( | ) | [inline] |
Take ownership of the interface.
T ** WCL::IFacePtr< T >::GetPtrMember | ( | ) | [inline, private] |
Access the underlying pointer member.
This is used by the AttachTo() friend function to access the underlying SmartPtr<T> member variable.
Allow attachment via an output parameter.
e.g. LoadTypeLib(..., AttachTo(p)).