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. More...
void | reset (X *p=0)
| Invokes delete on the previous pointer value and then sets the pointer value to the specified value. More...
X * | get (void)
| Get the pointer value. More...
int | count (void) const
| Get the reference count value. More...
int | null (void) const
| Allows us to check for NULL on all ACE_Refcounted_Auto_Ptr objects. More...
| ACE_Refcounted_Auto_Ptr_Rep (X *p=0)
| ~ACE_Refcounted_Auto_Ptr_Rep (void)
## Static Private Methods
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > * | internal_create (X *p)
| Allocate a new ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> instance, returning NULL if it cannot be created. More...
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. More...
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). More...
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). More...
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). More...
## Private Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...
ACE_Auto_Basic_Ptr< X > | ptr_
| Pointer to the result. More...
int | ref_count_
| Reference count. More...
ACE_LOCK | lock_
| Synchronization variable for the MT_SAFE <ACE_Hash_Map_Manager_Ex>. More...
## Friends
class | ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >

## Detailed Description

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

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<class X, class ACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::ACE_Refcounted_Auto_Ptr_Rep | ( | X * | p = 0 | ) | `[inline, private]`

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

## Member Function Documentation

template<class X, class ACE_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<class X, class ACE_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<class X, class ACE_LOCK>
int ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::count | ( | void |  | ) | const`[inline, private]`

| Get the reference count value.

template<class X, class ACE_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<class X, class ACE_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<class X, class ACE_LOCK>
X * ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::get | ( | void |  | ) | `[inline, private]`

| Get the pointer value.

template<class X, class ACE_LOCK>
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > * ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::internal_create | ( | X * | p | ) | `[inline, static, private]`

| Allocate a new ACE_Refcounted_Auto_Ptr_Rep<X, ACE_LOCK> instance, returning NULL if it cannot be created.

template<class X, class ACE_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<class X, class ACE_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<class X, class ACE_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<class X, class ACE_LOCK>
friend class ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >`[friend]`

## Member Data Documentation

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

| Declare the dynamic allocation hooks.

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

| Synchronization variable for the MT_SAFE <ACE_Hash_Map_Manager_Ex>.

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

| Pointer to the result.

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

| Reference count.

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

- Refcounted_Auto_Ptr.h
- Refcounted_Auto_Ptr.i