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

ACE_Strong_Bound_Ptr Class Template Reference

This class implements support for a reference counted pointer. More...

#include <Bound_Ptr.h>

Collaboration diagram for ACE_Strong_Bound_Ptr:

Collaboration graph
[legend]
List of all members.

Public Methods

ACE_EXPLICIT ACE_Strong_Bound_Ptr (X *p=0)
 Constructor that initializes an ACE_Strong_Bound_Ptr to point to the object <p> immediately. More...

ACE_EXPLICIT ACE_Strong_Bound_Ptr (auto_ptr< X > p)
 Constructor that initializes an ACE_Strong_Bound_Ptr by stealing ownership of an object from an auto_ptr. More...

 ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r)
 Copy constructor binds <this> and <r> to the same object. More...

 ACE_Strong_Bound_Ptr (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r)
 Constructor binds <this> and <r> to the same object. More...

 ~ACE_Strong_Bound_Ptr (void)
 Destructor. More...

void operator= (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r)
 Assignment operator that binds <this> and <r> to the same object. More...

void operator= (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r)
 Assignment operator that binds <this> and <r> to the same object. More...

int operator== (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r) const
int operator== (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r) const
int operator== (X *p) const
 Equality operator that returns 1 if the ACE_Strong_Bound_Ptr and the raw pointer point to the same underlying object. More...

int operator!= (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r) const
 Inequality operator, which is the opposite of equality. More...

int operator!= (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r) const
 Inequality operator, which is the opposite of equality. More...

int operator!= (X *p) const
 Inequality operator, which is the opposite of equality. More...

X * operator-> (void) const
 Redirection operator. More...

X & operator * (void) const
 Dereference operator. More...

X * get (void)
 Get the pointer value. More...

void reset (X *p=0)
 Resets the ACE_Strong_Bound_Ptr to refer to a different underlying object. More...

void reset (auto_ptr< X > p)
 Resets the ACE_Strong_Bound_Ptr to refer to a different underlying object, ownership of which is stolen from the auto_ptr. More...

int null (void) const
 Allows us to check for NULL on all ACE_Strong_Bound_Ptr objects. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Types

typedef ACE_Bound_Ptr_Counter<
ACE_LOCK > 
COUNTER
 The ACE_Bound_Ptr_Counter type. More...


Private Attributes

COUNTERcounter_
 The reference counter. More...

X * ptr_
 The underlying object. More...


Friends

class ACE_Weak_Bound_Ptr< X, ACE_LOCK >

Detailed Description

template<class X, class ACE_LOCK>
class ACE_Strong_Bound_Ptr< X, ACE_LOCK >

This class implements support for a reference counted pointer.

Assigning or copying instances of an ACE_Strong_Bound_Ptr will automatically increment the reference count of the underlying object. When the last instance of an ACE_Strong_Bound_Ptr that references a particular object is destroyed or overwritten, it will invoke delete on its underlying pointer.


Member Typedef Documentation

template<class X, class ACE_LOCK>
typedef ACE_Bound_Ptr_Counter<ACE_LOCK> ACE_Strong_Bound_Ptr::COUNTER [private]
 

The ACE_Bound_Ptr_Counter type.


Constructor & Destructor Documentation

template<class X, class ACE_LOCK>
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::ACE_Strong_Bound_Ptr X *    p = 0 [inline]
 

Constructor that initializes an ACE_Strong_Bound_Ptr to point to the object <p> immediately.

template<class X, class ACE_LOCK>
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::ACE_Strong_Bound_Ptr auto_ptr< X >    p [inline]
 

Constructor that initializes an ACE_Strong_Bound_Ptr by stealing ownership of an object from an auto_ptr.

template<class X, class ACE_LOCK>
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::ACE_Strong_Bound_Ptr const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &    r [inline]
 

Copy constructor binds <this> and <r> to the same object.

template<class X, class ACE_LOCK>
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::ACE_Strong_Bound_Ptr const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &    r [inline]
 

Constructor binds <this> and <r> to the same object.

template<class X, class ACE_LOCK>
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::~ACE_Strong_Bound_Ptr void    [inline]
 

Destructor.


Member Function Documentation

template<class X, class ACE_LOCK>
X * ACE_Strong_Bound_Ptr< X, ACE_LOCK >::get void    [inline]
 

Get the pointer value.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::null void    const [inline]
 

Allows us to check for NULL on all ACE_Strong_Bound_Ptr objects.

template<class X, class ACE_LOCK>
X & ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator * void    const [inline]
 

Dereference operator.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator!= X *    p const [inline]
 

Inequality operator, which is the opposite of equality.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator!= const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &    r const [inline]
 

Inequality operator, which is the opposite of equality.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator!= const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &    r const [inline]
 

Inequality operator, which is the opposite of equality.

template<class X, class ACE_LOCK>
X * ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator-> void    const [inline]
 

Redirection operator.

template<class X, class ACE_LOCK>
void ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator= const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &    rhs [inline]
 

Assignment operator that binds <this> and <r> to the same object.

template<class X, class ACE_LOCK>
void ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator= const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &    rhs [inline]
 

Assignment operator that binds <this> and <r> to the same object.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator== X *    p const [inline]
 

Equality operator that returns 1 if the ACE_Strong_Bound_Ptr and the raw pointer point to the same underlying object.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator== const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &    r const [inline]
 

Note:
It also returns 1 if both objects have just been instantiated and not used yet.

template<class X, class ACE_LOCK>
int ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator== const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &    r const [inline]
 

Note:
It also returns 1 if both objects have just been instantiated and not used yet.

template<class X, class ACE_LOCK>
void ACE_Strong_Bound_Ptr< X, ACE_LOCK >::reset auto_ptr< X >    p [inline]
 

Resets the ACE_Strong_Bound_Ptr to refer to a different underlying object, ownership of which is stolen from the auto_ptr.

template<class X, class ACE_LOCK>
void ACE_Strong_Bound_Ptr< X, ACE_LOCK >::reset X *    p = 0 [inline]
 

Resets the ACE_Strong_Bound_Ptr to refer to a different underlying object.


Friends And Related Function Documentation

template<class X, class ACE_LOCK>
friend class ACE_Weak_Bound_Ptr< X, ACE_LOCK > [friend]
 


Member Data Documentation

template<class X, class ACE_LOCK>
ACE_Strong_Bound_Ptr::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

template<class X, class ACE_LOCK>
COUNTER* ACE_Strong_Bound_Ptr::counter_ [private]
 

The reference counter.

template<class X, class ACE_LOCK>
X* ACE_Strong_Bound_Ptr::ptr_ [private]
 

The underlying object.


The documentation for this class was generated from the following files:
Generated on Sun Dec 1 11:28:27 2002 for ACE by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001