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>
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.
◆ AUTO_REFCOUNTED_PTR_REP
template<class X, class ACE_LOCK>
◆ ACE_Refcounted_Auto_Ptr() [1/2]
template<class X, class ACE_LOCK >
◆ ACE_Refcounted_Auto_Ptr() [2/2]
template<class X, class ACE_LOCK>
◆ ~ACE_Refcounted_Auto_Ptr()
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.
◆ count()
template<class X , class ACE_LOCK >
Get the reference count value.
◆ get()
template<class X , class ACE_LOCK >
◆ null()
template<class X , class ACE_LOCK >
Returns true
if this object does not contain a valid pointer.
◆ operator bool()
template<class X , class ACE_LOCK >
◆ operator!()
template<class X , class ACE_LOCK >
◆ operator!=()
template<class X, class ACE_LOCK>
Inequality operator, which is the opposite of equality.
◆ operator*()
template<class X , class ACE_LOCK >
◆ operator->()
template<class X , class ACE_LOCK >
◆ operator=()
template<class X, class ACE_LOCK>
◆ operator==()
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.
◆ release()
template<class X , class ACE_LOCK >
Releases the reference to the underlying representation object.
- Return values
-
The | pointer value prior to releasing it. |
◆ reset()
template<class X, class ACE_LOCK >
Releases the current pointer value and then sets a new pointer value specified by p.
◆ ACE_ALLOC_HOOK_DECLARE
template<class X, class ACE_LOCK>
Declare the dynamic allocation hooks.
◆ rep_
template<class X, class ACE_LOCK>
The documentation for this class was generated from the following files: