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

TAO_Local_RefCounted_Object Class Reference

#include <LocalObject.h>

Inheritance diagram for TAO_Local_RefCounted_Object:

Inheritance graph
[legend]
Collaboration diagram for TAO_Local_RefCounted_Object:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual void _add_ref (void)
 Increment reference count. More...

virtual void _remove_ref (void)
 Decrement reference count. More...


Protected Methods

 TAO_Local_RefCounted_Object (void)

Protected Attributes

TAO_SYNCH_MUTEX refcount_lock_
 Mutex to protect reference count. More...

CORBA::ULong refcount_
 Number of outstanding references to this object. More...


Private Methods

Unimplemented methods
 TAO_Local_RefCounted_Object (const TAO_Local_RefCounted_Object &)
TAO_Local_RefCounted_Object & operator= (const TAO_Local_RefCounted_Object &)

Detailed Description

This class adds default reference counting to local objects.

Definition at line 244 of file LocalObject.h.


Constructor & Destructor Documentation

ACE_INLINE TAO_Local_RefCounted_Object::TAO_Local_RefCounted_Object void    [protected]
 

Make it protected to prevent instantiation of this class.

Definition at line 60 of file LocalObject.i.

00061   : refcount_lock_ (),
00062     refcount_ (1)
00063 {
00064 }

TAO_Local_RefCounted_Object::TAO_Local_RefCounted_Object const TAO_Local_RefCounted_Object &    [private]
 


Member Function Documentation

void TAO_Local_RefCounted_Object::_add_ref void    [virtual]
 

Increment reference count.

Reimplemented from CORBA_LocalObject.

Definition at line 180 of file LocalObject.cpp.

References ACE_GUARD, refcount_, and TAO_SYNCH_MUTEX.

Referenced by TAO_ORBInitInfo::_duplicate, and TAO_ORBInitInfo::_tao_QueryInterface.

00181 {
00182   ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->refcount_lock_);
00183   this->refcount_++;
00184 }

void TAO_Local_RefCounted_Object::_remove_ref void    [virtual]
 

Decrement reference count.

Reimplemented from CORBA_LocalObject.

Definition at line 187 of file LocalObject.cpp.

References ACE_GUARD, refcount_, and TAO_SYNCH_MUTEX.

00188 {
00189   {
00190     ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->refcount_lock_);
00191     this->refcount_--;
00192 
00193     if (this->refcount_ != 0)
00194       return;
00195   }
00196 
00197   delete this;
00198 }

TAO_Local_RefCounted_Object& TAO_Local_RefCounted_Object::operator= const TAO_Local_RefCounted_Object &    [private]
 


Member Data Documentation

CORBA::ULong TAO_Local_RefCounted_Object::refcount_ [protected]
 

Number of outstanding references to this object.

Reimplemented from CORBA_Object.

Definition at line 278 of file LocalObject.h.

Referenced by _add_ref, and _remove_ref.

TAO_SYNCH_MUTEX TAO_Local_RefCounted_Object::refcount_lock_ [protected]
 

Mutex to protect reference count.

Reimplemented from CORBA_Object.

Definition at line 275 of file LocalObject.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:28:11 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002