You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2003/05/15 20:59:36 UTC

cvs commit: xml-xerces/c/src/xercesc/validators/schema/identity FieldActivator.cpp FieldActivator.hpp FieldValueMap.cpp FieldValueMap.hpp IC_Field.cpp IC_Field.hpp IC_Key.cpp IC_Key.hpp IC_KeyRef.cpp IC_KeyRef.hpp IC_Selector.cpp IC_Selector.hpp IC_Unique.cpp IC_Unique.hpp IdentityConstraint.cpp IdentityConstraint.hpp ValueStore.cpp ValueStore.hpp ValueStoreCache.cpp ValueStoreCache.hpp XPathMatcher.cpp XPathMatcher.hpp XPathMatcherStack.cpp XPathMatcherStack.hpp XercesXPath.cpp XercesXPath.hpp

knoaman     2003/05/15 11:59:36

  Modified:    c/src/xercesc/validators/schema/identity FieldActivator.cpp
                        FieldActivator.hpp FieldValueMap.cpp
                        FieldValueMap.hpp IC_Field.cpp IC_Field.hpp
                        IC_Key.cpp IC_Key.hpp IC_KeyRef.cpp IC_KeyRef.hpp
                        IC_Selector.cpp IC_Selector.hpp IC_Unique.cpp
                        IC_Unique.hpp IdentityConstraint.cpp
                        IdentityConstraint.hpp ValueStore.cpp
                        ValueStore.hpp ValueStoreCache.cpp
                        ValueStoreCache.hpp XPathMatcher.cpp
                        XPathMatcher.hpp XPathMatcherStack.cpp
                        XPathMatcherStack.hpp XercesXPath.cpp
                        XercesXPath.hpp
  Log:
  Partial implementation of the configurable memory manager.
  
  Revision  Changes    Path
  1.4       +8 -2      xml-xerces/c/src/xercesc/validators/schema/identity/FieldActivator.cpp
  
  Index: FieldActivator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/FieldActivator.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FieldActivator.cpp	4 Nov 2002 14:47:41 -0000	1.3
  +++ FieldActivator.cpp	15 May 2003 18:59:34 -0000	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.3  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -84,15 +87,18 @@
   //  FieldActivator: Constructors and Destructor
   // ---------------------------------------------------------------------------
   FieldActivator::FieldActivator(ValueStoreCache* const valueStoreCache,
  -                               XPathMatcherStack* const matcherStack)
  +                               XPathMatcherStack* const matcherStack,
  +                               MemoryManager* const manager)
       : fValueStoreCache(valueStoreCache)
       , fMatcherStack(matcherStack)
  +    , fMemoryManager(manager)
   {
   }
   
   FieldActivator::FieldActivator(const FieldActivator& other)
       : fValueStoreCache(other.fValueStoreCache)
       , fMatcherStack(other.fMatcherStack)
  +    , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
   {
   }
   
  @@ -121,7 +127,7 @@
   XPathMatcher* FieldActivator::activateField(IC_Field* const field, const int initialDepth) {
   
       ValueStore* valueStore = fValueStoreCache->getValueStoreFor(field, initialDepth);
  -    XPathMatcher* matcher = field->createMatcher(valueStore);
  +    XPathMatcher* matcher = field->createMatcher(valueStore, fMemoryManager);
   
       field->setMayMatch(true);
       fMatcherStack->addMatcher(matcher);
  
  
  
  1.4       +7 -5      xml-xerces/c/src/xercesc/validators/schema/identity/FieldActivator.hpp
  
  Index: FieldActivator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/FieldActivator.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FieldActivator.hpp	4 Nov 2002 14:47:41 -0000	1.3
  +++ FieldActivator.hpp	15 May 2003 18:59:34 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -69,7 +69,7 @@
   // ---------------------------------------------------------------------------
   //  Includes
   // ---------------------------------------------------------------------------
  -#include <xercesc/util/XercesDefs.hpp>
  +#include <xercesc/util/XMemory.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -83,14 +83,15 @@
   class XPathMatcherStack;
   
   
  -class VALIDATORS_EXPORT FieldActivator
  +class VALIDATORS_EXPORT FieldActivator : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
       FieldActivator(ValueStoreCache* const valueStoreCache,
  -                   XPathMatcherStack* const matcherStack);
  +                   XPathMatcherStack* const matcherStack,
  +                   MemoryManager* const manager);
   	FieldActivator(const FieldActivator& other);
   	~FieldActivator();
   
  @@ -132,6 +133,7 @@
       // -----------------------------------------------------------------------
       ValueStoreCache*   fValueStoreCache;
       XPathMatcherStack* fMatcherStack;
  +    MemoryManager*     fMemoryManager;
   };
   
   
  
  
  
  1.4       +9 -4      xml-xerces/c/src/xercesc/validators/schema/identity/FieldValueMap.cpp
  
  Index: FieldValueMap.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/FieldValueMap.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FieldValueMap.cpp	18 Dec 2002 14:17:59 -0000	1.3
  +++ FieldValueMap.cpp	15 May 2003 18:59:34 -0000	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.3  2002/12/18 14:17:59  gareth
    * Fix to bug #13438. When you eant a vector that calls delete[] on its members you should use RefArrayVectorOf.
    *
  @@ -80,10 +83,11 @@
   // ---------------------------------------------------------------------------
   //  FieldValueMap: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -FieldValueMap::FieldValueMap()
  +FieldValueMap::FieldValueMap(MemoryManager* const manager)
       : fFields(0)
       , fValidators(0)
       , fValues(0)
  +    , fMemoryManager(manager)
   {
   }
   
  @@ -91,15 +95,16 @@
       : fFields(0)
       , fValidators(0)
       , fValues(0)
  +    , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
   {
       try {
           if (other.fFields) {
   
               unsigned int valuesSize = other.fValues->size();
   
  -            fFields = new ValueVectorOf<IC_Field*>(*(other.fFields));
  -            fValidators = new ValueVectorOf<DatatypeValidator*>(*(other.fValidators));
  -            fValues = new RefArrayVectorOf<XMLCh>(other.fFields->curCapacity());
  +            fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(*(other.fFields));
  +            fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(*(other.fValidators));
  +            fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(other.fFields->curCapacity());
   
               for (unsigned int i=0; i<valuesSize; i++) {
                   fValues->addElement(XMLString::replicate(other.fValues->elementAt(i)));
  
  
  
  1.4       +8 -7      xml-xerces/c/src/xercesc/validators/schema/identity/FieldValueMap.hpp
  
  Index: FieldValueMap.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/FieldValueMap.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FieldValueMap.hpp	18 Dec 2002 14:17:59 -0000	1.3
  +++ FieldValueMap.hpp	15 May 2003 18:59:34 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -82,13 +82,13 @@
   class DatatypeValidator;
   
   
  -class VALIDATORS_EXPORT FieldValueMap
  +class VALIDATORS_EXPORT FieldValueMap : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    FieldValueMap();
  +    FieldValueMap(MemoryManager* const manager);
       FieldValueMap(const FieldValueMap& other);
   	~FieldValueMap();
   
  @@ -125,6 +125,7 @@
       ValueVectorOf<IC_Field*>*          fFields;
       ValueVectorOf<DatatypeValidator*>* fValidators;
       RefArrayVectorOf<XMLCh>*           fValues;
  +    MemoryManager*                     fMemoryManager;
   };
   
   
  @@ -198,9 +199,9 @@
                                  const XMLCh* const value) {
   
       if (!fFields) {
  -        fFields = new ValueVectorOf<IC_Field*>(4);
  -        fValidators = new ValueVectorOf<DatatypeValidator*>(4);
  -        fValues = new RefArrayVectorOf<XMLCh>(4);
  +        fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(4);
  +        fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(4);
  +        fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4);
       }
   
       int keyIndex = indexOf(key);
  
  
  
  1.4       +11 -5     xml-xerces/c/src/xercesc/validators/schema/identity/IC_Field.cpp
  
  Index: IC_Field.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Field.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IC_Field.cpp	13 Jan 2003 16:30:19 -0000	1.3
  +++ IC_Field.cpp	15 May 2003 18:59:34 -0000	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.3  2003/01/13 16:30:19  knoaman
    * [Bug 14469] Validator doesn't enforce xsd:key.
    *
  @@ -85,9 +88,11 @@
   // ---------------------------------------------------------------------------
   //  FieldMatcher: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -FieldMatcher::FieldMatcher(XercesXPath* const xpath, IC_Field* const aField,
  -                           ValueStore* const valueStore)
  -    : XPathMatcher(xpath, 0)
  +FieldMatcher::FieldMatcher(XercesXPath* const xpath,
  +                           IC_Field* const aField,
  +                           ValueStore* const valueStore,
  +                           MemoryManager* const manager)
  +    : XPathMatcher(xpath, (IdentityConstraint*) 0, manager)
       , fField(aField)
       , fValueStore(valueStore)
   {
  @@ -144,9 +149,10 @@
   // ---------------------------------------------------------------------------
   //  IC_Field: Factory methods
   // ---------------------------------------------------------------------------
  -XPathMatcher* IC_Field::createMatcher(ValueStore* const valueStore) {
  +XPathMatcher* IC_Field::createMatcher(ValueStore* const valueStore,
  +                                      MemoryManager* const manager) {
   
  -    return new FieldMatcher(fXPath, this, valueStore);
  +    return new (manager) FieldMatcher(fXPath, this, valueStore, manager);
   }
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.3       +9 -6      xml-xerces/c/src/xercesc/validators/schema/identity/IC_Field.hpp
  
  Index: IC_Field.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Field.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_Field.hpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_Field.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -75,7 +75,7 @@
   class ValueStore;
   
   
  -class VALIDATORS_EXPORT IC_Field
  +class VALIDATORS_EXPORT IC_Field : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -106,7 +106,8 @@
   	// -----------------------------------------------------------------------
       //  Factory methods
       // -----------------------------------------------------------------------
  -    XPathMatcher* createMatcher(ValueStore* const valueStore);
  +    XPathMatcher* createMatcher(ValueStore* const valueStore,
  +                                MemoryManager* const manager);
   
   private:
       // -----------------------------------------------------------------------
  @@ -148,8 +149,10 @@
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    FieldMatcher(XercesXPath* const anXPath, IC_Field* const aField,
  -                 ValueStore* const valueStore);
  +    FieldMatcher(XercesXPath* const anXPath,
  +                 IC_Field* const aField,
  +                 ValueStore* const valueStore,
  +                 MemoryManager* const manager);
   
       // -----------------------------------------------------------------------
       //  Unimplemented contstructors and operators
  
  
  
  1.3       +6 -2      xml-xerces/c/src/xercesc/validators/schema/identity/IC_Key.cpp
  
  Index: IC_Key.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Key.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_Key.cpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_Key.cpp	15 May 2003 18:59:34 -0000	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.3  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.2  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -78,8 +81,9 @@
   //  IC_Key: Constructors and Destructor
   // ---------------------------------------------------------------------------
   IC_Key::IC_Key(const XMLCh* const identityConstraintName,
  -               const XMLCh* const elemName)
  -    : IdentityConstraint(identityConstraintName, elemName)
  +               const XMLCh* const elemName,
  +			   MemoryManager* const manager)
  +    : IdentityConstraint(identityConstraintName, elemName, manager)
   {
   }
   
  
  
  
  1.3       +3 -2      xml-xerces/c/src/xercesc/validators/schema/identity/IC_Key.hpp
  
  Index: IC_Key.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Key.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_Key.hpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_Key.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -76,7 +76,8 @@
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
       IC_Key(const XMLCh* const identityConstraintName,
  -           const XMLCh* const elemName);
  +           const XMLCh* const elemName,
  +           MemoryManager* const manager);
   	~IC_Key();
   
   	// -----------------------------------------------------------------------
  
  
  
  1.3       +6 -2      xml-xerces/c/src/xercesc/validators/schema/identity/IC_KeyRef.cpp
  
  Index: IC_KeyRef.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_KeyRef.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_KeyRef.cpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_KeyRef.cpp	15 May 2003 18:59:34 -0000	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.3  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.2  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -79,8 +82,9 @@
   // ---------------------------------------------------------------------------
   IC_KeyRef::IC_KeyRef(const XMLCh* const identityConstraintName,
                        const XMLCh* const elemName,
  -                     IdentityConstraint* const icKey)
  -    : IdentityConstraint(identityConstraintName, elemName)
  +                     IdentityConstraint* const icKey,
  +                     MemoryManager* const manager)
  +    : IdentityConstraint(identityConstraintName, elemName, manager)
       , fKey(icKey)
   {
   }
  
  
  
  1.3       +3 -2      xml-xerces/c/src/xercesc/validators/schema/identity/IC_KeyRef.hpp
  
  Index: IC_KeyRef.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_KeyRef.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_KeyRef.hpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_KeyRef.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -77,7 +77,8 @@
       // -----------------------------------------------------------------------
       IC_KeyRef(const XMLCh* const identityConstraintName,
                 const XMLCh* const elemName,
  -              IdentityConstraint* const icKey);
  +              IdentityConstraint* const icKey,
  +              MemoryManager* const manager);
   	~IC_KeyRef();
   
   	// -----------------------------------------------------------------------
  
  
  
  1.5       +10 -4     xml-xerces/c/src/xercesc/validators/schema/identity/IC_Selector.cpp
  
  Index: IC_Selector.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Selector.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IC_Selector.cpp	13 Jan 2003 16:30:19 -0000	1.4
  +++ IC_Selector.cpp	15 May 2003 18:59:34 -0000	1.5
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.5  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.4  2003/01/13 16:30:19  knoaman
    * [Bug 14469] Validator doesn't enforce xsd:key.
    *
  @@ -96,8 +99,9 @@
   SelectorMatcher::SelectorMatcher(XercesXPath* const xpath,
                                    IC_Selector* const selector,
                                    FieldActivator* const fieldActivator,
  -                                 const int initialDepth)
  -    : XPathMatcher(xpath, selector->getIdentityConstraint())
  +                                 const int initialDepth,
  +                                 MemoryManager* const manager)
  +    : XPathMatcher(xpath, selector->getIdentityConstraint(), manager)
       , fInitialDepth(initialDepth)
       , fElementDepth(0)
       , fMatchedDepth(-1)
  @@ -188,9 +192,11 @@
   // ---------------------------------------------------------------------------
   //  IC_Selector: Factory methods
   // ---------------------------------------------------------------------------
  -XPathMatcher* IC_Selector::createMatcher(FieldActivator* const fieldActivator, const int initialDepth) {
  +XPathMatcher* IC_Selector::createMatcher(FieldActivator* const fieldActivator,
  +                                         const int initialDepth,
  +                                         MemoryManager* const manager) {
   
  -    return new SelectorMatcher(fXPath, this, fieldActivator, initialDepth);
  +    return new (manager) SelectorMatcher(fXPath, this, fieldActivator, initialDepth, manager);
   }
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.5       +11 -6     xml-xerces/c/src/xercesc/validators/schema/identity/IC_Selector.hpp
  
  Index: IC_Selector.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Selector.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IC_Selector.hpp	13 Jan 2003 16:30:19 -0000	1.4
  +++ IC_Selector.hpp	15 May 2003 18:59:34 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -75,7 +75,7 @@
   class FieldActivator;
   
   
  -class VALIDATORS_EXPORT IC_Selector
  +class VALIDATORS_EXPORT IC_Selector : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -100,7 +100,9 @@
   	// -----------------------------------------------------------------------
       //  Factory methods
       // -----------------------------------------------------------------------
  -    XPathMatcher* createMatcher(FieldActivator* const fieldActivator, const int initialDepth);
  +    XPathMatcher* createMatcher(FieldActivator* const fieldActivator,
  +                                const int initialDepth,
  +                                MemoryManager* const manager);
   
   private:
       // -----------------------------------------------------------------------
  @@ -143,8 +145,11 @@
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    SelectorMatcher(XercesXPath* const anXPath, IC_Selector* const selector,
  -                    FieldActivator* const fieldActivator, const int initialDepth);
  +    SelectorMatcher(XercesXPath* const anXPath,
  +                    IC_Selector* const selector,
  +                    FieldActivator* const fieldActivator,
  +                    const int initialDepth,
  +                    MemoryManager* const manager);
   
       // -----------------------------------------------------------------------
       //  Unimplemented contstructors and operators
  
  
  
  1.3       +6 -2      xml-xerces/c/src/xercesc/validators/schema/identity/IC_Unique.cpp
  
  Index: IC_Unique.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Unique.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_Unique.cpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_Unique.cpp	15 May 2003 18:59:34 -0000	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.3  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.2  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -78,8 +81,9 @@
   //  IC_Unique: Constructors and Destructor
   // ---------------------------------------------------------------------------
   IC_Unique::IC_Unique(const XMLCh* const identityConstraintName,
  -                     const XMLCh* const elemName)
  -    : IdentityConstraint(identityConstraintName, elemName)
  +                     const XMLCh* const elemName,
  +                     MemoryManager* const manager)
  +    : IdentityConstraint(identityConstraintName, elemName, manager)
   {
   }
   
  
  
  
  1.3       +3 -2      xml-xerces/c/src/xercesc/validators/schema/identity/IC_Unique.hpp
  
  Index: IC_Unique.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IC_Unique.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IC_Unique.hpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IC_Unique.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -80,7 +80,8 @@
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
       IC_Unique(const XMLCh* const identityConstraintName,
  -              const XMLCh* const elemName);
  +              const XMLCh* const elemName,
  +              MemoryManager* const manager);
   	~IC_Unique();
   
   	// -----------------------------------------------------------------------
  
  
  
  1.4       +11 -5     xml-xerces/c/src/xercesc/validators/schema/identity/IdentityConstraint.cpp
  
  Index: IdentityConstraint.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IdentityConstraint.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IdentityConstraint.cpp	4 Nov 2002 14:47:41 -0000	1.3
  +++ IdentityConstraint.cpp	15 May 2003 18:59:34 -0000	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.3  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -87,14 +90,17 @@
   //  IdentityConstraint: Constructors and Destructor
   // ---------------------------------------------------------------------------
   IdentityConstraint::IdentityConstraint(const XMLCh* const identityConstraintName,
  -                                       const XMLCh* const elemName)
  -    : fIdentityConstraintName(XMLString::replicate(identityConstraintName))
  +                                       const XMLCh* const elemName,
  +                                       MemoryManager* const manager)
  +    : fIdentityConstraintName(0)
       , fElemName(0)
       , fSelector(0)
       , fFields(0)
  +    , fMemoryManager(manager)
   {
       try {
  -        fElemName = XMLString::replicate(elemName);
  +        fIdentityConstraintName = XMLString::replicate(identityConstraintName, fMemoryManager);
  +        fElemName = XMLString::replicate(elemName, fMemoryManager);
       }
       catch(...) {
   
  @@ -159,8 +165,8 @@
   // ---------------------------------------------------------------------------
   void IdentityConstraint::cleanUp() {
   
  -    delete [] fIdentityConstraintName;
  -    delete [] fElemName;
  +    fMemoryManager->deallocate(fIdentityConstraintName);//delete [] fIdentityConstraintName;
  +    fMemoryManager->deallocate(fElemName);//delete [] fElemName;
       delete fFields;
       delete fSelector;
   }
  
  
  
  1.3       +7 -5      xml-xerces/c/src/xercesc/validators/schema/identity/IdentityConstraint.hpp
  
  Index: IdentityConstraint.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/IdentityConstraint.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IdentityConstraint.hpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ IdentityConstraint.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -79,7 +79,7 @@
   // ---------------------------------------------------------------------------
   class IC_Selector;
   
  -class VALIDATORS_EXPORT IdentityConstraint
  +class VALIDATORS_EXPORT IdentityConstraint : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -128,7 +128,8 @@
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
       IdentityConstraint(const XMLCh* const identityConstraintName,
  -                       const XMLCh* const elementName);
  +                       const XMLCh* const elementName,
  +					   MemoryManager* const manager);
   
   private:
       // -----------------------------------------------------------------------
  @@ -161,6 +162,7 @@
       XMLCh*                 fElemName;
       IC_Selector*           fSelector;
       RefVectorOf<IC_Field>* fFields;
  +    MemoryManager*         fMemoryManager;
   };
   
   
  @@ -197,7 +199,7 @@
   inline void IdentityConstraint::addField(IC_Field* const field) {
   
       if (!fFields) {
  -        fFields = new RefVectorOf<IC_Field>(4);
  +        fFields = new (fMemoryManager) RefVectorOf<IC_Field>(4);
       }
   
       fFields->addElement(field);
  
  
  
  1.6       +11 -5     xml-xerces/c/src/xercesc/validators/schema/identity/ValueStore.cpp
  
  Index: ValueStore.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/ValueStore.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ValueStore.cpp	4 Dec 2002 02:32:43 -0000	1.5
  +++ ValueStore.cpp	15 May 2003 18:59:34 -0000	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.5  2002/12/04 02:32:43  knoaman
    * #include cleanup.
    *
  @@ -99,13 +102,16 @@
   //  ValueStore: Constructors and Destructor
   // ---------------------------------------------------------------------------
   ValueStore::ValueStore(IdentityConstraint* const ic,
  -                       XMLScanner* const scanner)
  +                       XMLScanner* const scanner,
  +                       MemoryManager* const manager)
       : fDoReportError(false)
       , fValuesCount(0)
       , fIdentityConstraint(ic)
  +    , fValues(manager)
       , fValueTuples(0)
       , fKeyValueStore(0)
       , fScanner(scanner)
  +    , fMemoryManager(manager)
   {
   	fDoReportError = (scanner && scanner->getDoValidation());
   }
  @@ -156,10 +162,10 @@
   
           // store values
           if (!fValueTuples) {
  -            fValueTuples = new RefVectorOf<FieldValueMap>(4);
  +            fValueTuples = new (fMemoryManager) RefVectorOf<FieldValueMap>(4);
           }
   
  -        fValueTuples->addElement(new FieldValueMap(fValues));
  +        fValueTuples->addElement(new (fMemoryManager) FieldValueMap(fValues));
       }
   }
   
  @@ -178,10 +184,10 @@
           if (!contains(valueMap)) {
   
               if (!fValueTuples) {
  -                fValueTuples = new RefVectorOf<FieldValueMap>(4);
  +                fValueTuples = new (fMemoryManager) RefVectorOf<FieldValueMap>(4);
               }
   
  -            fValueTuples->addElement(new FieldValueMap(*valueMap));
  +            fValueTuples->addElement(new (fMemoryManager) FieldValueMap(*valueMap));
           }
       }
   }
  
  
  
  1.4       +7 -4      xml-xerces/c/src/xercesc/validators/schema/identity/ValueStore.hpp
  
  Index: ValueStore.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/ValueStore.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ValueStore.hpp	18 Dec 2002 14:17:59 -0000	1.3
  +++ ValueStore.hpp	15 May 2003 18:59:34 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -83,13 +83,15 @@
   class ValueStoreCache;
   
   
  -class VALIDATORS_EXPORT ValueStore
  +class VALIDATORS_EXPORT ValueStore : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    ValueStore(IdentityConstraint* const ic, XMLScanner* const scanner);
  +    ValueStore(IdentityConstraint* const ic,
  +               XMLScanner* const scanner,
  +               MemoryManager* const manager);
   	~ValueStore();
   
   	// -----------------------------------------------------------------------
  @@ -150,6 +152,7 @@
       RefVectorOf<FieldValueMap>* fValueTuples;
       ValueStore*                 fKeyValueStore;
       XMLScanner*                 fScanner; // for error reporting - REVISIT
  +    MemoryManager*              fMemoryManager;
   };
   
   // ---------------------------------------------------------------------------
  
  
  
  1.6       +13 -8     xml-xerces/c/src/xercesc/validators/schema/identity/ValueStoreCache.cpp
  
  Index: ValueStoreCache.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/ValueStoreCache.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ValueStoreCache.cpp	4 Nov 2002 14:47:41 -0000	1.5
  +++ ValueStoreCache.cpp	15 May 2003 18:59:34 -0000	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.5  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -89,11 +92,13 @@
   // ---------------------------------------------------------------------------
   //  ValueStoreCache: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -ValueStoreCache::ValueStoreCache()
  +ValueStoreCache::ValueStoreCache(MemoryManager* const manager)
       : fValueStores(0)
       , fGlobalICMap(0)
       , fIC2ValueStoreMap(0)
       , fGlobalMapStack(0)
  +    , fScanner(0)
  +    , fMemoryManager(manager)
   {
       try {
           init();
  @@ -124,7 +129,7 @@
   void ValueStoreCache::startElement() {
   
       fGlobalMapStack->push(fGlobalICMap);
  -    fGlobalICMap = new RefHashTableOf<ValueStore>(13, false, new HashPtr());
  +    fGlobalICMap = new (fMemoryManager) RefHashTableOf<ValueStore>(13, false, new (fMemoryManager) HashPtr());
   }
   
   void ValueStoreCache::endElement() {
  @@ -166,10 +171,10 @@
   
   void ValueStoreCache::init() {
   
  -    fValueStores = new RefVectorOf<ValueStore>(8);
  -    fGlobalICMap = new RefHashTableOf<ValueStore>(13, false, new HashPtr());
  -    fIC2ValueStoreMap = new RefHash2KeysTableOf<ValueStore>(13, false, new HashPtr());
  -    fGlobalMapStack = new RefStackOf<RefHashTableOf<ValueStore> >(8);
  +    fValueStores = new (fMemoryManager) RefVectorOf<ValueStore>(8);
  +    fGlobalICMap = new (fMemoryManager) RefHashTableOf<ValueStore>(13, false, new (fMemoryManager) HashPtr());
  +    fIC2ValueStoreMap = new (fMemoryManager) RefHash2KeysTableOf<ValueStore>(13, false, new (fMemoryManager) HashPtr());
  +    fGlobalMapStack = new (fMemoryManager) RefStackOf<RefHashTableOf<ValueStore> >(8);
   }
   
   void ValueStoreCache::initValueStoresFor(SchemaElementDecl* const elemDecl,
  @@ -181,7 +186,7 @@
       for (unsigned int i=0; i<icCount; i++) {
   
           IdentityConstraint* ic = elemDecl->getIdentityConstraintAt(i);
  -        ValueStore* valueStore = valueStore = new ValueStore(ic, fScanner);
  +        ValueStore* valueStore = valueStore = new (fMemoryManager) ValueStore(ic, fScanner, fMemoryManager);
           fValueStores->addElement(valueStore);
           fIC2ValueStoreMap->put(ic, initialDepth, valueStore);
       }
  @@ -199,7 +204,7 @@
       if (currVals) {
           currVals->append(newVals);
       } else {
  -        ValueStore* valueStore = new ValueStore(ic, fScanner);
  +        ValueStore* valueStore = new (fMemoryManager) ValueStore(ic, fScanner, fMemoryManager);
           fValueStores->addElement(valueStore);
           valueStore->append(newVals);
           fGlobalICMap->put(ic, valueStore);
  
  
  
  1.5       +5 -4      xml-xerces/c/src/xercesc/validators/schema/identity/ValueStoreCache.hpp
  
  Index: ValueStoreCache.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/ValueStoreCache.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ValueStoreCache.hpp	4 Nov 2002 14:47:41 -0000	1.4
  +++ ValueStoreCache.hpp	15 May 2003 18:59:34 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -99,13 +99,13 @@
   class XMLScanner;
   
   
  -class VALIDATORS_EXPORT ValueStoreCache
  +class VALIDATORS_EXPORT ValueStoreCache : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    ValueStoreCache();
  +    ValueStoreCache(MemoryManager* const manager);
   	~ValueStoreCache();
   
   	// -----------------------------------------------------------------------
  @@ -164,6 +164,7 @@
       RefHash2KeysTableOf<ValueStore>*         fIC2ValueStoreMap;
       RefStackOf<RefHashTableOf<ValueStore> >* fGlobalMapStack;
       XMLScanner*                              fScanner;
  +    MemoryManager*                           fMemoryManager;
   };
   
   // ---------------------------------------------------------------------------
  
  
  
  1.7       +23 -7     xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcher.cpp
  
  Index: XPathMatcher.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcher.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XPathMatcher.cpp	13 Jan 2003 20:16:52 -0000	1.6
  +++ XPathMatcher.cpp	15 May 2003 18:59:34 -0000	1.7
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.7  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.6  2003/01/13 20:16:52  knoaman
    * [Bug 16024] SchemaSymbols.hpp conflicts C++ Builder 6 dir.h
    *
  @@ -97,7 +100,8 @@
   // ---------------------------------------------------------------------------
   //  XPathMatcher: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -XPathMatcher::XPathMatcher(XercesXPath* const xpath)
  +XPathMatcher::XPathMatcher( XercesXPath* const xpath
  +                          , MemoryManager* const manager)
       : fLocationPathSize(0)
       , fMatched(0)
       , fNoMatchDepth(0)
  @@ -105,6 +109,7 @@
       , fStepIndexes(0)
       , fLocationPaths(0)
       , fIdentityConstraint(0)
  +    , fMemoryManager(manager)
   {
       try {
           init(xpath);
  @@ -118,7 +123,8 @@
   
   
   XPathMatcher::XPathMatcher(XercesXPath* const xpath,
  -                           IdentityConstraint* const ic)
  +                           IdentityConstraint* const ic,
  +						   MemoryManager* const manager)
       : fLocationPathSize(0)
       , fMatched(0)
       , fNoMatchDepth(0)
  @@ -126,6 +132,7 @@
       , fStepIndexes(0)
       , fLocationPaths(0)
       , fIdentityConstraint(ic)
  +    , fMemoryManager(manager)
   {
       try {
           init(xpath);
  @@ -155,13 +162,22 @@
   
           if (fLocationPathSize) {
   
  -            fStepIndexes = new RefVectorOf<ValueStackOf<int> >(fLocationPathSize);
  -            fCurrentStep = new int[fLocationPathSize];
  -            fNoMatchDepth = new int[fLocationPathSize];
  -            fMatched = new int[fLocationPathSize];
  +            fStepIndexes = new (fMemoryManager) RefVectorOf<ValueStackOf<int> >(fLocationPathSize);
  +            fCurrentStep = (int*) fMemoryManager->allocate
  +            (
  +                fLocationPathSize * sizeof(int)
  +            );//new int[fLocationPathSize];
  +            fNoMatchDepth = (int*) fMemoryManager->allocate
  +            (
  +                fLocationPathSize * sizeof(int)
  +            );//new int[fLocationPathSize];
  +            fMatched = (int*) fMemoryManager->allocate
  +            (
  +                fLocationPathSize * sizeof(int)
  +            );//new int[fLocationPathSize];
   
               for(unsigned int i=0; i < fLocationPathSize; i++) {
  -                fStepIndexes->addElement(new ValueStackOf<int>(8));
  +                fStepIndexes->addElement(new (fMemoryManager) ValueStackOf<int>(8));
               }
           }
       }
  
  
  
  1.5       +12 -8     xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcher.hpp
  
  Index: XPathMatcher.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcher.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XPathMatcher.hpp	13 Jan 2003 16:30:19 -0000	1.4
  +++ XPathMatcher.hpp	15 May 2003 18:59:34 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -82,21 +82,24 @@
   class XercesLocationPath;
   class XMLAttr;
   
  -class VALIDATORS_EXPORT XPathMatcher
  +class VALIDATORS_EXPORT XPathMatcher : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    XPathMatcher(XercesXPath* const xpath);
       XPathMatcher(XercesXPath* const xpath,
  -                 IdentityConstraint* const ic);
  +                 MemoryManager* const manager);
  +    XPathMatcher(XercesXPath* const xpath,
  +                 IdentityConstraint* const ic,
  +                 MemoryManager* const manager);
       virtual ~XPathMatcher();
   
       // -----------------------------------------------------------------------
       //  Getter methods
       // -----------------------------------------------------------------------
       IdentityConstraint* getIdentityConstraint() const { return fIdentityConstraint; }
  +    MemoryManager* getMemoryManager() const { return fMemoryManager; }
   
       // -----------------------------------------------------------------------
       //  Match methods
  @@ -181,6 +184,7 @@
       RefVectorOf<ValueStackOf<int> >* fStepIndexes;
       RefVectorOf<XercesLocationPath>* fLocationPaths;
       IdentityConstraint*              fIdentityConstraint;
  +    MemoryManager*                   fMemoryManager;
   };
   
   // ---------------------------------------------------------------------------
  @@ -188,9 +192,9 @@
   // ---------------------------------------------------------------------------
   inline void XPathMatcher::cleanUp() {
   
  -    delete [] fMatched;
  -    delete [] fNoMatchDepth;
  -    delete [] fCurrentStep;
  +    fMemoryManager->deallocate(fMatched);//delete [] fMatched;
  +    fMemoryManager->deallocate(fNoMatchDepth);//delete [] fNoMatchDepth;
  +    fMemoryManager->deallocate(fCurrentStep);//delete [] fCurrentStep;
       delete fStepIndexes;
   }
   
  
  
  
  1.3       +6 -3      xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcherStack.cpp
  
  Index: XPathMatcherStack.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcherStack.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XPathMatcherStack.cpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ XPathMatcherStack.cpp	15 May 2003 18:59:34 -0000	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.3  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.2  2002/11/04 14:47:41  tng
    * C++ Namespace Support.
    *
  @@ -77,13 +80,13 @@
   // ---------------------------------------------------------------------------
   //  XPathMatherStack: Constructors and Destructor
   // ---------------------------------------------------------------------------
  -XPathMatcherStack::XPathMatcherStack()
  +XPathMatcherStack::XPathMatcherStack(MemoryManager* const manager)
       : fMatchersCount(0)
  -    , fContextStack(new ValueStackOf<int>(8))
  +    , fContextStack(new (manager) ValueStackOf<int>(8))
       , fMatchers(0)
   {
       try {
  -        fMatchers = new RefVectorOf<XPathMatcher>(8);
  +        fMatchers = new (manager) RefVectorOf<XPathMatcher>(8);
       }
       catch(...) {
   
  
  
  
  1.3       +4 -4      xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcherStack.hpp
  
  Index: XPathMatcherStack.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/XPathMatcherStack.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XPathMatcherStack.hpp	4 Nov 2002 14:47:41 -0000	1.2
  +++ XPathMatcherStack.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -69,13 +69,13 @@
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  -class VALIDATORS_EXPORT XPathMatcherStack
  +class VALIDATORS_EXPORT XPathMatcherStack : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors/Destructor
       // -----------------------------------------------------------------------
  -    XPathMatcherStack();
  +    XPathMatcherStack(MemoryManager* const manager);
   	~XPathMatcherStack();
   
   	// -----------------------------------------------------------------------
  
  
  
  1.6       +30 -24    xml-xerces/c/src/xercesc/validators/schema/identity/XercesXPath.cpp
  
  Index: XercesXPath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/XercesXPath.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XercesXPath.cpp	20 Dec 2002 22:10:48 -0000	1.5
  +++ XercesXPath.cpp	15 May 2003 18:59:34 -0000	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/05/15 18:59:34  knoaman
  + * Partial implementation of the configurable memory manager.
  + *
    * Revision 1.5  2002/12/20 22:10:48  tng
    * XML 1.1
    *
  @@ -270,10 +273,13 @@
                            const unsigned int emptyNamespaceId,
                            const bool isSelector)
       : fEmptyNamespaceId(emptyNamespaceId)
  -    , fExpression(XMLString::replicate(xpathExpr))
  +    , fExpression(0)
       , fLocationPaths(0)
  +    , fMemoryManager(XMLPlatformUtils::fgMemoryManager)
   {
  -    try {
  +    try
  +    {
  +        fExpression = XMLString::replicate(xpathExpr, fMemoryManager);
           parseExpression(stringPool, scopeContext);
   
           if (isSelector) {
  @@ -320,7 +326,7 @@
   // ---------------------------------------------------------------------------
   void XercesXPath::cleanUp() {
   
  -    delete [] fExpression;
  +    fMemoryManager->deallocate(fExpression);//delete [] fExpression;
       delete fLocationPaths;
   }
   
  @@ -356,11 +362,11 @@
       bool                              success = scanner.scanExpression(fExpression, 0, length, &tokens);
       bool                              firstTokenOfLocationPath=true;
       unsigned int                      tokenCount = tokens.size();
  -    RefVectorOf<XercesStep>*          stepsVector = new RefVectorOf<XercesStep>(16);
  +    RefVectorOf<XercesStep>*          stepsVector = new (fMemoryManager) RefVectorOf<XercesStep>(16);
       Janitor<RefVectorOf<XercesStep> > janSteps(stepsVector);
   
       if (tokenCount) {
  -        fLocationPaths = new RefVectorOf<XercesLocationPath>(8);
  +        fLocationPaths = new (fMemoryManager) RefVectorOf<XercesLocationPath>(8);
       }
   
       for (unsigned int i = 0; i < tokenCount; i++) {
  @@ -381,9 +387,9 @@
                       ThrowXML(XPathException, XMLExcepts::XPath_NoMultipleUnion);
                   }
   
  -                fLocationPaths->addElement(new XercesLocationPath(stepsVector));
  +                fLocationPaths->addElement(new (fMemoryManager) XercesLocationPath(stepsVector));
                   janSteps.orphan();
  -                stepsVector = new RefVectorOf<XercesStep>(16);
  +                stepsVector = new (fMemoryManager) RefVectorOf<XercesStep>(16);
                   janSteps.reset(stepsVector);
                   firstTokenOfLocationPath = true;
               }
  @@ -414,8 +420,8 @@
   
                   case XercesXPath::EXPRTOKEN_NAMETEST_ANY:
                       {
  -                        XercesNodeTest* nodeTest = new XercesNodeTest(XercesNodeTest::WILDCARD);
  -                        XercesStep* step = new XercesStep(XercesStep::ATTRIBUTE, nodeTest);
  +                        XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::WILDCARD);
  +                        XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::ATTRIBUTE, nodeTest);
                           stepsVector->addElement(step);
                           break;
                       }
  @@ -443,8 +449,8 @@
                           if (isNamespaceAtt) {
   
                               // build step
  -                            XercesNodeTest* nodeTest = new XercesNodeTest(prefix, uri);
  -                            XercesStep* step = new XercesStep(XercesStep::ATTRIBUTE, nodeTest);
  +                            XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(prefix, uri);
  +                            XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::ATTRIBUTE, nodeTest);
                               stepsVector->addElement(step);
                               break;
                           }
  @@ -455,8 +461,8 @@
                           QName aQName(prefix, localPart, uri);
   
                           // build step
  -                        XercesNodeTest* nodeTest = new XercesNodeTest(&aQName);
  -                        XercesStep* step = new XercesStep(XercesStep::ATTRIBUTE, nodeTest);
  +                        XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(&aQName);
  +                        XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::ATTRIBUTE, nodeTest);
                           stepsVector->addElement(step);
                           break;
                       }
  @@ -484,8 +490,8 @@
               }
           case XercesXPath::EXPRTOKEN_NAMETEST_ANY:
               {
  -                XercesNodeTest* nodeTest = new XercesNodeTest(XercesNodeTest::WILDCARD);
  -                XercesStep* step = new XercesStep(XercesStep::CHILD, nodeTest);
  +                XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::WILDCARD);
  +                XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::CHILD, nodeTest);
                   stepsVector->addElement(step);
                   firstTokenOfLocationPath = false;
                   break;
  @@ -515,8 +521,8 @@
                   if (isNamespace) {
   
                       // build step
  -                    XercesNodeTest* nodeTest = new XercesNodeTest(prefix, uri);
  -                    XercesStep* step = new XercesStep(XercesStep::CHILD, nodeTest);
  +                    XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(prefix, uri);
  +                    XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::CHILD, nodeTest);
                       stepsVector->addElement(step);
                       break;
                   }
  @@ -526,8 +532,8 @@
                   QName aQName(prefix, localPart, uri);
   
                   // build step
  -                XercesNodeTest* nodeTest = new XercesNodeTest(&aQName);
  -                XercesStep* step = new XercesStep(XercesStep::CHILD, nodeTest);
  +                XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(&aQName);
  +                XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::CHILD, nodeTest);
                   stepsVector->addElement(step);
                   firstTokenOfLocationPath = false;
                   break;
  @@ -535,8 +541,8 @@
           case XercesXPath::EXPRTOKEN_PERIOD:
               {
                   // build step
  -                XercesNodeTest* nodeTest = new XercesNodeTest(XercesNodeTest::NODE);
  -                XercesStep* step = new XercesStep(XercesStep::SELF, nodeTest);
  +                XercesNodeTest* nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NODE);
  +                XercesStep* step = new (fMemoryManager) XercesStep(XercesStep::SELF, nodeTest);
                   stepsVector->addElement(step);
   
                   if (firstTokenOfLocationPath && i+1 < tokenCount) {
  @@ -558,8 +564,8 @@
                               }
                           }
                           // build step
  -                        nodeTest = new XercesNodeTest(XercesNodeTest::NODE);
  -                        step = new XercesStep(XercesStep::DESCENDANT, nodeTest);
  +                        nodeTest = new (fMemoryManager) XercesNodeTest(XercesNodeTest::NODE);
  +                        step = new (fMemoryManager) XercesStep(XercesStep::DESCENDANT, nodeTest);
                           stepsVector->addElement(step);
                       }
                   }
  @@ -604,7 +610,7 @@
           }
       }
   
  -    fLocationPaths->addElement(new XercesLocationPath(stepsVector));
  +    fLocationPaths->addElement(new (fMemoryManager) XercesLocationPath(stepsVector));
       janSteps.orphan();
   }
   
  
  
  
  1.3       +9 -7      xml-xerces/c/src/xercesc/validators/schema/identity/XercesXPath.hpp
  
  Index: XercesXPath.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/identity/XercesXPath.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XercesXPath.hpp	4 Nov 2002 14:47:42 -0000	1.2
  +++ XercesXPath.hpp	15 May 2003 18:59:34 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -78,7 +78,7 @@
   class NamespaceScope;
   
   
  -class VALIDATORS_EXPORT XercesNodeTest
  +class VALIDATORS_EXPORT XercesNodeTest : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -125,7 +125,8 @@
   /**
     * A location path step comprised of an axis and node test.
     */
  -class VALIDATORS_EXPORT XercesStep {
  +class VALIDATORS_EXPORT XercesStep : public XMemory
  +{
   public:
       // -----------------------------------------------------------------------
       //  Constants
  @@ -169,7 +170,7 @@
   /**
     * A location path representation for an XPath expression.
     */
  -class VALIDATORS_EXPORT XercesLocationPath
  +class VALIDATORS_EXPORT XercesLocationPath : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -206,7 +207,7 @@
   };
   
   
  -class VALIDATORS_EXPORT XercesXPath
  +class VALIDATORS_EXPORT XercesXPath : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  @@ -311,10 +312,11 @@
       unsigned int                     fEmptyNamespaceId;
       XMLCh*                           fExpression;
       RefVectorOf<XercesLocationPath>* fLocationPaths;
  +    MemoryManager*                   fMemoryManager;
   };
   
   
  -class VALIDATORS_EXPORT XPathScanner
  +class VALIDATORS_EXPORT XPathScanner : public XMemory
   {
   public:
       // -----------------------------------------------------------------------
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org