dbertoni    01/01/15 18:32:40

  Modified:    c/src/XPath XNodeSet.cpp XNodeSet.hpp XResultTreeFrag.cpp
                        XResultTreeFrag.hpp XResultTreeFragAllocator.cpp
                        XResultTreeFragAllocator.hpp XStringBase.cpp
  Log:
  Changes to allow re-use of ResultTreeFragments.
  
  Revision  Changes    Path
  1.20      +2 -2      xml-xalan/c/src/XPath/XNodeSet.cpp
  
  Index: XNodeSet.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNodeSet.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XNodeSet.cpp      2000/12/04 20:48:17     1.19
  +++ XNodeSet.cpp      2001/01/16 02:32:39     1.20
  @@ -185,13 +185,13 @@
                assert(theFactory != 0);
   
                ResultTreeFrag* const   theFrag =
  -                     new ResultTreeFrag(*theFactory);
  +                     new ResultTreeFrag(theFactory);
   
                const int       nNodes = m_value->getLength();
   
                for(int i = 0; i < nNodes; i++)
                {
  -                     theFrag->appendChild(m_value->item(i)->cloneNode(true));
  +                     theFrag->appendChild(m_value->item(i));
                }
   
   #if defined(XALAN_NO_MUTABLE)
  
  
  
  1.17      +0 -3      xml-xalan/c/src/XPath/XNodeSet.hpp
  
  Index: XNodeSet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XNodeSet.hpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XNodeSet.hpp      2000/11/02 01:46:00     1.16
  +++ XNodeSet.hpp      2001/01/16 02:32:39     1.17
  @@ -76,9 +76,6 @@
   
   // Base class header file.
   #include <XPath/XObject.hpp>
  -
  -
  -
   #include <XPath/XPathExecutionContext.hpp>
   
   
  
  
  
  1.18      +2 -2      xml-xalan/c/src/XPath/XResultTreeFrag.cpp
  
  Index: XResultTreeFrag.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- XResultTreeFrag.cpp       2001/01/08 18:28:26     1.17
  +++ XResultTreeFrag.cpp       2001/01/16 02:32:39     1.18
  @@ -79,7 +79,7 @@
   
   
   
  -XResultTreeFrag::XResultTreeFrag(ResultTreeFragBase* val) :
  +XResultTreeFrag::XResultTreeFrag(BorrowReturnResultTreeFrag& val) :
        XObject(eTypeResultTreeFrag),
        m_value(val),
        m_cachedStringValue(),
  @@ -94,7 +94,7 @@
                        const XResultTreeFrag&  source,
                        bool                                    deepClone) :
        XObject(source),        
  -     m_value(source.m_value->clone(deepClone)),
  +     m_value(source.m_value.clone(deepClone)),
        m_cachedStringValue(source.m_cachedStringValue),
        m_cachedNumberValue(source.m_cachedNumberValue),        
        m_nodeRefListBaseProxy(*this)
  
  
  
  1.18      +14 -7     xml-xalan/c/src/XPath/XResultTreeFrag.hpp
  
  Index: XResultTreeFrag.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFrag.hpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- XResultTreeFrag.hpp       2001/01/08 18:28:26     1.17
  +++ XResultTreeFrag.hpp       2001/01/16 02:32:39     1.18
  @@ -79,11 +79,15 @@
   
   
   // Base class header file.
  -#include <XPath/XObject.hpp>
   #include <XPath/NodeRefListBase.hpp>
  +#include <XPath/XObject.hpp>
  +
  +
   
  +#include <XPath/XPathExecutionContext.hpp>
   
   
  +
   class ResultTreeFragBase;
   class XResultTreeFrag;
   
  @@ -92,12 +96,15 @@
   {
   public:
   
  +     typedef XPathExecutionContext::BorrowReturnResultTreeFrag       
BorrowReturnResultTreeFrag;
  +
  +
        /**
         * Construct an XResultTreeFrag object from a result tree fragment
         * 
  -      * @param val        source result tree fragment.  The XResultTreeFrag 
instance will adopt the object.
  +      * @param val source result tree fragment.  The XResultTreeFrag 
instance will adopt the object.
         */
  -     XResultTreeFrag(ResultTreeFragBase*             val);
  +     XResultTreeFrag(BorrowReturnResultTreeFrag&             val);
   
        /**
         * Construct an XResultTreeFrag object from another
  @@ -187,13 +194,13 @@
        };
   
        // Data members...
  -     XalanAutoPtr<ResultTreeFragBase>        m_value;        
  +     BorrowReturnResultTreeFrag              m_value;        
   
  -     mutable XalanDOMString                          m_cachedStringValue;
  +     mutable XalanDOMString                  m_cachedStringValue;
   
  -     mutable double                                          
m_cachedNumberValue;
  +     mutable double                                  m_cachedNumberValue;
   
  -     const NodeRefListBaseProxy                      m_nodeRefListBaseProxy;
  +     const NodeRefListBaseProxy              m_nodeRefListBaseProxy;
   };
   
   
  
  
  
  1.2       +2 -2      xml-xalan/c/src/XPath/XResultTreeFragAllocator.cpp
  
  Index: XResultTreeFragAllocator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFragAllocator.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XResultTreeFragAllocator.cpp      2000/10/13 21:24:02     1.1
  +++ XResultTreeFragAllocator.cpp      2001/01/16 02:32:39     1.2
  @@ -75,12 +75,12 @@
   
   
   XResultTreeFragAllocator::data_type*
  -XResultTreeFragAllocator::create(ResultTreeFragBase* thenResultTreeFragBase)
  +XResultTreeFragAllocator::create(BorrowReturnResultTreeFrag& theValue)
   {
        data_type* const        theBlock = m_allocator.allocateBlock();
        assert(theBlock != 0);
   
  -     data_type* const        theResult = new(theBlock) 
data_type(thenResultTreeFragBase);
  +     data_type* const        theResult = new(theBlock) data_type(theValue);
   
        m_allocator.commitAllocation(theBlock);
   
  
  
  
  1.2       +8 -8      xml-xalan/c/src/XPath/XResultTreeFragAllocator.hpp
  
  Index: XResultTreeFragAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XResultTreeFragAllocator.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XResultTreeFragAllocator.hpp      2000/10/13 21:24:02     1.1
  +++ XResultTreeFragAllocator.hpp      2001/01/16 02:32:39     1.2
  @@ -77,6 +77,8 @@
   {
   public:
   
  +     typedef XPathExecutionContext::BorrowReturnResultTreeFrag       
BorrowReturnResultTreeFrag;
  +
        typedef XResultTreeFrag                                         
data_type;
   
        typedef ReusableArenaAllocator<data_type>       ArenaAllocatorType;
  @@ -92,21 +94,19 @@
        ~XResultTreeFragAllocator();
        
        /**
  -      * Create an XResultTreeFrag object using allocator from a string.
  +      * Create an XResultTreeFrag object using the allocator.
         * 
  -      * @param value                 source NodeRefListBase
  +      * @param value source value
         *
         * @return pointer to a node
         */
        data_type*
  -     create(ResultTreeFragBase*      value);
  +     create(BorrowReturnResultTreeFrag&      value);
   
        /**
  -      * Create an XResultTreeFrag object using allocator from a string.
  +      * Create an XResultTreeFrag object using allocator the allocator.
         * 
  -      * @param theEnvSupport XPath environment support class instance
  -      * @param theSupport    XPath support class instance
  -      * @param value                 source MutableNodeRefList
  +      * @param value                 source XResultTreeFrag
         *
         * @return pointer to a node
         */
  @@ -116,7 +116,7 @@
        /**
         * Clone an XResultTreeFrag object.
         * 
  -      * @param value                 source XResultTreeFrag
  +      * @param value source XResultTreeFrag
         *
         * @return pointer to an XResultTreeFrag
         */
  
  
  
  1.2       +1 -1      xml-xalan/c/src/XPath/XStringBase.cpp
  
  Index: XStringBase.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XStringBase.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XStringBase.cpp   2000/12/21 04:23:07     1.1
  +++ XStringBase.cpp   2001/01/16 02:32:39     1.2
  @@ -143,7 +143,7 @@
                assert(theFactory != 0);
   
                ResultTreeFrag* const   theFrag =
  -                     new ResultTreeFrag(*theFactory);
  +                     new ResultTreeFrag(theFactory);
   
                XalanNode* const        textNode =
                        theFactory->createTextNode(str());
  
  
  

Reply via email to