dbertoni    00/12/20 20:44:28

  Modified:    c/src/XPath XPathExecutionContext.hpp
  Log:
  Added copy constructor for GetAndReleaseCachedString.
  
  Revision  Changes    Path
  1.31      +23 -7     xml-xalan/c/src/XPath/XPathExecutionContext.hpp
  
  Index: XPathExecutionContext.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExecutionContext.hpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- XPathExecutionContext.hpp 2000/12/15 23:25:55     1.30
  +++ XPathExecutionContext.hpp 2000/12/21 04:44:27     1.31
  @@ -494,14 +494,25 @@
        public:
   
                GetAndReleaseCachedString(XPathExecutionContext&        
theExecutionContext) :
  -                     m_executionContext(theExecutionContext),
  -                     m_string(&m_executionContext.getCachedString())
  +                     m_executionContext(&theExecutionContext),
  +                     m_string(&theExecutionContext.getCachedString())
                {
                }
   
  +             // Note non-const copy semantics...
  +             GetAndReleaseCachedString(GetAndReleaseCachedString&    
theSource) :
  +                     m_executionContext(theSource.m_executionContext),
  +                     m_string(theSource.m_string)
  +             {
  +                     theSource.m_string = 0;
  +             }
  +
                ~GetAndReleaseCachedString()
                {
  -                     m_executionContext.releaseCachedString(*m_string);
  +                     if (m_string != 0)
  +                     {
  +                             
m_executionContext->releaseCachedString(*m_string);
  +                     }
                }
   
                XalanDOMString&
  @@ -519,18 +530,23 @@
                        return *m_string;
                }
   
  +             XPathExecutionContext&
  +             getExecutionContext() const
  +             {
  +                     return *m_executionContext;
  +             }
  +
        private:
   
                // Not implemented...
                GetAndReleaseCachedString&
                operator=(const GetAndReleaseCachedString&);
   
  -             GetAndReleaseCachedString(const GetAndReleaseCachedString&);
  -
   
  -             XPathExecutionContext&  m_executionContext;
  +             // Data members...
  +             XPathExecutionContext*  m_executionContext;
   
  -             XalanDOMString* const   m_string;
  +             XalanDOMString*                 m_string;
        };
   
        /**
  
  
  

Reply via email to