Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# TAO_ESF_Proxy_RefCount_Guard Class Template Reference

Reference count based guard. More...

`#include <ESF_Proxy_RefCount_Guard.h>`

Collaboration diagram for TAO_ESF_Proxy_RefCount_Guard:

[legend]
List of all members.

## Public Methods
| TAO_ESF_Proxy_RefCount_Guard (CORBA::ULong &refcount, EVENT_CHANNEL *ec, PROXY *proxy)
| Constructor. More...
| ~TAO_ESF_Proxy_RefCount_Guard (void)
| Destructor. More...
## Protected Attributes
CORBA::ULong & | refcount_
| The reference count, if it gets to zero then the object must be destroyed. More...
EVENT_CHANNEL * | event_channel_
| The event channel used to destroy the proxy. More...
PROXY * | proxy_
| The proxy whose lifetime is controlled by the reference count. More...

## Detailed Description

### template<class EVENT_CHANNEL, class PROXY>
class TAO_ESF_Proxy_RefCount_Guard< EVENT_CHANNEL, PROXY >

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

@TODO: The type of lock could be parametric

## Constructor & Destructor Documentation

template<class EC, class P>
ACE_INLINE TAO_ESF_Proxy_RefCount_Guard< EC, P >::TAO_ESF_Proxy_RefCount_Guard | ( | CORBA::ULong & | refcount,
|  | EC * | ec,
|  | P * | proxy
| ) |

| Constructor.

template<class EC, class P>
TAO_ESF_Proxy_RefCount_Guard< EC, P >::~TAO_ESF_Proxy_RefCount_Guard | ( | void |  | ) |

| Destructor.

## Member Data Documentation

template<class EVENT_CHANNEL, class PROXY>
EVENT_CHANNEL* TAO_ESF_Proxy_RefCount_Guard::event_channel_`[protected]`

| The event channel used to destroy the proxy.

template<class EVENT_CHANNEL, class PROXY>
PROXY* TAO_ESF_Proxy_RefCount_Guard::proxy_`[protected]`

| The proxy whose lifetime is controlled by the reference count.

template<class EVENT_CHANNEL, class PROXY>
CORBA::ULong& TAO_ESF_Proxy_RefCount_Guard::refcount_`[protected]`

| 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:

- ESF_Proxy_RefCount_Guard.h
- ESF_Proxy_RefCount_Guard.cpp
- ESF_Proxy_RefCount_Guard.i