TAO_ESF  2.0.7
Public Member Functions | Protected Attributes
TAO_ESF_Proxy_RefCount_Guard Class Reference

Reference count based guard. More...

#include <ESF_Proxy_RefCount_Guard.h>

List of all members.

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::ULongrefcount_
EVENT_CHANNEL * event_channel_
 The event channel used to destroy the proxy.
PROXY * proxy_
 The proxy whose lifetime is controlled by the reference count.

Detailed Description

Reference count based guard.

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 being 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.

Todo:
The type of lock could be parametric

Constructor & Destructor Documentation

TAO_ESF_Proxy_RefCount_Guard::TAO_ESF_Proxy_RefCount_Guard ( CORBA::ULong refcount,
EVENT_CHANNEL *  ec,
PROXY *  proxy 
)

Constructor.

TAO_ESF_Proxy_RefCount_Guard::~TAO_ESF_Proxy_RefCount_Guard ( void  )

Destructor.


Member Data Documentation

The event channel used to destroy the proxy.

The proxy whose lifetime is controlled by the reference count.

The reference count, if it gets to zero then the object must be destroyed


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines