Windows C++ Library
Public Member Functions | Private Member Functions | Friends
WCL::IFacePtr< T > Class Template Reference

A smart-pointer type for use with COM interfaces. More...

#include <IFacePtr.hpp>

Inheritance diagram for WCL::IFacePtr< T >:
WCL::ComPtr< T >

List of all members.

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.
IFacePtroperator= (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.

Detailed Description

template<typename T>
class WCL::IFacePtr< T >

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.


Constructor & Destructor Documentation

template<typename T >
WCL::IFacePtr< T >::IFacePtr ( ) [inline]

Default constructor.

template<typename T >
WCL::IFacePtr< T >::IFacePtr ( T *  pInterface,
bool  bAddRef = false 
) [inline, explicit]

Construction from an existing interface pointer.

template<typename T >
WCL::IFacePtr< T >::IFacePtr ( const IFacePtr< T > &  oPtr) [inline]

Copy constructor.

template<typename T >
WCL::IFacePtr< T >::~IFacePtr ( ) [inline]

Destructor.


Member Function Documentation

template<typename T >
IFacePtr< T > & WCL::IFacePtr< T >::operator= ( const IFacePtr< T > &  oPtr) [inline]

Assignment operator.

template<typename T >
void WCL::IFacePtr< T >::Release ( ) [inline]

Release the interface.

template<typename T >
T * WCL::IFacePtr< T >::Detach ( ) [inline]

Take ownership of the interface.

template<typename T >
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.


Friends And Related Function Documentation

template<typename T >
T** AttachTo ( IFacePtr< T > &  ptr) [friend]

Allow attachment via an output parameter.

e.g. LoadTypeLib(..., AttachTo(p)).


The documentation for this class was generated from the following file: