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

at::PtrTarget_Generic< w_count_t, w_ptr_style_traits > Class Template Reference

#include <at_lifetime.h>

Inheritance diagram for at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >:

Inheritance graph
[legend]
Collaboration diagram for at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef w_ptr_style_traits t_ptr_style

Public Methods

virtual ~PtrTarget_Generic ()
 PtrTarget_Generic ()
 PtrTarget_Generic (const PtrTarget_Generic &)
PtrTarget_Generic & operator= (const PtrTarget_Generic &)
int AddRef () const
int Release () const

Friends

class PtrTarget_Helpers< w_count_t, w_ptr_style_traits >
class AT_TEST_LifeControlExp
struct MPT_Finder

Detailed Description

template<typename w_count_t, typename w_ptr_style_traits>
class at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >

PtrTarget_Generic is a generic reference counting class that is suitable for multi-threaded or non multi-threaded use. This is done by substitution of the w_count. For multi-threaded use, make the w_count parameter an atomic count.
Parameters:
w_count  the count type - this can be any type that supports pre-increment or pre-decrement and compares equal to or greater than zero.


Member Typedef Documentation

template<typename w_count_t, typename w_ptr_style_traits>
typedef w_ptr_style_traits at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::t_ptr_style
 

t_ptr_style defines the style type of this class.


Constructor & Destructor Documentation

template<typename w_count_t, typename w_ptr_style_traits>
virtual at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::~PtrTarget_Generic   [inline, virtual]
 

template<typename w_count_t, typename w_ptr_style_traits>
at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::PtrTarget_Generic   [inline]
 

PtrTarget_Generic() initializes with a reference count of 1. Upon creation, the object has has a reference (the creator) and so the reference count is set to InitCount.

template<typename w_count_t, typename w_ptr_style_traits>
at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::PtrTarget_Generic const PtrTarget_Generic< w_count_t, w_ptr_style_traits > &    [inline]
 

The copy constructor also initializes with a reference count of 1. The reference count is a count of the references to this which has nothing to do with the object that is being copied. Hence the reference count on copy construction is also set to InitCount.


Member Function Documentation

template<typename w_count_t, typename w_ptr_style_traits>
int at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::AddRef   const [inline]
 

The AddRef() method adds 1 to the reference count to this object.

Returns:
The current reference count.

template<typename w_count_t, typename w_ptr_style_traits>
PtrTarget_Generic& at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::operator= const PtrTarget_Generic< w_count_t, w_ptr_style_traits > &    [inline]
 

Assignment operator. The reference count of the parameter has no bearing on the count of references to this. This is why the input parameter reference count is ignored.

template<typename w_count_t, typename w_ptr_style_traits>
int at::PtrTarget_Generic< w_count_t, w_ptr_style_traits >::Release   const [inline]
 

The Release() method decrements by 1 the reference count to this object. Once all references have been released (the reference count is zero), the PtrTarget implementation is expected to delete itself. The act of "deleting itself" may be determinted to be different for each kind of implementation.

Returns:
The current reference count.


Friends And Related Function Documentation

template<typename w_count_t, typename w_ptr_style_traits>
friend class AT_TEST_LifeControlExp [friend]
 

template<typename w_count_t, typename w_ptr_style_traits>
friend struct MPT_Finder [friend]
 

template<typename w_count_t, typename w_ptr_style_traits>
friend class PtrTarget_Helpers< w_count_t, w_ptr_style_traits > [friend]
 

PtrTarget_Helpers allows access to internal methods


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