ACE 8.0.0
Loading...
Searching...
No Matches
Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > Class Template Reference

An ACE_Refcounted_Auto_Ptr_Rep object encapsulates a pointer to an object of type X. It uses a lock object of type ACE_LOCK to protect access to the reference count. More...

#include <Refcounted_Auto_Ptr.h>

Collaboration diagram for ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >:
Collaboration graph
[legend]

Private Member Functions

Xget () const
 Get the pointer value.
 
long count () const
 Get the reference count value.
 
 ACE_Refcounted_Auto_Ptr_Rep (X *p=nullptr)
 
 ~ACE_Refcounted_Auto_Ptr_Rep ()
 

Static Private Member Functions

static ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > * internal_create (X *p)
 
static ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > * create (X *p)
 
static ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > * attach (ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > *&rep)
 
static void detach (ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK > *&rep)
 

Private Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 
std::unique_ptr< Xptr_
 Pointer to the result.
 
ACE_Atomic_Op< ACE_LOCK, longref_count_
 Reference count.
 

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 object encapsulates a pointer to an object of type X. It uses a lock object of type ACE_LOCK to protect access to the reference count.

ACE_Refcounted_Auto_Ptr_Rep is used internally by the ACE_Refcounted_Auto_Ptr class and is only accessible through it.

Constructor & Destructor Documentation

◆ ACE_Refcounted_Auto_Ptr_Rep()

template<class X , class ACE_LOCK >
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::ACE_Refcounted_Auto_Ptr_Rep ( X * p = nullptr)
inlineprivate

◆ ~ACE_Refcounted_Auto_Ptr_Rep()

template<class X , class ACE_LOCK >
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::~ACE_Refcounted_Auto_Ptr_Rep ( )
inlineprivate

Member Function Documentation

◆ attach()

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)
inlinestaticprivate

Increase the reference count on rep.

Return values

a rep if success, 0 if there's an error obtaining the lock on rep.

◆ count()

template<class X , class ACE_LOCK >
long ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::count ( ) const
inlineprivate

Get the reference count value.

◆ create()

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)
inlinestaticprivate

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

◆ detach()

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)
inlinestaticprivate

Decreases the reference count and and deletes rep if there are no more references to rep.

Precondition (rep != 0)

◆ get()

template<class X , class ACE_LOCK >
X * ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::get ( ) const
inlineprivate

Get the pointer value.

◆ internal_create()

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)
inlinestaticprivate

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

Friends And Related Symbol Documentation

◆ ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >

template<class X , class ACE_LOCK >
friend class ACE_Refcounted_Auto_Ptr< X, ACE_LOCK >
friend

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<class X , class ACE_LOCK >
ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::ACE_ALLOC_HOOK_DECLARE
private

Declare the dynamic allocation hooks.

◆ ptr_

template<class X , class ACE_LOCK >
std::unique_ptr<X> ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::ptr_
private

Pointer to the result.

◆ ref_count_

template<class X , class ACE_LOCK >
ACE_Atomic_Op<ACE_LOCK, long> ACE_Refcounted_Auto_Ptr_Rep< X, ACE_LOCK >::ref_count_
mutableprivate

Reference count.


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