Go to the documentation of this file.00001
00002
00003
00004
00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00006
00007 template<class COLLECTION, class ITERATOR> ACE_INLINE
00008 TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR>::
00009 TAO_ESF_Copy_On_Write_Collection (void)
00010 : refcount_ (1)
00011 {
00012 }
00013
00014
00015
00016 template<class COLLECTION, class ITERATOR, class ACE_LOCK> ACE_INLINE
00017 TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_LOCK>::
00018 TAO_ESF_Copy_On_Write_Read_Guard (ACE_LOCK &m,
00019 Collection*& collection_ref)
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 }
00027
00028 template<class COLLECTION, class ITERATOR, class ACE_LOCK> ACE_INLINE
00029 TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_LOCK>::
00030 ~TAO_ESF_Copy_On_Write_Read_Guard (void)
00031 {
00032 if (this->collection != 0)
00033 {
00034 ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
00035 this->collection->_decr_refcnt ();
00036 }
00037 }
00038
00039
00040
00041 TAO_END_VERSIONED_NAMESPACE_DECL