Public Types | Public Member Functions | List of all members
iwin::TComPtr< Type > Class Template Reference

Pointer wrapper providing access to Windows COM objects. More...

#include <TComPtr.h>

Inheritance diagram for iwin::TComPtr< Type >:
istd::TPointerBase< Type >

Public Types

typedef istd::TPointerBase< Type > BaseClass
 

Public Member Functions

 TComPtr (Type *ptr=NULL, bool addRef=true)
 Set new value of internal pointer. More...
 
 TComPtr (const TComPtr &ptr)
 Copy constructor. More...
 
 ~TComPtr ()
 Destructor. More...
 
bool CoCreateInstance (REFCLSID rclsid, IUnknown *outerPtr=NULL, quint32 clsContext=CLSCTX_ALL)
 Create instance of COM object using its CLSID. More...
 
void Reset ()
 It decreses COM reference pointer and set this pointer to NULL. More...
 
void SetPtr (Type *ptr, bool addRef=true)
 Set new value of internal pointer. More...
 
Type * PopPtr ()
 Reset internal pointer value without decreasing of reference counter. More...
 
void TakeOver (TComPtr &sourcePtr)
 Take internal pointer over. More...
 
void IncRef ()
 Increase reference counter. More...
 
void DecRef ()
 Decrease reference counter. More...
 
TComPtroperator= (const TComPtr &ptr)
 Assign operator. More...
 
Type ** operator& ()
 Address operator. More...
 

Detailed Description

template<class Type>
class iwin::TComPtr< Type >

Pointer wrapper providing access to Windows COM objects.

Definition at line 20 of file TComPtr.h.

Member Typedef Documentation

template<class Type>
typedef istd::TPointerBase<Type> iwin::TComPtr< Type >::BaseClass

Definition at line 23 of file TComPtr.h.

Constructor & Destructor Documentation

template<class Type >
iwin::TComPtr< Type >::TComPtr ( Type *  ptr = NULL,
bool  addRef = true 
)
inline

Set new value of internal pointer.

Definition at line 90 of file TComPtr.h.

References iwin::TComPtr< Type >::IncRef().

template<class Type >
iwin::TComPtr< Type >::TComPtr ( const TComPtr< Type > &  ptr)
inline

Copy constructor.

It increase COM reference pointer.

Definition at line 100 of file TComPtr.h.

References iwin::TComPtr< Type >::IncRef().

template<class Type >
iwin::TComPtr< Type >::~TComPtr ( )
inline

Destructor.

It decreses COM reference pointer.

Definition at line 108 of file TComPtr.h.

Member Function Documentation

template<class Type >
bool iwin::TComPtr< Type >::CoCreateInstance ( REFCLSID  rclsid,
IUnknown *  outerPtr = NULL,
quint32  clsContext = CLSCTX_ALL 
)

Create instance of COM object using its CLSID.

Definition at line 161 of file TComPtr.h.

template<class Type >
void iwin::TComPtr< Type >::DecRef ( )

Decrease reference counter.

Definition at line 182 of file TComPtr.h.

References NULL.

template<class Type >
void iwin::TComPtr< Type >::IncRef ( )

Increase reference counter.

Definition at line 170 of file TComPtr.h.

References NULL.

Referenced by iwin::TComPtr< Type >::TComPtr().

template<class Type >
Type ** iwin::TComPtr< Type >::operator& ( )
inline

Address operator.

Definition at line 152 of file TComPtr.h.

template<class Type >
TComPtr< Type > & iwin::TComPtr< Type >::operator= ( const TComPtr< Type > &  ptr)

Assign operator.

Definition at line 194 of file TComPtr.h.

template<class Type >
Type * iwin::TComPtr< Type >::PopPtr ( )
inline

Reset internal pointer value without decreasing of reference counter.

Definition at line 135 of file TComPtr.h.

References NULL.

Referenced by iwin::TComPtr< Type >::TakeOver().

template<class Type >
void iwin::TComPtr< Type >::Reset ( )
inline

It decreses COM reference pointer and set this pointer to NULL.

Definition at line 115 of file TComPtr.h.

References NULL.

template<class Type >
void iwin::TComPtr< Type >::SetPtr ( Type *  ptr,
bool  addRef = true 
)
inline

Set new value of internal pointer.

Definition at line 122 of file TComPtr.h.

template<class Type >
void iwin::TComPtr< Type >::TakeOver ( TComPtr< Type > &  sourcePtr)

Take internal pointer over.

It set pointer from other object and detach it from them.

Definition at line 145 of file TComPtr.h.

References iwin::TComPtr< Type >::PopPtr().


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

© 2007-2011 Witold Gantzke and Kirill Lepskiy