#include <Servant_Base.h>
Inheritance diagram for TAO_RefCountServantBase:
Public Methods | |
~TAO_RefCountServantBase (void) | |
Destructor. More... | |
virtual void | _add_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) |
Increase reference count by one. More... | |
virtual void | _remove_ref (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) |
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. More... | |
Protected Methods | |
TAO_RefCountServantBase (void) | |
Constructor: initial reference count is one. More... | |
TAO_RefCountServantBase (const TAO_RefCountServantBase &) | |
Copy Constructor: Always sets the reference count of the new servant instance to one. More... | |
TAO_RefCountServantBase & | operator= (const TAO_RefCountServantBase &) |
The default assignment implementation merely returns *this and does not affect the reference count. More... | |
Private Attributes | |
ACE_Atomic_Op< TAO_SYNCH_MUTEX, long > | ref_count_ |
Reference counter. More... |
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. |
|
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.
|