This class implements support for a reference counted auto_ptr. Assigning or copying instances of an ACE_Refcounted_Auto_Ptr will automatically increment the reference count. When the last instance that references a ACE_Refcounted_Auto_Ptr instance is destroyed or overwritten, it will invoke delete on its underlying pointer.
More...
#include <Refcounted_Auto_Ptr.h>
Detailed Description
template<class X, class ACE_LOCK>
class ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >
This class implements support for a reference counted auto_ptr. Assigning or copying instances of an ACE_Refcounted_Auto_Ptr will automatically increment the reference count. When the last instance that references a ACE_Refcounted_Auto_Ptr instance is destroyed or overwritten, it will invoke delete on its underlying pointer.
The ACE_Refcounted_Auto_Ptr works by maintaining a reference to a separate representation object, ACE_Refcounted_Auto_Ptr_Rep. That separate representation object contains the reference count and the actual pointer value.
Member Typedef Documentation
template<class X, class ACE_LOCK>
Constructor & Destructor Documentation
template<class X, class ACE_LOCK >
template<class X, class ACE_LOCK>
template<class X , class ACE_LOCK >
Destructor. Releases the reference to the underlying representation. If the release of that reference causes its reference count to reach 0, the representation object will also be destroyed.
Member Function Documentation
template<class X , class ACE_LOCK >
Get the reference count value.
template<class X , class ACE_LOCK >
template<class X , class ACE_LOCK >
Returns true
if this object does not contain a valid pointer.
template<class X , class ACE_LOCK >
template<class X , class ACE_LOCK >
template<class X, class ACE_LOCK>
Inequality operator, which is the opposite of equality.
template<class X , class ACE_LOCK >
template<class X , class ACE_LOCK >
template<class X, class ACE_LOCK>
template<class X, class ACE_LOCK>
Equality operator that returns true
if both ACE_Refcounted_Auto_Ptr objects point to the same underlying representation. It does not compare the actual pointers.
- Note
- It also returns
true
if both objects have just been instantiated and not used yet.
template<class X , class ACE_LOCK >
Releases the reference to the underlying representation object.
- Return values
-
The | pointer value prior to releasing it. |
template<class X, class ACE_LOCK >
Releases the current pointer value and then sets a new pointer value specified by p.
Member Data Documentation
template<class X, class ACE_LOCK>
Declare the dynamic allocation hooks.
template<class X, class ACE_LOCK>
The documentation for this class was generated from the following files: