PM Library classes

template < class T >
template class PMSharedPtr

? ^ 
Shared pointer class.

The PMSharedPtr class template stores a pointer to a dynamically allocated object, typically with a C++ new-expression. The object pointed to is guaranteed to be cleaned when the last PMSharedPtr pointing to it is destroyed.

You can construct, destruct, copy, and assign objects of this class.

Source:
pm_sharedptr.h:29
Author:
Dmitry A Steklenev
Version:
$Revision: 1.2 $

Contents

^ 
EntityTypeScopeShort Description
PMSharedPtrconstructor public Constructs the shared pointer.
PMSharedPtrconstructor publicConstructs the "NULL" shared pointer.
PMSharedPtrconstructor public Copy constructor.
~PMSharedPtrdestructor public Destructs the shared pointer.
operator =operator public Assignment operator.
operator *operator public Returns a reference to the pointed object.
operator *operator public Returns a reference to the pointed object.
operator ->operator public Returns a pointer to the pointed object.
operator ->operator public Returns a pointer to the pointed object.
operator const T *operator public Returns a pointer to the pointed object.
operator T *operator public Returns a pointer to the pointed object.
is_nullmethod public Returns whether the stored pointer is NULL.

constructor PMSharedPtr

? ^  > 
Constructs the shared pointer.

Use these constructor to create new objects with reference counters set to 1.

Source:
pm_sharedptr.h:85
Params:
p A pointer.
f A function object which will be applied to the pointer when the reference count will reach zero. You can use PMDelete, PMDeleteArray and PMFree function object or define your own functor.

Exception:
bad_allocIf the implementation cannot allocate memory storage.
Code:
public template < class Function > PMSharedPtr ( T * p ,
const Function & f )

constructor PMSharedPtr

? ^  < > 
Constructs the "NULL" shared pointer.
Source:
pm_sharedptr.h:90
Code:
public PMSharedPtr ( )

constructor PMSharedPtr

? ^  < > 
Copy constructor.

Use this constructor to create a copy of the given object. The constructor increments the reference count of the object holded to by the given PMSharedPtr object.

Source:
pm_sharedptr.h:100
Code:
public PMSharedPtr ( const PMSharedPtr < T > & reference )

destructor ~PMSharedPtr

? ^  < > 
Destructs the shared pointer.

This destructor destroys the PMSharedPtr object and decrements the reference count of the holded object. When the count is zero, the holded object is cleaned.

Source:
pm_sharedptr.h:112
Code:
public ~ PMSharedPtr ( )

operator =

? ^  < > 
Assignment operator.

Use this operator to modify the PMSharedPtr object so that it refers to the same object as another. If the object the pointer previously referred to was a valid object, that object's reference count is decremented. When the count is zero, that object is cleaned.

Source:
pm_sharedptr.h:123
Code:
public PMSharedPtr < T > & operator = ( const PMSharedPtr < T > & reference )

operator *

? ^  < > 
Returns a reference to the pointed object.
Source:
pm_sharedptr.h:132
Exception:
none
Code:
public T & operator * ( )

operator *

? ^  < > 
Returns a reference to the pointed object.
Source:
pm_sharedptr.h:141
Exception:
none
Code:
public const T & operator * ( ) const

operator ->

? ^  < > 
Returns a pointer to the pointed object.
Source:
pm_sharedptr.h:150
Exception:
none
Code:
public T * operator -> ( )

operator ->

? ^  < > 
Returns a pointer to the pointed object.
Source:
pm_sharedptr.h:159
Exception:
none
Code:
public const T * operator -> ( ) const

operator const T *

? ^  < > 
Returns a pointer to the pointed object.
Source:
pm_sharedptr.h:168
Exception:
none
Code:
public operator const T * ( ) const

operator T *

? ^  < > 
Returns a pointer to the pointed object.
Source:
pm_sharedptr.h:177
Exception:
none
Code:
public operator T * ( )

method is_null

? ^  < > 
Returns whether the stored pointer is NULL.
Source:
pm_sharedptr.h:186
Exception:
none
Code:
public bool is_null ( ) const

Created Fri Aug 3 09:13:16 2012.
This documentation was generated automatically by
ccdoc v08r39 2003/02/27 bin_opt_emx_os2-2.30.
Click here to submit a bug report or feature request for ccdoc.
Click here to return to the top of the page.