Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

at::PtrTraits< w_ClassRef > Class Template Reference
[Smart Pointer Support]

#include <at_lifetime.h>

List of all members.

Static Public Methods

w_ClassRef FixRawPtrRefCount (w_ClassRef i_ptr)
void IncRefCount (w_ClassRef i_ptr)
void DecRefCount (w_ClassRef i_ptr)


Detailed Description

template<typename w_ClassRef>
class at::PtrTraits< w_ClassRef >

PtrTraits is a helper class that wraps AddRef() and Release() methods inside static methods having the standard names IncRefCount() and DecRefCount().

If you are using your own reference-counting scheme, i.e. one not based on methodws named AddRef() and Release(), then you will need to define your own PtrTraits class that implements the same interface as PtrTraits.

Note that these methods will work correctly with the COM IUnknown interface.


Member Function Documentation

template<typename w_ClassRef>
void at::PtrTraits< w_ClassRef >::DecRefCount w_ClassRef    i_ptr [inline, static]
 

DecRefCount() decrements the reference count of an object. Once the reference count reaches zero, the object will delete itself.

Parameters:
i_ptr  A pointer to the reference-counted object.

template<typename w_ClassRef>
w_ClassRef at::PtrTraits< w_ClassRef >::FixRawPtrRefCount w_ClassRef    i_ptr [inline, static]
 

FixRawPtrRefCount performs inrements of refernce counts when a raw pointer is passed to a PtrDelegate<> or a Ptr<>. In COMPtrTraits, this should perform a static assert and fail to compile.

Parameters:
i_ptr  A pointer to the reference-counted object.

template<typename w_ClassRef>
void at::PtrTraits< w_ClassRef >::IncRefCount w_ClassRef    i_ptr [inline, static]
 

IncRefCount() increments the reference count of an object.

Parameters:
i_ptr  A pointer to the reference-counted object.


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

Generated for Austria by doxygen and MakeXS at Sun Oct 24 17:35:34 PDT 2004