TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK > Class Template Reference

TAO_ESF_Copy_On_Write_Read_Guard. More...

#include <ESF_Copy_On_Write.h>

Collaboration diagram for TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_ESF_Copy_On_Write_Collection<
COLLECTION, ITERATOR > 
Collection
 Constructor.

Public Member Functions

 TAO_ESF_Copy_On_Write_Read_Guard (ACE_LOCK &mutex, Collection *&collection)
 ~TAO_ESF_Copy_On_Write_Read_Guard (void)
 Destructor.

Public Attributes

Collectioncollection

Private Attributes

ACE_LOCK & mutex

Detailed Description

template<class COLLECTION, class ITERATOR, class ACE_LOCK>
class TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >

TAO_ESF_Copy_On_Write_Read_Guard.

This helper class atomically increments the reference count of a TAO_ESF_Copy_On_Write_Collection and reads the current collection in the Copy_On_Write class.

Definition at line 58 of file ESF_Copy_On_Write.h.


Member Typedef Documentation

template<class COLLECTION, class ITERATOR, class ACE_LOCK>
typedef TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR> TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::Collection

Constructor.

Definition at line 62 of file ESF_Copy_On_Write.h.


Constructor & Destructor Documentation

template<class COLLECTION, class ITERATOR, class ACE_LOCK>
ACE_INLINE TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::TAO_ESF_Copy_On_Write_Read_Guard ( ACE_LOCK &  mutex,
Collection *&  collection 
)

Definition at line 18 of file ESF_Copy_On_Write.inl.

References TAO_ESF_Copy_On_Write_Collection< COLLECTION, ITERATOR >::_incr_refcnt(), ACE_GUARD, and TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::collection.

00020       :  collection (0),
00021          mutex (m)
00022 {
00023   ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
00024   this->collection = collection_ref;
00025   this->collection->_incr_refcnt ();
00026 }

template<class COLLECTION, class ITERATOR, class ACE_LOCK>
ACE_INLINE TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::~TAO_ESF_Copy_On_Write_Read_Guard ( void   ) 

Destructor.

Definition at line 30 of file ESF_Copy_On_Write.inl.

References TAO_ESF_Copy_On_Write_Collection< COLLECTION, ITERATOR >::_decr_refcnt(), ACE_GUARD, and TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::collection.

00031 {
00032   if (this->collection != 0)
00033     {
00034       ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
00035       this->collection->_decr_refcnt ();
00036     }
00037 }


Member Data Documentation

template<class COLLECTION, class ITERATOR, class ACE_LOCK>
Collection* TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::collection

Definition at line 69 of file ESF_Copy_On_Write.h.

Referenced by TAO_ESF_Copy_On_Write< PROXY, COLLECTION, ITERATOR, >::for_each(), TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::TAO_ESF_Copy_On_Write_Read_Guard(), and TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::~TAO_ESF_Copy_On_Write_Read_Guard().

template<class COLLECTION, class ITERATOR, class ACE_LOCK>
ACE_LOCK& TAO_ESF_Copy_On_Write_Read_Guard< COLLECTION, ITERATOR, ACE_LOCK >::mutex [private]

Definition at line 72 of file ESF_Copy_On_Write.h.


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:43:50 2010 for TAO_ESF by  doxygen 1.4.7