ACE_Weak_Bound_Ptr< X, ACE_LOCK > Class Template ReferenceThis class implements support for a weak pointer that complements ACE_Strong_Bound_Ptr. More...
Collaboration diagram for ACE_Weak_Bound_Ptr< X, ACE_LOCK >:
![]()
Detailed Descriptiontemplate<class X, class ACE_LOCK>
This class implements support for a weak pointer that complements ACE_Strong_Bound_Ptr.
|
typedef X ACE_Weak_Bound_Ptr< X, ACE_LOCK >::X_t [private] |
typedef ACE_Bound_Ptr_Counter<ACE_LOCK> ACE_Weak_Bound_Ptr< X, ACE_LOCK >::COUNTER [private] |
The ACE_Bound_Ptr_Counter type.
ACE_Weak_Bound_Ptr< X, ACE_LOCK >::ACE_Weak_Bound_Ptr | ( | X * | p = 0 |
) | [inline, explicit] |
Constructor that initializes an ACE_Weak_Bound_Ptr to point to the object <p> immediately.
ACE_Weak_Bound_Ptr< X, ACE_LOCK >::ACE_Weak_Bound_Ptr | ( | const ACE_Weak_Bound_Ptr< X, ACE_LOCK > & | r | ) | [inline] |
Copy constructor binds this
and r to the same object.
ACE_Weak_Bound_Ptr< X, ACE_LOCK >::ACE_Weak_Bound_Ptr | ( | const ACE_Strong_Bound_Ptr< X, ACE_LOCK > & | r | ) | [inline] |
Constructor binds this
and r to the same object.
ACE_Weak_Bound_Ptr< X, ACE_LOCK >::~ACE_Weak_Bound_Ptr | ( | void | ) | [inline] |
Destructor.
void ACE_Weak_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.
void ACE_Weak_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.
bool ACE_Weak_Bound_Ptr< X, ACE_LOCK >::operator== | ( | const ACE_Weak_Bound_Ptr< X, ACE_LOCK > & | r | ) | const [inline] |
Equality operator that returns true
if both ACE_Weak_Bound_Ptr objects point to the same underlying object.
true
if both objects have just been instantiated and not used yet. bool ACE_Weak_Bound_Ptr< X, ACE_LOCK >::operator== | ( | const ACE_Strong_Bound_Ptr< X, ACE_LOCK > & | r | ) | const [inline] |
Equality operator that returns true
if the ACE_Weak_Bound_Ptr and ACE_Strong_Bound_Ptr objects point to the same underlying object.
true
if both objects have just been instantiated and not used yet. bool ACE_Weak_Bound_Ptr< X, ACE_LOCK >::operator== | ( | X * | p | ) | const [inline] |
Equality operator that returns true
if the ACE_Weak_Bound_Ptr and the raw pointer point to the same underlying object.
bool ACE_Weak_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.
bool ACE_Weak_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.
bool ACE_Weak_Bound_Ptr< X, ACE_LOCK >::operator!= | ( | X * | p | ) | const [inline] |
Inequality operator, which is the opposite of equality.
ACE_Strong_Bound_Ptr< X, ACE_LOCK > ACE_Weak_Bound_Ptr< X, ACE_LOCK >::operator-> | ( | void | ) | const [inline] |
Redirection operator.
It returns a temporary strong pointer and makes use of the chaining properties of operator-> to ensure that the underlying object does not disappear while you are using it. If you are certain of the lifetimes of the object, and do not want to incur the locking overhead, then use the unsafe_get method instead.
ACE_Strong_Bound_Ptr< X, ACE_LOCK > ACE_Weak_Bound_Ptr< X, ACE_LOCK >::strong | ( | void | ) | const [inline] |
Obtain a strong pointer corresponding to this weak pointer. This function is useful to create a temporary strong pointer for conversion to a reference.
X * ACE_Weak_Bound_Ptr< X, ACE_LOCK >::unsafe_get | ( | void | ) | const [inline] |
Get the pointer value. Warning: this does not affect the reference count of the underlying object, so it may disappear on you while you are using it if you are not careful.
void ACE_Weak_Bound_Ptr< X, ACE_LOCK >::reset | ( | X * | p = 0 |
) | [inline] |
Resets the ACE_Weak_Bound_Ptr to refer to a different underlying object.
long ACE_Weak_Bound_Ptr< X, ACE_LOCK >::add_ref | ( | void | ) | [inline] |
Increment the reference count on the underlying object.
Returns the new reference count on the object. This function may be used to integrate the bound pointers into an external reference counting mechanism such as those used by COM or CORBA servants.
long ACE_Weak_Bound_Ptr< X, ACE_LOCK >::remove_ref | ( | void | ) | [inline] |
Decrement the reference count on the underlying object, which is deleted if the count has reached zero. Returns the new reference count on the object. This function may be used to integrate the bound pointers into an external reference counting mechanism such as those used by COM or CORBA servants.
int ACE_Weak_Bound_Ptr< X, ACE_LOCK >::null | ( | void | ) | const [inline] |
Allows us to check for NULL on all ACE_Weak_Bound_Ptr objects.
friend class ACE_Strong_Bound_Ptr< X, ACE_LOCK > [friend] |
ACE_Weak_Bound_Ptr< X, ACE_LOCK >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
COUNTER* ACE_Weak_Bound_Ptr< X, ACE_LOCK >::counter_ [private] |
The reference counter.
X* ACE_Weak_Bound_Ptr< X, ACE_LOCK >::ptr_ [private] |
The underlying object.