From 072e9ab0d65ec60dc59014dbb2fbb7b797660cc9 Mon Sep 17 00:00:00 2001
From: Gareth Reakes <gareth@apache.org>
Date: Mon, 20 Oct 2003 11:46:28 +0000
Subject: [PATCH] Pass in memory manager to constructors and use for creation
 of enumerators.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175294 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/validators/DTD/DTDAttDefList.cpp     | 16 ++++++++++------
 src/xercesc/validators/DTD/DTDAttDefList.hpp     |  6 +++++-
 .../validators/schema/SchemaAttDefList.cpp       | 12 ++++++++----
 .../validators/schema/SchemaAttDefList.hpp       |  6 +++++-
 4 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/src/xercesc/validators/DTD/DTDAttDefList.cpp b/src/xercesc/validators/DTD/DTDAttDefList.cpp
index e6a04c40d..c568c9eab 100644
--- a/src/xercesc/validators/DTD/DTDAttDefList.cpp
+++ b/src/xercesc/validators/DTD/DTDAttDefList.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2003/10/20 11:46:28  gareth
+ * Pass in memory manager to constructors and use for creation of enumerators.
+ *
  * Revision 1.4  2003/10/17 21:14:30  peiyongz
  * using XTemplateSerializer
  *
@@ -89,7 +92,6 @@
 //  Includes
 // ---------------------------------------------------------------------------
 #include <xercesc/validators/DTD/DTDAttDefList.hpp>
-
 #include <xercesc/internal/XTemplateSerializer.hpp>
 
 XERCES_CPP_NAMESPACE_BEGIN
@@ -97,11 +99,12 @@ XERCES_CPP_NAMESPACE_BEGIN
 // ---------------------------------------------------------------------------
 //  DTDAttDefList: Constructors and Destructor
 // ---------------------------------------------------------------------------
-DTDAttDefList::DTDAttDefList(RefHashTableOf<DTDAttDef>* const listToUse)
-:fEnum(0)
+DTDAttDefList::DTDAttDefList(RefHashTableOf<DTDAttDef>* const listToUse, MemoryManager* const manager)
+: XMLAttDefList(manager)
+,fEnum(0)
 ,fList(listToUse)
 {
-    fEnum = new RefHashTableOfEnumerator<DTDAttDef>(listToUse);
+    fEnum = new (getMemoryManager()) RefHashTableOfEnumerator<DTDAttDef>(listToUse);
 }
 
 DTDAttDefList::~DTDAttDefList()
@@ -203,7 +206,7 @@ void DTDAttDefList::serialize(XSerializeEngine& serEng)
 
         if (!fEnum && fList)
         {
-            fEnum = new RefHashTableOfEnumerator<DTDAttDef>(fList);
+             fEnum = new (getMemoryManager()) RefHashTableOfEnumerator<DTDAttDef>(fList);
         }
     }
 
@@ -211,7 +214,8 @@ void DTDAttDefList::serialize(XSerializeEngine& serEng)
 
 	
 DTDAttDefList::DTDAttDefList(MemoryManager* const manager)
-:fEnum(0)
+: XMLAttDefList(manager)
+,fEnum(0)
 ,fList(0)
 {
 }
diff --git a/src/xercesc/validators/DTD/DTDAttDefList.hpp b/src/xercesc/validators/DTD/DTDAttDefList.hpp
index 63a072dc1..3d627ec97 100644
--- a/src/xercesc/validators/DTD/DTDAttDefList.hpp
+++ b/src/xercesc/validators/DTD/DTDAttDefList.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2003/10/20 11:46:28  gareth
+ * Pass in memory manager to constructors and use for creation of enumerators.
+ *
  * Revision 1.4  2003/10/10 16:24:51  peiyongz
  * Implementation of Serialization/Deserialization
  *
@@ -116,7 +119,8 @@ public :
     // -----------------------------------------------------------------------
     DTDAttDefList
     (
-        RefHashTableOf<DTDAttDef>* const    listToUse
+        RefHashTableOf<DTDAttDef>* const    listToUse,
+        MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
 
     ~DTDAttDefList();
diff --git a/src/xercesc/validators/schema/SchemaAttDefList.cpp b/src/xercesc/validators/schema/SchemaAttDefList.cpp
index e53544661..5f93b96ed 100644
--- a/src/xercesc/validators/schema/SchemaAttDefList.cpp
+++ b/src/xercesc/validators/schema/SchemaAttDefList.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2003/10/20 11:46:28  gareth
+ * Pass in memory manager to constructors and use for creation of enumerators.
+ *
  * Revision 1.5  2003/10/17 21:17:12  peiyongz
  * using XTemplateSerializer
  *
@@ -92,11 +95,12 @@ XERCES_CPP_NAMESPACE_BEGIN
 // ---------------------------------------------------------------------------
 //  SchemaAttDefList: Constructors and Destructor
 // ---------------------------------------------------------------------------
-SchemaAttDefList::SchemaAttDefList(RefHash2KeysTableOf<SchemaAttDef>* const listToUse)
-:fEnum(0)
+SchemaAttDefList::SchemaAttDefList(RefHash2KeysTableOf<SchemaAttDef>* const listToUse, MemoryManager* const manager)
+: XMLAttDefList(manager)
+,fEnum(0)
 ,fList(listToUse)
 {
-    fEnum = new RefHash2KeysTableOfEnumerator<SchemaAttDef>(listToUse);
+    fEnum = new (getMemoryManager()) RefHash2KeysTableOfEnumerator<SchemaAttDef>(listToUse);
 }
 
 SchemaAttDefList::~SchemaAttDefList()
@@ -200,7 +204,7 @@ void SchemaAttDefList::serialize(XSerializeEngine& serEng)
 
         if (!fEnum && fList)
         {
-            fEnum = new RefHash2KeysTableOfEnumerator<SchemaAttDef>(fList);
+            fEnum = new (getMemoryManager()) RefHash2KeysTableOfEnumerator<SchemaAttDef>(fList);
         }
     }
 
diff --git a/src/xercesc/validators/schema/SchemaAttDefList.hpp b/src/xercesc/validators/schema/SchemaAttDefList.hpp
index 724f57443..599fe2dbc 100644
--- a/src/xercesc/validators/schema/SchemaAttDefList.hpp
+++ b/src/xercesc/validators/schema/SchemaAttDefList.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2003/10/20 11:46:28  gareth
+ * Pass in memory manager to constructors and use for creation of enumerators.
+ *
  * Revision 1.4  2003/10/10 16:25:40  peiyongz
  * Implementation of Serialization/Deserialization
  *
@@ -106,7 +109,8 @@ public :
     // -----------------------------------------------------------------------
     SchemaAttDefList
     (
-        RefHash2KeysTableOf<SchemaAttDef>* const    listToUse
+         RefHash2KeysTableOf<SchemaAttDef>* const    listToUse,
+         MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
 
     ~SchemaAttDefList();
-- 
GitLab