ACE_Refcounted_Auto_Ptr< X, ACE_LOCK > Class Template ReferenceThis 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...
Collaboration diagram for ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >:
Detailed Descriptiontemplate<class X, class 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.
|
typedef ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::AUTO_REFCOUNTED_PTR_REP [protected] |
ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::ACE_Refcounted_Auto_Ptr | ( | X * | p = 0 |
) | [inline, explicit] |
Constructor that initializes an ACE_Refcounted_Auto_Ptr to the specified pointer value.
ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::ACE_Refcounted_Auto_Ptr | ( | const ACE_Refcounted_Auto_Ptr< X, ACE_LOCK > & | r | ) | [inline] |
Copy constructor binds the new ACE_Refcounted_Auto_Ptr to the representation object referenced by r. An ACE_Refcounted_Auto_Ptr_Rep is created if necessary.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::~ACE_Refcounted_Auto_Ptr | ( | void | ) | [inline, 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.
void ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator= | ( | const ACE_Refcounted_Auto_Ptr< X, ACE_LOCK > & | r | ) | [inline] |
Assignment operator that binds the current object and r to the same ACE_Refcounted_Auto_Ptr_Rep. An ACE_Refcounted_Auto_Ptr_Rep is created if necessary.
bool ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator== | ( | const ACE_Refcounted_Auto_Ptr< X, ACE_LOCK > & | r | ) | const [inline] |
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.
true
if both objects have just been instantiated and not used yet. bool ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator!= | ( | const ACE_Refcounted_Auto_Ptr< X, ACE_LOCK > & | r | ) | const [inline] |
Inequality operator, which is the opposite of equality.
X * ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator-> | ( | void | ) | const [inline] |
Redirection operator.
X & ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator* | ( | ) | const [inline] |
Accessor method.
bool ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator! | ( | ) | const [inline] |
Check rep easily.
ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::operator bool | ( | ) | const [inline] |
Check rep easily.
X * ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::release | ( | void | ) | [inline] |
Releases the reference to the underlying representation object.
The | pointer value prior to releasing it. |
void ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::reset | ( | X * | p = 0 |
) | [inline] |
Releases the current pointer value and then sets a new pointer value specified by p.
X * ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::get | ( | void | ) | const [inline] |
Get the pointer value.
long ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::count | ( | void | ) | const [inline] |
Get the reference count value.
bool ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::null | ( | void | ) | const [inline] |
Returns true
if this object does not contain a valid pointer.
ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
AUTO_REFCOUNTED_PTR_REP* ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >::rep_ [protected] |
Protect operations on the ACE_Refcounted_Auto_Ptr.