peiyongz 2003/06/20 11:48:38
Modified: c/src/xercesc/dom/deprecated DOMParser.cpp DOMParser.hpp
Log:
Stateless Grammar Pool :: Part I
Revision Changes Path
1.20 +6 -4 xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp
Index: DOMParser.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- DOMParser.cpp 1 Jun 2003 15:51:43 -0000 1.19
+++ DOMParser.cpp 20 Jun 2003 18:48:37 -0000 1.20
@@ -99,8 +99,9 @@
// ---------------------------------------------------------------------------
// DOMParser: Constructors and Destructor
// ---------------------------------------------------------------------------
-DOMParser::DOMParser( XMLValidator* const valToAdopt
- , MemoryManager* const manager) :
+DOMParser::DOMParser( XMLValidator* const valToAdopt
+ , MemoryManager* const manager
+ , XMLGrammarPool* const gramPool) :
fToCreateXMLDeclTypeNode(false)
, fCreateEntityReferenceNodes(true)
@@ -116,6 +117,7 @@
, fURIStringPool(0)
, fValidator(valToAdopt)
, fMemoryManager(manager)
+ , fGrammarPool(gramPool)
{
try
{
@@ -140,7 +142,7 @@
void DOMParser::initialize()
{
// Create grammar resolver and URI string pool to pass to the scanner
- fGrammarResolver = new (fMemoryManager) GrammarResolver(fMemoryManager);
+ fGrammarResolver = new (fMemoryManager) GrammarResolver(fGrammarPool,
fMemoryManager);
fURIStringPool = new (fMemoryManager) XMLStringPool(109, fMemoryManager);
// Create a scanner and tell it what validator to use. Then set us
1.19 +10 -3 xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.hpp
Index: DOMParser.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/deprecated/DOMParser.hpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- DOMParser.hpp 22 May 2003 02:26:50 -0000 1.18
+++ DOMParser.hpp 20 Jun 2003 18:48:37 -0000 1.19
@@ -82,6 +82,7 @@
class XMLValidator;
class Grammar;
class GrammarResolver;
+class XMLGrammarPool;
/**
* This class implements the Document Object Model (DOM) interface.
@@ -130,8 +131,9 @@
*/
DOMParser
(
- XMLValidator* const valToAdopt = 0
- , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ XMLValidator* const valToAdopt = 0
+ , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
+ , XMLGrammarPool* const gramPool = 0
);
/**
@@ -1737,6 +1739,10 @@
// A flag to create a DOM_XMLDecl node in the ODM tree if it exists
// This is an extension to xerces implementation
//
+ // fGrammarPool
+ // The grammar pool passed from external application (through derivatives).
+ // which could be 0, not owned.
+ //
// -----------------------------------------------------------------------
bool fToCreateXMLDeclTypeNode;
bool fCreateEntityReferenceNodes;
@@ -1755,6 +1761,7 @@
XMLStringPool* fURIStringPool;
XMLValidator* fValidator;
MemoryManager* fMemoryManager;
+ XMLGrammarPool* fGrammarPool;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]