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 $
Entity | Type | Scope | Short Description |
PMSharedPtr | constructor | public | Constructs the shared pointer.
|
PMSharedPtr | constructor | public | Constructs the "NULL" shared pointer.
|
PMSharedPtr | constructor | public | Copy constructor.
|
~PMSharedPtr | destructor | 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_null | method | 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_alloc | If 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:
-
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:
-
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 ) |
Returns a reference to the pointed object.
- Source:
- pm_sharedptr.h:132
- Exception:
- Code:
public T & operator * ( | ) |
Returns a reference to the pointed object.
- Source:
- pm_sharedptr.h:141
- Exception:
- Code:
public const T & operator * ( | ) const |
Returns a pointer to the pointed object.
- Source:
- pm_sharedptr.h:150
- Exception:
- Code:
public T * operator -> ( | ) |
Returns a pointer to the pointed object.
- Source:
- pm_sharedptr.h:159
- Exception:
- Code:
public const T * operator -> ( | ) const |
operator const T * | ? ^
< > |
Returns a pointer to the pointed object.
- Source:
- pm_sharedptr.h:168
- Exception:
- Code:
public operator const T * ( | ) const |
Returns a pointer to the pointed object.
- Source:
- pm_sharedptr.h:177
- Exception:
- Code:
-
Returns whether the stored pointer is NULL.
- Source:
- pm_sharedptr.h:186
- Exception:
- 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.