Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Refcounted_Auto_Ptr_Rep Class Template Reference

An ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> object incapsulates a pointer to an object of type X. It is pointed to by ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> object[s] and only accessible through them. More...

`#include <Refcounted_Auto_Ptr.h>`

Collaboration diagram for ACE_Refcounted_Auto_Ptr_Rep:

[legend]
List of all members.

## Private Methods
X* | release (void)
| Sets the pointer value to 0 and returns its old value.
void | reset (X *p = 0)
| Invokes delete on the previous pointer value and then sets the pointer value to the specified value.
X* | get (void)
| Get the pointer value.
int | null (void) const
| Allows us to check for NULL on all ACE_Refcounted_Auto_Ptr objects.
| ACE_Refcounted_Auto_Ptr_Rep (X *p = 0)
| ~ACE_Refcounted_Auto_Ptr_Rep (void)
## Private Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks.
ACE_Auto_Basic_Ptr<X> | ptr_
| Pointer to the result.
int | ref_count_
| Reference count.
ACE_LOCK | lock_
| Synchronization variable for the MT_SAFE .
## Static Private Methods
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK>* | create (X *p)
| Create a ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> and initialize the reference count.
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK>* | attach (ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> *&rep)
| Increase the reference count and return argument. Uses the attribute "ace_lock_" to synchronize reference count updating. Precondition (rep != 0).
void | detach (ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> *&rep)
| Decreases the reference count and and deletes rep if there are no more references to rep. Precondition (rep != 0).
void | assign (ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> *&rep, ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> *new_rep)
| Decreases the rep's reference count and and deletes rep if there are no more references to rep. Then assigns new_rep to rep. Precondition (rep != 0 && new_rep != 0).
## Friends
class | ACE_Refcounted_Auto_Ptr< X,ACE_LOCK >

## Detailed Description

### template<class X, class ACE_LOCK> template class ACE_Refcounted_Auto_Ptr_Rep

An ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> object incapsulates a pointer to an object of type X. It is pointed to by ACE_Refcounted_Auto_Ptr<X, ACE_LOCK> object[s] and only accessible through them.

## Constructor & Destructor Documentation

template<classX, classACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> ( | X * p = 0 )`[inline, private]`

template<classX, classACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::~ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> ( | void )`[inline, private]`

## Member Function Documentation

template<classX, classACE_LOCK>
void ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::assign ( | ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >*& rep,
| ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >* new_rep )`[inline, static, private]`

| Decreases the rep's reference count and and deletes rep if there are no more references to rep. Then assigns new_rep to rep. Precondition (rep != 0 && new_rep != 0).

template<classX, classACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >* ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::attach ( | ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >*& rep )`[inline, static, private]`

| Increase the reference count and return argument. Uses the attribute "ace_lock_" to synchronize reference count updating. Precondition (rep != 0).

template<classX, classACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >* ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::create ( | X * p )`[inline, static, private]`

| Create a ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> and initialize the reference count.

template<classX, classACE_LOCK>
void ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::detach ( | ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >*& rep )`[inline, static, private]`

| Decreases the reference count and and deletes rep if there are no more references to rep. Precondition (rep != 0).

template<classX, classACE_LOCK>
X * ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::get ( | void )`[inline, private]`

| Get the pointer value.

template<classX, classACE_LOCK>
int ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::null ( | void ) const`[inline, private]`

| Allows us to check for NULL on all ACE_Refcounted_Auto_Ptr objects.

template<classX, classACE_LOCK>
X * ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::release ( | void )`[inline, private]`

| Sets the pointer value to 0 and returns its old value.

template<classX, classACE_LOCK>
void ACE_Refcounted_Auto_Ptr_Rep< X,ACE_LOCK >::reset ( | X * p = 0 )`[inline, private]`

| Invokes delete on the previous pointer value and then sets the pointer value to the specified value.

## Friends And Related Function Documentation

template<classX, classACE_LOCK>
class ACE_Refcounted_Auto_Ptr`[friend]`

## Member Data Documentation

template<classX, classACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::ACE_ALLOC_HOOK_DECLARE`[private]`

| Declare the dynamic allocation hooks.

template<classX, classACE_LOCK>
ACE_LOCK ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::lock_`[private]`

| Synchronization variable for the MT_SAFE .

template<classX, classACE_LOCK>
ACE_Auto_Basic_Ptr< X > ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::ptr_`[private]`

| Pointer to the result.

template<classX, classACE_LOCK>
int ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK>::ref_count_`[private]`

| Reference count.

The documentation for this class was generated from the following files:

- Refcounted_Auto_Ptr.h
- Refcounted_Auto_Ptr.i