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

ACE_Bound_Ptr_Counter Class Template Reference

An ACE_Bound_Ptr_Counter object encapsulates an object reference count. Do not use this class directly, use ACE_Strong_Bound_Ptr or ACE_Weak_Bound_Ptr instead. More...

#include <Bound_Ptr.h>

List of all members.

Public Methods

 ACE_Bound_Ptr_Counter (int init_obj_ref_count = 0)
 ~ACE_Bound_Ptr_Counter (void)

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Static Public Methods

ACE_Bound_Ptr_Counter<ACE_LOCK>* create_strong (void)
 Create a ACE_Bound_Ptr_Counter and initialize the reference count to indicate ownership by a strong pointer.

int attach_strong (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter)
 Increase both the object and counter reference counts and return the new object reference count. A return value of -1 indicates that the object has already been destroyed.

int detach_strong (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter)
 Decreases both the object and counter reference counts and deletes whichever has no more references. Returns the new object reference count.

ACE_Bound_Ptr_Counter<ACE_LOCK>* create_weak (void)
 Create a ACE_Bound_Ptr_Counter and initialize the reference count to indicate no ownership.

void attach_weak (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter)
 Increase the counter reference count and return argument.

void detach_weak (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter)
 Decreases the counter reference count and deletes the counter if it has no more references.

int object_was_deleted (ACE_Bound_Ptr_Counter<ACE_LOCK> *counter)
 Determine whether the object has been deleted.


Private Attributes

int obj_ref_count_
 Reference count of underlying object. Is set to -1 once the object has been destroyed to indicate to all weak pointers that it is no longer valid.

int self_ref_count_
 Reference count of this counter.

ACE_LOCK lock_
 Mutex variable to synchronize access to the reference counts.


Detailed Description

template<class ACE_LOCK> template class ACE_Bound_Ptr_Counter

An ACE_Bound_Ptr_Counter object encapsulates an object reference count. Do not use this class directly, use ACE_Strong_Bound_Ptr or ACE_Weak_Bound_Ptr instead.


Constructor & Destructor Documentation

template<classACE_LOCK>
ACE_Bound_Ptr_Counter< ACE_LOCK >::ACE_Bound_Ptr_Counter<ACE_LOCK> ( int init_obj_ref_count = 0 ) [inline]
 

template<classACE_LOCK>
ACE_Bound_Ptr_Counter< ACE_LOCK >::~ACE_Bound_Ptr_Counter<ACE_LOCK> ( void ) [inline]
 


Member Function Documentation

template<classACE_LOCK>
int ACE_Bound_Ptr_Counter< ACE_LOCK >::attach_strong ( ACE_Bound_Ptr_Counter< ACE_LOCK >* counter ) [inline, static]
 

Increase both the object and counter reference counts and return the new object reference count. A return value of -1 indicates that the object has already been destroyed.

template<classACE_LOCK>
void ACE_Bound_Ptr_Counter< ACE_LOCK >::attach_weak ( ACE_Bound_Ptr_Counter< ACE_LOCK >* counter ) [inline, static]
 

Increase the counter reference count and return argument.

template<classACE_LOCK>
ACE_Bound_Ptr_Counter< ACE_LOCK >* ACE_Bound_Ptr_Counter< ACE_LOCK >::create_strong ( void ) [inline, static]
 

Create a ACE_Bound_Ptr_Counter and initialize the reference count to indicate ownership by a strong pointer.

template<classACE_LOCK>
ACE_Bound_Ptr_Counter< ACE_LOCK >* ACE_Bound_Ptr_Counter< ACE_LOCK >::create_weak ( void ) [inline, static]
 

Create a ACE_Bound_Ptr_Counter and initialize the reference count to indicate no ownership.

template<classACE_LOCK>
int ACE_Bound_Ptr_Counter< ACE_LOCK >::detach_strong ( ACE_Bound_Ptr_Counter< ACE_LOCK >* counter ) [inline, static]
 

Decreases both the object and counter reference counts and deletes whichever has no more references. Returns the new object reference count.

template<classACE_LOCK>
void ACE_Bound_Ptr_Counter< ACE_LOCK >::detach_weak ( ACE_Bound_Ptr_Counter< ACE_LOCK >* counter ) [inline, static]
 

Decreases the counter reference count and deletes the counter if it has no more references.

template<classACE_LOCK>
int ACE_Bound_Ptr_Counter< ACE_LOCK >::object_was_deleted ( ACE_Bound_Ptr_Counter< ACE_LOCK >* counter ) [inline, static]
 

Determine whether the object has been deleted.


Member Data Documentation

template<classACE_LOCK>
ACE_Bound_Ptr_Counter<ACE_LOCK>::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

template<classACE_LOCK>
ACE_LOCK ACE_Bound_Ptr_Counter<ACE_LOCK>::lock_ [private]
 

Mutex variable to synchronize access to the reference counts.

template<classACE_LOCK>
int ACE_Bound_Ptr_Counter<ACE_LOCK>::obj_ref_count_ [private]
 

Reference count of underlying object. Is set to -1 once the object has been destroyed to indicate to all weak pointers that it is no longer valid.

template<classACE_LOCK>
int ACE_Bound_Ptr_Counter<ACE_LOCK>::self_ref_count_ [private]
 

Reference count of this counter.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:29:47 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000