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

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

#include <Bound_Ptr.h>

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

Public Member Functions

 ACE_Strong_Bound_Ptr (X *p=0)
 
 ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r)
 Copy constructor binds this and r to the same object.
 
 ACE_Strong_Bound_Ptr (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r)
 Constructor binds this and r to the same object.
 
template<class Y >
 ACE_Strong_Bound_Ptr (const ACE_Strong_Bound_Ptr< Y, ACE_LOCK > &r)
 
 ~ACE_Strong_Bound_Ptr ()
 Destructor.
 
void operator= (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r)
 Assignment operator that binds this and r to the same object.
 
void operator= (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r)
 Assignment operator that binds this and r to the same object.
 
template<class Y >
ACE_Weak_Bound_Ptr< X, ACE_LOCK > & operator= (const ACE_Strong_Bound_Ptr< Y, ACE_LOCK > &r)
 
bool operator== (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r) const
 
bool operator== (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r) const
 
bool operator== (X *p) const
 
bool operator!= (const ACE_Strong_Bound_Ptr< X, ACE_LOCK > &r) const
 Inequality operator, which is the opposite of equality.
 
bool operator!= (const ACE_Weak_Bound_Ptr< X, ACE_LOCK > &r) const
 Inequality operator, which is the opposite of equality.
 
bool operator!= (X *p) const
 Inequality operator, which is the opposite of equality.
 
Xoperator-> () const
 Redirection operator.
 
Xoperator* () const
 Dereference operator.
 
Xget () const
 Get the pointer value.
 
void reset (X *p=0)
 
bool null () const
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Private Types

typedef ACE_Bound_Ptr_Counter< ACE_LOCK > COUNTER
 The ACE_Bound_Ptr_Counter type.
 

Private Attributes

COUNTERcounter_
 The reference counter.
 
Xptr_
 The underlying object.
 

Friends

class ACE_Weak_Bound_Ptr< X, ACE_LOCK >
 
template<class Y , class L >
class ACE_Strong_Bound_Ptr
 

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

◆ COUNTER

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

Constructor & Destructor Documentation

◆ ACE_Strong_Bound_Ptr() [1/4]

template<class X , class ACE_LOCK >
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::ACE_Strong_Bound_Ptr ( X * p = 0)
inlineexplicit

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

◆ ACE_Strong_Bound_Ptr() [2/4]

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.

◆ ACE_Strong_Bound_Ptr() [3/4]

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.

◆ ACE_Strong_Bound_Ptr() [4/4]

template<class X , class ACE_LOCK >
template<class Y >
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::ACE_Strong_Bound_Ptr ( const ACE_Strong_Bound_Ptr< Y, ACE_LOCK > & r)
inline

Copy constructor binds this and r to the same object if Y* can be implicitly converted to X*.

◆ ~ACE_Strong_Bound_Ptr()

template<class X , class ACE_LOCK >
ACE_Strong_Bound_Ptr< X, ACE_LOCK >::~ACE_Strong_Bound_Ptr ( )
inline

Destructor.

Member Function Documentation

◆ get()

template<class X , class ACE_LOCK >
X * ACE_Strong_Bound_Ptr< X, ACE_LOCK >::get ( ) const
inline

Get the pointer value.

◆ null()

template<class X , class ACE_LOCK >
bool ACE_Strong_Bound_Ptr< X, ACE_LOCK >::null ( ) const
inline

Allows us to check for NULL on all ACE_Strong_Bound_Ptr objects.

◆ operator!=() [1/3]

template<class X , class ACE_LOCK >
bool 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.

◆ operator!=() [2/3]

template<class X , class ACE_LOCK >
bool 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.

◆ operator!=() [3/3]

template<class X , class ACE_LOCK >
bool ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator!= ( X * p) const
inline

Inequality operator, which is the opposite of equality.

◆ operator*()

template<class X , class ACE_LOCK >
X & ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator* ( ) const
inline

Dereference operator.

◆ operator->()

template<class X , class ACE_LOCK >
X * ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator-> ( ) const
inline

Redirection operator.

◆ operator=() [1/3]

template<class X , class ACE_LOCK >
void ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator= ( const ACE_Strong_Bound_Ptr< X, ACE_LOCK > & r)
inline

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

◆ operator=() [2/3]

template<class X , class ACE_LOCK >
template<class Y >
ACE_Weak_Bound_Ptr< X, ACE_LOCK > & ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator= ( const ACE_Strong_Bound_Ptr< Y, ACE_LOCK > & r)
inline

Assignment operator that binds this and r to the same object if Y* can be implicitly converted to X*.

◆ operator=() [3/3]

template<class X , class ACE_LOCK >
void ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator= ( const ACE_Weak_Bound_Ptr< X, ACE_LOCK > & r)
inline

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

◆ operator==() [1/3]

template<class X , class ACE_LOCK >
bool ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator== ( const ACE_Strong_Bound_Ptr< X, ACE_LOCK > & r) const
inline

Equality operator that returns true if both ACE_Strong_Bound_Ptr instances point to the same underlying object.

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

◆ operator==() [2/3]

template<class X , class ACE_LOCK >
bool ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator== ( const ACE_Weak_Bound_Ptr< X, ACE_LOCK > & r) const
inline

Equality operator that returns true if the ACE_Strong_Bound_Ptr and ACE_Weak_Bound_Ptr objects point to the same underlying object.

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

◆ operator==() [3/3]

template<class X , class ACE_LOCK >
bool ACE_Strong_Bound_Ptr< X, ACE_LOCK >::operator== ( X * p) const
inline

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

◆ reset()

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 Symbol Documentation

◆ ACE_Strong_Bound_Ptr

template<class X , class ACE_LOCK >
template<class Y , class L >
friend class ACE_Strong_Bound_Ptr
friend

◆ ACE_Weak_Bound_Ptr< X, ACE_LOCK >

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

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

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

Declare the dynamic allocation hooks.

◆ counter_

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

The reference counter.

◆ ptr_

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

The underlying object.


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