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