#include <ESF_Proxy_RefCount_Guard.h>
Public Member Functions | |
TAO_ESF_Proxy_RefCount_Guard (CORBA::ULong &refcount, EVENT_CHANNEL *ec, PROXY *proxy) | |
Constructor. | |
~TAO_ESF_Proxy_RefCount_Guard (void) | |
Destructor. | |
Protected Attributes | |
CORBA::ULong & | refcount_ |
EVENT_CHANNEL * | event_channel_ |
The event channel used to destroy the proxy. | |
PROXY * | proxy_ |
The proxy whose lifetime is controlled by the reference count. |
A common idiom used on event services is to increment a reference count before starting a long running operation. The system can then execute the operation without any risk of having the underlying object destroyed. The advantage of using a reference count is that no mutex or lock needs to be held while the operation is beign executed. This class implements that common idiom, but it also adds hooks to handle scenarios where more than one operation is performed while holding the reference count.
: The type of lock could be parametric
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_ESF_Proxy_RefCount_Guard< EC, P >::TAO_ESF_Proxy_RefCount_Guard | ( | CORBA::ULong & | refcount, | |
EC * | ec, | |||
P * | proxy | |||
) | [inline] |
Constructor.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_ESF_Proxy_RefCount_Guard< EC, P >::~TAO_ESF_Proxy_RefCount_Guard | ( | void | ) | [inline] |
Destructor.
CORBA::ULong& TAO_ESF_Proxy_RefCount_Guard< EVENT_CHANNEL, PROXY >::refcount_ [protected] |
The reference count, if it gets to zero then the object must be destroyed
EVENT_CHANNEL* TAO_ESF_Proxy_RefCount_Guard< EVENT_CHANNEL, PROXY >::event_channel_ [protected] |
The event channel used to destroy the proxy.
PROXY* TAO_ESF_Proxy_RefCount_Guard< EVENT_CHANNEL, PROXY >::proxy_ [protected] |
The proxy whose lifetime is controlled by the reference count.