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

# TAO_ESF_Copy_On_Write Class Template Reference

TAO_ESF_Copy_On_Write. More...

`#include <ESF_Copy_On_Write.h>`

Inheritance diagram for TAO_ESF_Copy_On_Write:

[legend]
Collaboration diagram for TAO_ESF_Copy_On_Write:

[legend]
List of all members.

## Public Types
typedef TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_SYNCH_MUTEX_T > | Read_Guard
| Constructor. More...
typedef TAO_ESF_Copy_On_Write_Write_Guard< COLLECTION, ITERATOR, ACE_SYNCH_USE > | Write_Guard
## Public Methods
| TAO_ESF_Copy_On_Write (void)
| ~TAO_ESF_Copy_On_Write (void)
| Destructor. More...
virtual void | for_each (TAO_ESF_Worker< PROXY > *worker ACE_ENV_ARG_DECL)
virtual void | connected (PROXY *proxy ACE_ENV_ARG_DECL)
| Insert a new element into the collection. The collection assumes ownership of the element. More...
virtual void | reconnected (PROXY *proxy ACE_ENV_ARG_DECL)
virtual void | disconnected (PROXY *proxy ACE_ENV_ARG_DECL)
| Remove an element from the collection. More...
virtual void | shutdown (ACE_ENV_SINGLE_ARG_DECL)
| The EC is shutting down, must release all the elements. More...
## Private Types
typedef TAO_ESF_Copy_On_Write_Collection< COLLECTION, ITERATOR > | Collection
## Private Attributes
ACE_SYNCH_MUTEX_T | mutex_
| A mutex to serialize access to the collection pointer. More...
int | pending_writes_
| Number of pending writes. More...
int | writing_
ACE_SYNCH_CONDITION_T | cond_
| A condition variable to wait to synchronize multiple writers. More...
Collection * | collection_
| The collection, with reference counting added. More...

## Detailed Description

### template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL>
class TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >

TAO_ESF_Copy_On_Write.

Implement the Copy_On_Write protocol The class is parametric on the kind of collection and locking mechanism used.

## Member Typedef Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR> TAO_ESF_Copy_On_Write::Collection`[private]`

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_SYNCH_MUTEX_T> TAO_ESF_Copy_On_Write::Read_Guard

| Constructor.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
typedef TAO_ESF_Copy_On_Write_Write_Guard<COLLECTION,ITERATOR,ACE_SYNCH_USE> TAO_ESF_Copy_On_Write::Write_Guard

## Constructor & Destructor Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::TAO_ESF_Copy_On_Write | ( | void |  | ) |

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::~TAO_ESF_Copy_On_Write | ( | void |  | ) |

| Destructor.

## Member Function Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
void TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::connected | ( | PROXY *proxy | ACE_ENV_ARG_DECL | ) | `[virtual]`

| Insert a new element into the collection. The collection assumes ownership of the element. Reimplemented from TAO_ESF_Proxy_Collection.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
void TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::disconnected | ( | PROXY *proxy | ACE_ENV_ARG_DECL | ) | `[virtual]`

| Remove an element from the collection. Reimplemented from TAO_ESF_Proxy_Collection.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
void TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::for_each | ( | TAO_ESF_Worker< PROXY > *worker | ACE_ENV_ARG_DECL | ) | `[virtual]`

| Iterate over the collection and invoke worker->work() for each member of the collection. This encapsulates Reimplemented from TAO_ESF_Proxy_Collection.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
void TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::reconnected | ( | PROXY *proxy | ACE_ENV_ARG_DECL | ) | `[virtual]`

| Insert an element into the collection. No errors can be raised if the element is already present. The collection assumes ownership, i.e. must invoke <proxy->_decr_refcnt()> if the element is already present in the collection. Reimplemented from TAO_ESF_Proxy_Collection.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
void TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::shutdown | ( | ACE_ENV_SINGLE_ARG_DECL |  | ) | `[virtual]`

| The EC is shutting down, must release all the elements. Reimplemented from TAO_ESF_Proxy_Collection.

## Member Data Documentation

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
Collection* TAO_ESF_Copy_On_Write::collection_`[private]`

| The collection, with reference counting added.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
ACE_SYNCH_CONDITION_T TAO_ESF_Copy_On_Write::cond_`[private]`

| A condition variable to wait to synchronize multiple writers.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
ACE_SYNCH_MUTEX_T TAO_ESF_Copy_On_Write::mutex_`[private]`

| A mutex to serialize access to the collection pointer.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
int TAO_ESF_Copy_On_Write::pending_writes_`[private]`

| Number of pending writes.

template<class PROXY, class COLLECTION, class ITERATOR, ACE_SYNCH_DECL >
int TAO_ESF_Copy_On_Write::writing_`[private]`

| If non-zero then a thread is changing the collection. Many threads can use the collection simulatenously, but only one change it.

The documentation for this class was generated from the following files:

- ESF_Copy_On_Write.h
- ESF_Copy_On_Write.cpp