#include <Servant_Base.h>
Inheritance diagram for TAO_RefCountServantBase:
Public Member Functions | |
~TAO_RefCountServantBase (void) | |
Destructor. | |
virtual void | _add_ref (ACE_ENV_SINGLE_ARG_DECL) |
Increase reference count by one. | |
virtual void | _remove_ref (ACE_ENV_SINGLE_ARG_DECL) |
virtual CORBA::ULong | _refcount_value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) const |
Protected Member Functions | |
TAO_RefCountServantBase (void) | |
Constructor: initial reference count is one. | |
TAO_RefCountServantBase (const TAO_RefCountServantBase &) | |
TAO_RefCountServantBase & | operator= (const TAO_RefCountServantBase &) |
Private Attributes | |
ACE_Atomic_Op< TAO_SYNCH_MUTEX, CORBA::ULong > | ref_count_ |
Reference counter. |
The RefCountServantBase mix-in class overrides the inherited _add_ref and _remove_ref functions it inherits from ServantBase, implementing them to provide true reference counting. An instance of a servant class derived from RefCountServantBase initially has a reference count of one. Invoking _add_ref on the servant instance increases its reference count by one. Invoking _remove_ref on the servant instance decreases its reference count by one; if the resulting reference count equals zero, _remove_ref invokes delete on its this pointer in order to destroy the servant. For ORBs that operate in multi-threaded environments, the implementations of _add_ref and _remove_ref that the RefCountServantBase class provides shall be thread-safe.
Like ServantBase, RefCountServantBase supports copy construction and the default assignment operation. Copy construction always sets the reference count of the new servant instance to one. The default assignment implementation merely returns *this and does not affect the reference count.
|
Destructor.
|
|
Constructor: initial reference count is one.
|
|
Copy Constructor: Always sets the reference count of the new servant instance to one. |
|
Increase reference count by one.
Reimplemented from TAO_Abstract_ServantBase. |
|
Returns the current reference count value. |
|
Decreases reference count by one; if the resulting reference count equals zero, _remove_ref invokes delete on its this pointer in order to destroy the servant. Reimplemented from TAO_Abstract_ServantBase. |
|
The default assignment implementation merely returns *this and does not affect the reference count. |
|
Reference counter.
|