dbertoni    01/10/29 19:57:06

  Modified:    c/src/Include XalanObjectCache.hpp
  Log:
  Changed name of class and made it more auto_ptr-like.
  
  Revision  Changes    Path
  1.5       +19 -6     xml-xalan/c/src/Include/XalanObjectCache.hpp
  
  Index: XalanObjectCache.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/Include/XalanObjectCache.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanObjectCache.hpp      2001/05/10 17:46:34     1.4
  +++ XalanObjectCache.hpp      2001/10/30 03:57:06     1.5
  @@ -363,21 +363,24 @@
   
   
   template<class XalanObjectCacheType>
  -class GetReleaseCachedObject
  +class GuardCachedObject
   {
   public:
   
        typedef typename XalanObjectCacheType::CacheObjectType  CacheObjectType;
   
  -     GetReleaseCachedObject(XalanObjectCacheType&    theCache) :
  +     GuardCachedObject(XalanObjectCacheType& theCache) :
                m_cache(theCache),
                m_cachedObject(theCache.get())
        {
        }
   
  -     ~GetReleaseCachedObject()
  +     ~GuardCachedObject()
        {
  -             m_cache.release(m_cachedObject);
  +             if (m_cachedObject != 0)
  +             {
  +                     m_cache.release(m_cachedObject);
  +             }
        }
   
        CacheObjectType*
  @@ -386,16 +389,26 @@
                return m_cachedObject;
        }
   
  +     CacheObjectType*
  +     release()
  +     {
  +             CacheObjectType* const  temp = m_cachedObject;
  +
  +             m_cachedObject = 0;
  +
  +             return temp;
  +     }
  +
   private:
   
        // Not implemented...
  -     GetReleaseCachedObject(const 
GetReleaseCachedObject<XalanObjectCacheType>&);
  +     GuardCachedObject(const GuardCachedObject<XalanObjectCacheType>&);
   
   
        // Data members...
        XalanObjectCacheType&   m_cache;
   
  -     CacheObjectType* const  m_cachedObject;
  +     CacheObjectType*                m_cachedObject;
   };
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to