dmitryh     2004/11/08 10:04:45

  Modified:    c/src/xalanc/DOMSupport DOMServices.cpp DOMServices.hpp
                        DOMSupport.hpp DOMSupportDefault.cpp
                        DOMSupportDefault.hpp DOMSupportException.cpp
                        DOMSupportException.hpp DOMSupportInit.cpp
                        DOMSupportInit.hpp XalanDocumentPrefixResolver.cpp
                        XalanDocumentPrefixResolver.hpp
                        XalanNamespacesStack.cpp XalanNamespacesStack.hpp
  Log:
  Initial implementation on the pluggable memory management
  
  Revision  Changes    Path
  1.9       +33 -70    xml-xalan/c/src/xalanc/DOMSupport/DOMServices.cpp
  
  Index: DOMServices.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMServices.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DOMServices.cpp   31 Jul 2004 06:05:02 -0000      1.8
  +++ DOMServices.cpp   8 Nov 2004 18:04:45 -0000       1.9
  @@ -43,17 +43,21 @@
   
   XALAN_USING_XALAN(XalanDOMString)
   
  +
   // These XalanDOMString instances will hold the actual
   // data.  This way, the DOMSupport references can be const,
   // but we can initialize the data when we want to.
  -static XalanDOMString        s_XMLString;
  -static XalanDOMString        s_XMLStringWithSeparator;
  -static XalanDOMString        s_XMLNamespacePrefix;
  -static XalanDOMString        s_XMLNamespaceURI;
  -static XalanDOMString        s_XMLNamespace;
  -static XalanDOMString        s_XMLNamespaceWithSeparator;
  -static XalanDOMString        s_XMLNamespaceSeparatorString;
  -static XalanDOMString        s_XMLNamespacePrefixURI;
  +
  +XALAN_USING_XALAN(XalanMemMgrs)
  +
  +static XalanDOMString        s_XMLString(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        
s_XMLStringWithSeparator(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        
s_XMLNamespacePrefix(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        
s_XMLNamespaceURI(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        s_XMLNamespace(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        
s_XMLNamespaceWithSeparator(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        
s_XMLNamespaceSeparatorString(XalanMemMgrs::getDummyMemMgr());
  +static XalanDOMString        
s_XMLNamespacePrefixURI(XalanMemMgrs::getDummyMemMgr());
   
   
   
  @@ -83,7 +87,7 @@
   const XalanDOMString&        DOMServices::s_XMLNamespaceWithSeparator = 
::s_XMLNamespaceWithSeparator;
   const XalanDOMString&        DOMServices::s_XMLNamespaceSeparatorString  = 
::s_XMLNamespaceSeparatorString;
   const XalanDOMString&        DOMServices::s_XMLNamespacePrefixURI = 
::s_XMLNamespacePrefixURI;
  -const XalanDOMString DOMServices::s_emptyString;
  +const XalanDOMString 
DOMServices::s_emptyString(XalanMemMgrs::getDummyMemMgr());
   
   
   
  @@ -97,18 +101,18 @@
   const XalanDOMString::size_type&     
DOMServices::s_XMLNamespacePrefixURILength = ::s_XMLNamespacePrefixURILength;
   
   
  -
   void
  -DOMServices::initialize()
  +DOMServices::initialize(MemoryManagerType&  theManager)
   {
  -     ::s_XMLString = XALAN_STATIC_UCODE_STRING("xml");
  -     ::s_XMLStringWithSeparator = XALAN_STATIC_UCODE_STRING("xml:");
  -     ::s_XMLNamespacePrefix = XALAN_STATIC_UCODE_STRING("xmlns:xml");
  -     ::s_XMLNamespaceURI = 
XALAN_STATIC_UCODE_STRING("http://www.w3.org/XML/1998/namespace";);
  -     ::s_XMLNamespace = XALAN_STATIC_UCODE_STRING("xmlns");
  -     ::s_XMLNamespaceWithSeparator = XALAN_STATIC_UCODE_STRING("xmlns:");
  -     ::s_XMLNamespaceSeparatorString = XALAN_STATIC_UCODE_STRING(":");
  -     ::s_XMLNamespacePrefixURI = 
XALAN_STATIC_UCODE_STRING("http://www.w3.org/2000/xmlns/";);
  +    ::s_XMLString.reset( theManager, "xml");
  +
  +    ::s_XMLStringWithSeparator.reset( theManager, "xml:" );
  +     ::s_XMLNamespacePrefix.reset( theManager, "xmlns:xml");
  +     ::s_XMLNamespaceURI.reset( theManager, 
"http://www.w3.org/XML/1998/namespace";);
  +     ::s_XMLNamespace.reset( theManager, "xmlns");
  +     ::s_XMLNamespaceWithSeparator.reset( theManager, "xmlns:");
  +     ::s_XMLNamespaceSeparatorString.reset( theManager, ":");
  +     ::s_XMLNamespacePrefixURI.reset( theManager, 
"http://www.w3.org/2000/xmlns/";);
   
        ::s_XMLStringLength = length(DOMServices::s_XMLString);
        ::s_XMLStringWithSeparatorLength = 
length(DOMServices::s_XMLStringWithSeparator);
  @@ -125,14 +129,16 @@
   void
   DOMServices::terminate()
   {
  -     releaseMemory(::s_XMLString);
  -     releaseMemory(::s_XMLStringWithSeparator);
  -     releaseMemory(::s_XMLNamespacePrefix);
  -     releaseMemory(::s_XMLNamespaceURI);
  -     releaseMemory(::s_XMLNamespace);
  -     releaseMemory(::s_XMLNamespaceWithSeparator);
  -     releaseMemory(::s_XMLNamespaceSeparatorString);
  -     releaseMemory(::s_XMLNamespacePrefixURI);
  +    MemoryManagerType& theManager = XalanMemMgrs::getDummyMemMgr();
  +
  +     releaseMemory(::s_XMLString, theManager );
  +     releaseMemory(::s_XMLStringWithSeparator, theManager );
  +     releaseMemory(::s_XMLNamespacePrefix, theManager );
  +     releaseMemory(::s_XMLNamespaceURI, theManager );
  +     releaseMemory(::s_XMLNamespace, theManager );
  +     releaseMemory(::s_XMLNamespaceWithSeparator, theManager );
  +     releaseMemory(::s_XMLNamespaceSeparatorString, theManager );
  +     releaseMemory(::s_XMLNamespacePrefixURI, theManager );
   
        ::s_XMLStringLength = 0;
        ::s_XMLStringWithSeparatorLength = 0;
  @@ -146,17 +152,6 @@
   
   
   
  -XalanDOMString
  -DOMServices::getNodeData(const XalanNode&    node)
  -{
  -     XalanDOMString  data;
  -
  -     getNodeData(node, data);
  -
  -     return data;
  -}
  -
  -
   
   void
   DOMServices::getNodeData(
  @@ -259,17 +254,6 @@
   
   
   
  -XalanDOMString
  -DOMServices::getNodeData(const XalanDocument&        document)
  -{
  -     XalanDOMString  data;
  -
  -     getNodeData(document, data);
  -
  -     return data;
  -}
  -
  -
   
   inline void
   getChildData(
  @@ -332,16 +316,6 @@
   
   
   
  -XalanDOMString
  -DOMServices::getNodeData(const XalanDocumentFragment&        
documentFragment)
  -{
  -     XalanDOMString  data;
  -
  -     getNodeData(documentFragment, data);
  -
  -     return data;
  -}
  -
   
   
   void
  @@ -357,17 +331,6 @@
        }
   }
   
  -
  -
  -XalanDOMString
  -DOMServices::getNodeData(const XalanElement& element)
  -{
  -     XalanDOMString  data;
  -
  -     getNodeData(element, data);
  -
  -     return data;
  -}
   
   
   
  
  
  
  1.6       +8 -77     xml-xalan/c/src/xalanc/DOMSupport/DOMServices.hpp
  
  Index: DOMServices.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMServices.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOMServices.hpp   26 Feb 2004 22:29:50 -0000      1.5
  +++ DOMServices.hpp   8 Nov 2004 18:04:45 -0000       1.6
  @@ -79,7 +79,7 @@
         * other functions are called.
         */
        static void
  -     initialize();
  +     initialize(MemoryManagerType&      theManager);
   
        /**
         * Destroy static data.  After thus function is called,
  @@ -88,14 +88,7 @@
        static void
        terminate();
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param node DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanNode&    node);
  +
   
        /**
         * Retrieves data for node
  @@ -108,17 +101,7 @@
                        const XalanNode&        node,
                        XalanDOMString&         data);
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param attribute DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanAttr&    attribute)
  -     {
  -             return attribute.getNodeValue();
  -     }
  +
   
        /**
         * Retrieves data for node
  @@ -134,17 +117,7 @@
                append(data, attribute.getNodeValue());
        }
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param comment DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanComment&         comment)
  -     {
  -             return comment.getData();
  -     }
  +
   
        /**
         * Retrieves data for node
  @@ -160,14 +133,7 @@
                append(data, comment.getData());
        }
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param document DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanDocument&        document);
  +
   
        /**
         * Retrieves data for node
  @@ -180,14 +146,7 @@
                        const XalanDocument&    document,
                        XalanDOMString&                 data);
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param documentFragment DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanDocumentFragment&        documentFragment);
  +
   
        /**
         * Retrieves data for node
  @@ -200,14 +159,7 @@
                        const XalanDocumentFragment&    documentFragment,
                        XalanDOMString&                                 data);
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param element DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanElement&         element);
  +
   
        /**
         * Retrieves data for node
  @@ -220,17 +172,6 @@
                        const XalanElement&             element,
                        XalanDOMString&                 data);
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param pi DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanProcessingInstruction&   pi)
  -     {
  -             return pi.getData();
  -     }
   
        /**
         * Retrieves data for node
  @@ -246,17 +187,7 @@
                append(data, pi.getData());
        }
   
  -     /**
  -      * Retrieves data for node
  -      * 
  -      * @param node DOM node whose data is to be returned
  -      * @return a string representation of the node's data
  -      */
  -     static XalanDOMString
  -     getNodeData(const XalanText&    text)
  -     {
  -             return text.getData();
  -     }
  +
   
        /**
         * Retrieves data for node
  
  
  
  1.5       +2 -1      xml-xalan/c/src/xalanc/DOMSupport/DOMSupport.hpp
  
  Index: DOMSupport.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupport.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMSupport.hpp    26 Feb 2004 22:29:50 -0000      1.4
  +++ DOMSupport.hpp    8 Nov 2004 18:04:45 -0000       1.5
  @@ -63,7 +63,8 @@
        virtual const XalanDOMString&
        getUnparsedEntityURI(
                        const XalanDOMString&   theName,
  -                     const XalanDocument&    theDocument) const = 0;
  +                     const XalanDocument&    theDocument,
  +            XalanDOMString&         theURI) const = 0;
   
        /**
         * Determine if a node is after another node, in document order.
  
  
  
  1.6       +5 -5      xml-xalan/c/src/xalanc/DOMSupport/DOMSupportDefault.cpp
  
  Index: DOMSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupportDefault.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DOMSupportDefault.cpp     31 Jul 2004 06:05:02 -0000      1.5
  +++ DOMSupportDefault.cpp     8 Nov 2004 18:04:45 -0000       1.6
  @@ -37,9 +37,9 @@
   
   
   
  -DOMSupportDefault::DOMSupportDefault() :
  +DOMSupportDefault::DOMSupportDefault(MemoryManagerType& theManager) :
        DOMSupport(),
  -     m_pool()
  +     m_pool(theManager)
   {
   }
   
  @@ -61,9 +61,9 @@
   const XalanDOMString&
   DOMSupportDefault::getUnparsedEntityURI(
                        const XalanDOMString&   theName,
  -                     const XalanDocument&    theDocument) const
  +                     const XalanDocument&    theDocument,
  +            XalanDOMString&                  theURI) const
   {
  -     XalanDOMString                                  theURI;
   
        const XalanDocumentType* const  theDoctype =
                theDocument.getDoctype();
  @@ -87,7 +87,7 @@
                                        static_cast<const 
XalanEntity*>(theNode);
   #endif
   
  -                             const XalanDOMString            
theNotationName(theEntity->getNotationName());
  +                const XalanDOMString         
theNotationName(theEntity->getNotationName(),theURI.getMemoryManager());
   
                                if(isEmpty(theNotationName) == false) // then 
it's unparsed
                                {
  
  
  
  1.5       +3 -2      xml-xalan/c/src/xalanc/DOMSupport/DOMSupportDefault.hpp
  
  Index: DOMSupportDefault.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupportDefault.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMSupportDefault.hpp     26 Feb 2004 22:29:50 -0000      1.4
  +++ DOMSupportDefault.hpp     8 Nov 2004 18:04:45 -0000       1.5
  @@ -39,7 +39,7 @@
   {
   public:
   
  -     DOMSupportDefault();
  +     DOMSupportDefault(MemoryManagerType& theManager);
   
        virtual
        ~DOMSupportDefault();
  @@ -55,7 +55,8 @@
        virtual const XalanDOMString&
        getUnparsedEntityURI(
                        const XalanDOMString&   theName,
  -                     const XalanDocument&    theDocument) const;
  +                     const XalanDocument&    theDocument,
  +            XalanDOMString&                  theURI) const;
   
        virtual bool
        isNodeAfter(
  
  
  
  1.5       +3 -2      xml-xalan/c/src/xalanc/DOMSupport/DOMSupportException.cpp
  
  Index: DOMSupportException.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupportException.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMSupportException.cpp   26 Feb 2004 22:29:50 -0000      1.4
  +++ DOMSupportException.cpp   8 Nov 2004 18:04:45 -0000       1.5
  @@ -23,8 +23,9 @@
   
   
   
  -DOMSupportException::DOMSupportException(const XalanDOMString&       
message) :
  -     XSLException(message)
  +DOMSupportException::DOMSupportException(const XalanDOMString&       message,
  +                                         MemoryManagerType&     theManager) :
  +     XSLException(message, theManager)
   {
   }
   
  
  
  
  1.5       +1 -1      xml-xalan/c/src/xalanc/DOMSupport/DOMSupportException.hpp
  
  Index: DOMSupportException.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupportException.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMSupportException.hpp   26 Feb 2004 22:29:50 -0000      1.4
  +++ DOMSupportException.hpp   8 Nov 2004 18:04:45 -0000       1.5
  @@ -45,7 +45,7 @@
         * 
         * @param message error message
         */
  -     explicit DOMSupportException(const XalanDOMString&      message);
  +     explicit DOMSupportException(const XalanDOMString&      message, 
MemoryManagerType& theManager);
   
        virtual
        ~DOMSupportException();
  
  
  
  1.5       +5 -5      xml-xalan/c/src/xalanc/DOMSupport/DOMSupportInit.cpp
  
  Index: DOMSupportInit.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupportInit.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMSupportInit.cpp        26 Feb 2004 22:29:50 -0000      1.4
  +++ DOMSupportInit.cpp        8 Nov 2004 18:04:45 -0000       1.5
  @@ -30,14 +30,14 @@
   
   
   
  -DOMSupportInit::DOMSupportInit() :
  -     m_platformSupportInit()
  +DOMSupportInit::DOMSupportInit(MemoryManagerType& theManager) :
  +     m_platformSupportInit(theManager)
   {
        ++s_initCounter;
   
        if (s_initCounter == 1)
        {
  -             initialize();
  +             initialize(theManager);
        }
   }
   
  @@ -56,9 +56,9 @@
   
   
   void
  -DOMSupportInit::initialize()
  +DOMSupportInit::initialize(MemoryManagerType& theManager)
   {
  -     DOMServices::initialize();
  +     DOMServices::initialize(theManager);
   }
   
   
  
  
  
  1.5       +2 -2      xml-xalan/c/src/xalanc/DOMSupport/DOMSupportInit.hpp
  
  Index: DOMSupportInit.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/DOMSupport/DOMSupportInit.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMSupportInit.hpp        26 Feb 2004 22:29:50 -0000      1.4
  +++ DOMSupportInit.hpp        8 Nov 2004 18:04:45 -0000       1.5
  @@ -37,7 +37,7 @@
   public:
   
        explicit
  -     DOMSupportInit();
  +     DOMSupportInit(MemoryManagerType& theManager);
   
        ~DOMSupportInit();
   
  @@ -51,7 +51,7 @@
   
        
        static void
  -     initialize();
  +     initialize(MemoryManagerType& theManager);
   
        static void
        terminate();
  
  
  
  1.5       +14 -10    
xml-xalan/c/src/xalanc/DOMSupport/XalanDocumentPrefixResolver.cpp
  
  Index: XalanDocumentPrefixResolver.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/DOMSupport/XalanDocumentPrefixResolver.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XalanDocumentPrefixResolver.cpp   26 Feb 2004 22:29:50 -0000      1.4
  +++ XalanDocumentPrefixResolver.cpp   8 Nov 2004 18:04:45 -0000       1.5
  @@ -34,9 +34,10 @@
   
   XalanDocumentPrefixResolver::XalanDocumentPrefixResolver(
                        const XalanDocument*    theDocument,
  -                     const XalanDOMString&   theURI) :
  -     m_namespaces(),
  -     m_uri(theURI)
  +                     const XalanDOMString&   theURI,
  +            MemoryManagerType&      theManager) :
  +     m_namespaces(theManager),
  +     m_uri(theURI, theManager)
   {
        assert(theDocument != 0);
   
  @@ -64,18 +65,21 @@
        }
        else
        {
  -             const AttributeVectorType&      theVector = (*i).second;
  -             assert(theVector.empty() == false);
  +             const AttributeVectorType*      theVector = (*i).second;
   
  -             if (theVector.size() == 1)
  +        assert( theVector != 0);
  +
  +             assert(theVector->empty() == false);
  +
  +             if (theVector->size() == 1)
                {
  -                     assert(theVector.front() != 0);
  +                     assert(theVector->front() != 0);
   
  -                     return &(theVector.front()->getNodeValue());
  +                     return &(theVector->front()->getNodeValue());
                }
                else
                {
  -                     return duplicateBinding(theVector);
  +                     return duplicateBinding(*theVector);
                }
        }
   }
  @@ -148,7 +152,7 @@
   
                                if 
(DOMServices::isNamespaceDeclaration(*theAttr) == true)
                                {
  -                                     
m_map[&theAttr->getLocalName()].push_back(theAttr);
  +                                     
m_map[&theAttr->getLocalName()]->push_back(theAttr);
                                }
                        }
                }
  
  
  
  1.7       +3 -2      
xml-xalan/c/src/xalanc/DOMSupport/XalanDocumentPrefixResolver.hpp
  
  Index: XalanDocumentPrefixResolver.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/DOMSupport/XalanDocumentPrefixResolver.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XalanDocumentPrefixResolver.hpp   17 Sep 2004 22:23:09 -0000      1.6
  +++ XalanDocumentPrefixResolver.hpp   8 Nov 2004 18:04:45 -0000       1.7
  @@ -59,7 +59,7 @@
   
        typedef XalanVector<const XalanNode*>                           
AttributeVectorType;
        typedef XalanMap<const XalanDOMString*,
  -                                     AttributeVectorType>                    
        NamespacesMapType;
  +                                     AttributeVectorType*>                   
        NamespacesMapType;
   
        /**
         * Constructor.
  @@ -69,7 +69,8 @@
         */
        XalanDocumentPrefixResolver(
                        const XalanDocument*    theDocument,
  -                     const XalanDOMString&   theURI = XalanDOMString());
  +                     const XalanDOMString&   theURI,
  +            MemoryManagerType&      theManager);
   
        virtual
        ~XalanDocumentPrefixResolver();
  
  
  
  1.6       +12 -10    
xml-xalan/c/src/xalanc/DOMSupport/XalanNamespacesStack.cpp
  
  Index: XalanNamespacesStack.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/DOMSupport/XalanNamespacesStack.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XalanNamespacesStack.cpp  26 Feb 2004 22:29:50 -0000      1.5
  +++ XalanNamespacesStack.cpp  8 Nov 2004 18:04:45 -0000       1.6
  @@ -59,16 +59,17 @@
   
   
   
  -XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry() 
:
  -     m_namespaces(),
  
+XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry(MemoryManagerType&
 theManager) :
  +     m_namespaces(theManager),
        m_position(m_namespaces.begin())
   {
   }
   
   
   
  
-XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry(const
 XalanNamespacesStackEntry&          theSource) :
  -     m_namespaces(theSource.m_namespaces),
  
+XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry(const
 XalanNamespacesStackEntry&          theSource,
  +                                                                             
           MemoryManagerType&      theManager) :
  +     m_namespaces(theSource.m_namespaces, theManager),
        m_position(m_namespaces.begin() + (const_iterator(theSource.m_position) 
- theSource.m_namespaces.begin()))
   {
   }
  @@ -76,11 +77,12 @@
   
   
   XalanNamespacesStack::XalanNamespacesStackEntry&
  -XalanNamespacesStack::XalanNamespacesStackEntry::operator=(const 
XalanNamespacesStackEntry&          theRHS)
  +XalanNamespacesStack::XalanNamespacesStackEntry::set(const 
XalanNamespacesStackEntry&                theRHS,
  +                                                           
MemoryManagerType&                   theManager)
   {
        if (this != &theRHS)
        {
  -             XalanNamespacesStackEntry       theCopy(theRHS);
  +             XalanNamespacesStackEntry       theCopy(theRHS, theManager);
   
                swap(theCopy);
        }
  @@ -176,11 +178,11 @@
   
   
   
  -XalanNamespacesStack::XalanNamespacesStack() :
  -     m_resultNamespaces(1),
  +XalanNamespacesStack::XalanNamespacesStack(MemoryManagerType& theManager) :
  +     m_resultNamespaces(theManager, 1),
        m_stackBegin(m_resultNamespaces.begin()),
        m_stackPosition(m_stackBegin),
  -     m_createNewContextStack()
  +     m_createNewContextStack(theManager)
   {
        // m_resultNamespaces is initialized to a size of
        // 1, so we always have a dummy entry at the
  @@ -335,7 +337,7 @@
   {
        // Since we always keep one dummy entry at the beginning,
        // swap with an OutputContextStackType instance of size 1.
  -     NamespacesStackType(1).swap(m_resultNamespaces);
  +     NamespacesStackType(m_resultNamespaces.getMemoryManager(), 1 
).swap(m_resultNamespaces);
   
        m_stackBegin = m_resultNamespaces.begin();
   
  
  
  
  1.7       +13 -6     
xml-xalan/c/src/xalanc/DOMSupport/XalanNamespacesStack.hpp
  
  Index: XalanNamespacesStack.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/xalanc/DOMSupport/XalanNamespacesStack.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XalanNamespacesStack.hpp  14 Oct 2004 03:14:08 -0000      1.6
  +++ XalanNamespacesStack.hpp  8 Nov 2004 18:04:45 -0000       1.7
  @@ -36,7 +36,6 @@
   XALAN_CPP_NAMESPACE_BEGIN
   
   
  -
   class XalanDOMString;
   
   
  @@ -92,14 +91,16 @@
                typedef NamespaceCollectionType::const_iterator                 
        const_iterator;
                typedef NamespaceCollectionType::const_reverse_iterator         
const_reverse_iterator;
   
  -             XalanNamespacesStackEntry();
  +             XalanNamespacesStackEntry(MemoryManagerType& theManager);
   
  -             XalanNamespacesStackEntry(const XalanNamespacesStackEntry&      
theSource);
  +             XalanNamespacesStackEntry(const XalanNamespacesStackEntry&      
theSource,
  +                                    MemoryManagerType&              
theManager);
   
                ~XalanNamespacesStackEntry();
   
                XalanNamespacesStackEntry&
  -             operator=(const XalanNamespacesStackEntry&      theRHS);
  +             set(const XalanNamespacesStackEntry&    theRHS,
  +                  MemoryManagerType&                theManager);
   
                void
                addDeclaration(
  @@ -198,6 +199,9 @@
                swap(XalanNamespacesStackEntry&         theOther);
   
        private:
  +        //Not implemented
  +        XalanNamespacesStackEntry();
  +             XalanNamespacesStackEntry(const XalanNamespacesStackEntry&      
theSource);
   
                const XalanDOMString*
                findEntry(
  @@ -213,7 +217,7 @@
   
        typedef XalanNamespacesStackEntry       value_type;
   
  -    typedef  XalanDeque<value_type>          NamespacesStackType;
  +    typedef  XalanDeque<value_type, 
ConstructWithMemoryManagerTraits<value_type> >           NamespacesStackType;
        typedef XalanVector<bool>                       BoolVectorType;
   
        typedef NamespacesStackType::iterator                                   
iterator;
  @@ -227,7 +231,7 @@
   
   
        explicit
  -     XalanNamespacesStack();
  +     XalanNamespacesStack(MemoryManagerType& theManager);
   
        ~XalanNamespacesStack();
   
  @@ -348,6 +352,9 @@
   
        // not implemented
        XalanNamespacesStack(const XalanNamespacesStack&);
  +    XalanNamespacesStack();
  +     XalanNamespacesStackEntry&
  +     operator=(const XalanNamespacesStackEntry&      theRHS);
   
        bool
        operator==(const XalanNamespacesStack&) const;
  
  
  

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

Reply via email to