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

ACE_RMCast_Copy_On_Write_Collection Class Template Reference

A wrapper to implement reference counted collections. More...

#include <RMCast_Copy_On_Write.h>

Collaboration diagram for ACE_RMCast_Copy_On_Write_Collection:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_RMCast_Copy_On_Write_Collection (void)
 Constructor. More...

void _incr_refcnt (void)
 Increment the reference count. More...

void _decr_refcnt (void)
 Decrement the reference count. More...


Public Attributes

COLLECTION collection
 The actual collection. More...


Private Attributes

ACE_UINT32 refcount_
 The reference count. More...


Detailed Description

template<class COLLECTION, class ITERATOR>
class ACE_RMCast_Copy_On_Write_Collection< COLLECTION, ITERATOR >

A wrapper to implement reference counted collections.

Definition at line 13 of file RMCast_Copy_On_Write.h.


Constructor & Destructor Documentation

template<class COLLECTION, class ITERATOR>
ACE_INLINE ACE_RMCast_Copy_On_Write_Collection< COLLECTION, ITERATOR >::ACE_RMCast_Copy_On_Write_Collection void   
 

Constructor.

Definition at line 5 of file RMCast_Copy_On_Write.i.

00006       :  refcount_ (1)
00007 {
00008 }


Member Function Documentation

template<class COLLECTION, class ITERATOR>
void ACE_RMCast_Copy_On_Write_Collection< COLLECTION, ITERATOR >::_decr_refcnt void   
 

Decrement the reference count.

Definition at line 22 of file RMCast_Copy_On_Write.cpp.

References refcount_.

Referenced by ACE_RMCast_Copy_On_Write::~ACE_RMCast_Copy_On_Write, ACE_RMCast_Copy_On_Write_Read_Guard::~ACE_RMCast_Copy_On_Write_Read_Guard, and ACE_RMCast_Copy_On_Write_Write_Guard::~ACE_RMCast_Copy_On_Write_Write_Guard.

00023 {
00024   // LOCKING: no locking is required, the caller grabs the mutex.
00025   {
00026     this->refcount_--;
00027     if (this->refcount_ != 0)
00028       return;
00029   }
00030   //@@ TODO: If this wrapper is going to be completely general some
00031   // kind of functor has to be provided to remove the elements in the
00032   // collection, in case the are no self-managed
00033 
00034   delete this;
00035 }

template<class COLLECTION, class ITERATOR>
void ACE_RMCast_Copy_On_Write_Collection< COLLECTION, ITERATOR >::_incr_refcnt void   
 

Increment the reference count.

Definition at line 15 of file RMCast_Copy_On_Write.cpp.

References refcount_.

Referenced by ACE_RMCast_Copy_On_Write_Read_Guard::ACE_RMCast_Copy_On_Write_Read_Guard.

00016 {
00017   // LOCKING: no locking is required, the caller grabs the mutex.
00018   this->refcount_++;
00019 }


Member Data Documentation

template<class COLLECTION, class ITERATOR>
COLLECTION ACE_RMCast_Copy_On_Write_Collection::collection
 

The actual collection.

Definition at line 26 of file RMCast_Copy_On_Write.h.

Referenced by ACE_RMCast_Copy_On_Write_Write_Guard::ACE_RMCast_Copy_On_Write_Write_Guard, ACE_RMCast_Copy_On_Write::bind_i, ACE_RMCast_Copy_On_Write::empty, ACE_RMCast_Copy_On_Write::first_key, ACE_RMCast_Copy_On_Write::for_each, and ACE_RMCast_Copy_On_Write::unbind_i.

template<class COLLECTION, class ITERATOR>
ACE_UINT32 ACE_RMCast_Copy_On_Write_Collection::refcount_ [private]
 

The reference count.

Definition at line 30 of file RMCast_Copy_On_Write.h.

Referenced by _decr_refcnt, and _incr_refcnt.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:13:53 2003 for ACE_RMCast by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002