You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by bo...@apache.org on 2008/03/10 15:10:21 UTC
svn commit: r635560 [1/5] - in /xerces/c/trunk:
Projects/MacOS/Xcode/XercesLib/XercesLib.xcode/
Projects/Win32/BCB6/Xerces-all/XercesLib/
Projects/Win32/BCC.551/Xerces-all/XercesLib/
Projects/Win32/VC6/xerces-all/XercesLib/ Projects/Win32/VC7.1/xerces-...
Author: borisk
Date: Mon Mar 10 07:10:09 2008
New Revision: 635560
URL: http://svn.apache.org/viewvc?rev=635560&view=rev
Log:
Get rid of lazy initialization that relied on double-checked locking. Now every static object is initialized in Initialize() and released in Terminate() via XMLInitializer.
Removed:
xerces/c/trunk/src/xercesc/util/XMLRegisterCleanup.cpp
xerces/c/trunk/src/xercesc/util/XMLRegisterCleanup.hpp
Modified:
xerces/c/trunk/Projects/MacOS/Xcode/XercesLib/XercesLib.xcode/project.pbxproj
xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr
xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak
xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp
xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.mak
xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj
xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj
xerces/c/trunk/Projects/Win32/VC9/xerces-all/XercesLib/XercesLib.vcproj
xerces/c/trunk/src/Makefile.am
xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp
xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationRegistry.cpp
xerces/c/trunk/src/xercesc/dom/impl/DOMNodeImpl.cpp
xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.cpp
xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.hpp
xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp
xerces/c/trunk/src/xercesc/framework/XMLValidator.cpp
xerces/c/trunk/src/xercesc/framework/XMLValidator.hpp
xerces/c/trunk/src/xercesc/framework/psvi/XSModel.cpp
xerces/c/trunk/src/xercesc/framework/psvi/XSValue.cpp
xerces/c/trunk/src/xercesc/framework/psvi/XSValue.hpp
xerces/c/trunk/src/xercesc/internal/XMLScanner.cpp
xerces/c/trunk/src/xercesc/internal/XMLScanner.hpp
xerces/c/trunk/src/xercesc/util/EncodingValidator.cpp
xerces/c/trunk/src/xercesc/util/EncodingValidator.hpp
xerces/c/trunk/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp
xerces/c/trunk/src/xercesc/util/PlatformUtils.cpp
xerces/c/trunk/src/xercesc/util/PlatformUtils.hpp
xerces/c/trunk/src/xercesc/util/TransService.cpp
xerces/c/trunk/src/xercesc/util/TransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XML256TableTranscoder390.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XML256TableTranscoder390.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XML88591Transcoder390.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XML88591Transcoder390.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XMLASCIITranscoder390.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XMLASCIITranscoder390.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XMLUTF8Transcoder390.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Uniconv390/XMLUTF8Transcoder390.hpp
xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
xerces/c/trunk/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp
xerces/c/trunk/src/xercesc/util/XML256TableTranscoder.cpp
xerces/c/trunk/src/xercesc/util/XML256TableTranscoder.hpp
xerces/c/trunk/src/xercesc/util/XML88591Transcoder.cpp
xerces/c/trunk/src/xercesc/util/XML88591Transcoder.hpp
xerces/c/trunk/src/xercesc/util/XMLASCIITranscoder.cpp
xerces/c/trunk/src/xercesc/util/XMLASCIITranscoder.hpp
xerces/c/trunk/src/xercesc/util/XMLChTranscoder.cpp
xerces/c/trunk/src/xercesc/util/XMLChTranscoder.hpp
xerces/c/trunk/src/xercesc/util/XMLException.cpp
xerces/c/trunk/src/xercesc/util/XMLException.hpp
xerces/c/trunk/src/xercesc/util/XMLInitializer.cpp
xerces/c/trunk/src/xercesc/util/XMLInitializer.hpp
xerces/c/trunk/src/xercesc/util/XMLUCS4Transcoder.cpp
xerces/c/trunk/src/xercesc/util/XMLUCS4Transcoder.hpp
xerces/c/trunk/src/xercesc/util/XMLUTF16Transcoder.cpp
xerces/c/trunk/src/xercesc/util/XMLUTF16Transcoder.hpp
xerces/c/trunk/src/xercesc/util/XMLUTF8Transcoder.cpp
xerces/c/trunk/src/xercesc/util/XMLUTF8Transcoder.hpp
xerces/c/trunk/src/xercesc/util/regx/RangeTokenMap.cpp
xerces/c/trunk/src/xercesc/util/regx/RangeTokenMap.hpp
xerces/c/trunk/src/xercesc/util/regx/RegularExpression.cpp
xerces/c/trunk/src/xercesc/util/regx/TokenFactory.cpp
xerces/c/trunk/src/xercesc/validators/DTD/DTDGrammar.cpp
xerces/c/trunk/src/xercesc/validators/DTD/DTDGrammar.hpp
xerces/c/trunk/src/xercesc/validators/common/GrammarResolver.cpp
xerces/c/trunk/src/xercesc/validators/datatype/DatatypeValidatorFactory.cpp
xerces/c/trunk/src/xercesc/validators/datatype/DatatypeValidatorFactory.hpp
xerces/c/trunk/src/xercesc/validators/schema/ComplexTypeInfo.cpp
xerces/c/trunk/src/xercesc/validators/schema/ComplexTypeInfo.hpp
xerces/c/trunk/src/xercesc/validators/schema/GeneralAttributeCheck.cpp
xerces/c/trunk/src/xercesc/validators/schema/GeneralAttributeCheck.hpp
xerces/c/trunk/src/xercesc/validators/schema/SchemaGrammar.cpp
xerces/c/trunk/src/xercesc/validators/schema/XSDErrorReporter.cpp
Modified: xerces/c/trunk/Projects/MacOS/Xcode/XercesLib/XercesLib.xcode/project.pbxproj
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/MacOS/Xcode/XercesLib/XercesLib.xcode/project.pbxproj?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/MacOS/Xcode/XercesLib/XercesLib.xcode/project.pbxproj (original)
+++ xerces/c/trunk/Projects/MacOS/Xcode/XercesLib/XercesLib.xcode/project.pbxproj Mon Mar 10 07:10:09 2008
@@ -3368,14 +3368,6 @@
settings = {
};
};
- 9019C4BB05EDC7A5007EE4FE = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.cpp;
- path = XMLRegisterCleanup.cpp;
- refType = 4;
- sourceTree = "<group>";
- };
9019C4BD05EDC7A5007EE4FE = {
fileRef = 9019C4BB05EDC7A5007EE4FE;
isa = PBXBuildFile;
@@ -14158,14 +14150,6 @@
isa = PBXFileReference;
lastKnownFileType = sourcecode.cpp.h;
path = XMLDateTime.hpp;
- refType = 4;
- sourceTree = "<group>";
- };
- F5A6C93E01B968C801000102 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.cpp.h;
- path = XMLRegisterCleanup.hpp;
refType = 4;
sourceTree = "<group>";
};
Modified: xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr (original)
+++ xerces/c/trunk/Projects/Win32/BCB6/Xerces-all/XercesLib/XercesLib.bpr Mon Mar 10 07:10:09 2008
@@ -76,7 +76,6 @@
..\..\..\..\..\Build\Win32\BCB6\obj\XMLInitializer.obj
..\..\..\..\..\Build\Win32\BCB6\obj\XMLMsgLoader.obj
..\..\..\..\..\Build\Win32\BCB6\obj\XMLNumber.obj
- ..\..\..\..\..\Build\Win32\BCB6\obj\XMLRegisterCleanup.obj
..\..\..\..\..\Build\Win32\BCB6\obj\XMLString.obj
..\..\..\..\..\Build\Win32\BCB6\obj\XMLStringTokenizer.obj
..\..\..\..\..\Build\Win32\BCB6\obj\XMLUCS4Transcoder.obj
@@ -447,7 +446,6 @@
<FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLInitializer.cpp" FORMNAME="" UNITNAME="XMLInitializer" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLMsgLoader.cpp" FORMNAME="" UNITNAME="XMLMsgLoader" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLNumber.cpp" FORMNAME="" UNITNAME="XMLNumber" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
- <FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.cpp" FORMNAME="" UNITNAME="XMLRegisterCleanup" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLString.cpp" FORMNAME="" UNITNAME="XMLString" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLStringTokenizer.cpp" FORMNAME="" UNITNAME="XMLStringTokenizer" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\..\..\..\..\src\xercesc\util\XMLUCS4Transcoder.cpp" FORMNAME="" UNITNAME="XMLUCS4Transcoder" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
Modified: xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak (original)
+++ xerces/c/trunk/Projects/Win32/BCC.551/Xerces-all/XercesLib/XercesLib.mak Mon Mar 10 07:10:09 2008
@@ -301,7 +301,6 @@
$(TARGETPATH)\obj\XSValue.obj \
$(TARGETPATH)\obj\IdentityConstraintHandler.obj \
$(TARGETPATH)\obj\XSAXMLScanner.obj \
- $(TARGETPATH)\obj\XMLRegisterCleanup.obj \
$(TARGETPATH)\obj\XMLInitializer.obj \
$(TARGETPATH)\obj\WindowsFileMgr.obj \
$(TARGETPATH)\obj\WindowsMutexMgr.obj \
Modified: xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp (original)
+++ xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp Mon Mar 10 07:10:09 2008
@@ -1123,14 +1123,6 @@
# End Source File
# Begin Source File
-SOURCE=..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.hpp
-# End Source File
-# Begin Source File
-
SOURCE=..\..\..\..\..\src\xercesc\util\XMLResourceIdentifier.hpp
# End Source File
# Begin Source File
Modified: xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.mak
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.mak?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.mak (original)
+++ xerces/c/trunk/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.mak Mon Mar 10 07:10:09 2008
@@ -297,7 +297,6 @@
-@erase "$(INTDIR)\XMLReader.obj"
-@erase "$(INTDIR)\XMLRecognizer.obj"
-@erase "$(INTDIR)\XMLRefInfo.obj"
- -@erase "$(INTDIR)\XMLRegisterCleanup.obj"
-@erase "$(INTDIR)\XMLScanner.obj"
-@erase "$(INTDIR)\XMLScannerResolver.obj"
-@erase "$(INTDIR)\XMLSchemaDescription.obj"
@@ -440,7 +439,6 @@
"$(INTDIR)\XMLInitializer.obj" \
"$(INTDIR)\XMLMsgLoader.obj" \
"$(INTDIR)\XMLNumber.obj" \
- "$(INTDIR)\XMLRegisterCleanup.obj" \
"$(INTDIR)\XMLString.obj" \
"$(INTDIR)\XMLStringTokenizer.obj" \
"$(INTDIR)\XMLUCS4Transcoder.obj" \
@@ -947,7 +945,6 @@
-@erase "$(INTDIR)\XMLReader.obj"
-@erase "$(INTDIR)\XMLRecognizer.obj"
-@erase "$(INTDIR)\XMLRefInfo.obj"
- -@erase "$(INTDIR)\XMLRegisterCleanup.obj"
-@erase "$(INTDIR)\XMLScanner.obj"
-@erase "$(INTDIR)\XMLScannerResolver.obj"
-@erase "$(INTDIR)\XMLSchemaDescription.obj"
@@ -1090,7 +1087,6 @@
"$(INTDIR)\XMLInitializer.obj" \
"$(INTDIR)\XMLMsgLoader.obj" \
"$(INTDIR)\XMLNumber.obj" \
- "$(INTDIR)\XMLRegisterCleanup.obj" \
"$(INTDIR)\XMLString.obj" \
"$(INTDIR)\XMLStringTokenizer.obj" \
"$(INTDIR)\XMLUCS4Transcoder.obj" \
@@ -1597,7 +1593,6 @@
-@erase "$(INTDIR)\XMLReader.obj"
-@erase "$(INTDIR)\XMLRecognizer.obj"
-@erase "$(INTDIR)\XMLRefInfo.obj"
- -@erase "$(INTDIR)\XMLRegisterCleanup.obj"
-@erase "$(INTDIR)\XMLScanner.obj"
-@erase "$(INTDIR)\XMLScannerResolver.obj"
-@erase "$(INTDIR)\XMLSchemaDescription.obj"
@@ -1741,7 +1736,6 @@
"$(INTDIR)\XMLInitializer.obj" \
"$(INTDIR)\XMLMsgLoader.obj" \
"$(INTDIR)\XMLNumber.obj" \
- "$(INTDIR)\XMLRegisterCleanup.obj" \
"$(INTDIR)\XMLString.obj" \
"$(INTDIR)\XMLStringTokenizer.obj" \
"$(INTDIR)\XMLUCS4Transcoder.obj" \
@@ -2247,7 +2241,6 @@
-@erase "$(INTDIR)\XMLReader.obj"
-@erase "$(INTDIR)\XMLRecognizer.obj"
-@erase "$(INTDIR)\XMLRefInfo.obj"
- -@erase "$(INTDIR)\XMLRegisterCleanup.obj"
-@erase "$(INTDIR)\XMLScanner.obj"
-@erase "$(INTDIR)\XMLScannerResolver.obj"
-@erase "$(INTDIR)\XMLSchemaDescription.obj"
@@ -2391,7 +2384,6 @@
"$(INTDIR)\XMLInitializer.obj" \
"$(INTDIR)\XMLMsgLoader.obj" \
"$(INTDIR)\XMLNumber.obj" \
- "$(INTDIR)\XMLRegisterCleanup.obj" \
"$(INTDIR)\XMLString.obj" \
"$(INTDIR)\XMLStringTokenizer.obj" \
"$(INTDIR)\XMLUCS4Transcoder.obj" \
@@ -3204,12 +3196,6 @@
SOURCE=..\..\..\..\..\src\xercesc\util\XMLNumber.cpp
"$(INTDIR)\XMLNumber.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.cpp
-
-"$(INTDIR)\XMLRegisterCleanup.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
Modified: xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj (original)
+++ xerces/c/trunk/Projects/Win32/VC7.1/xerces-all/XercesLib/XercesLib.vcproj Mon Mar 10 07:10:09 2008
@@ -832,12 +832,6 @@
RelativePath="..\..\..\..\..\src\xercesc\util\XMLNumber.hpp">
</File>
<File
- RelativePath="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.cpp">
- </File>
- <File
- RelativePath="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.hpp">
- </File>
- <File
RelativePath="..\..\..\..\..\src\xercesc\util\XMLResourceIdentifier.hpp">
</File>
<File
Modified: xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj (original)
+++ xerces/c/trunk/Projects/Win32/VC8/xerces-all/XercesLib/XercesLib.vcproj Mon Mar 10 07:10:09 2008
@@ -1710,14 +1710,6 @@
>
</File>
<File
- RelativePath="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.hpp"
- >
- </File>
- <File
RelativePath="..\..\..\..\..\src\xercesc\util\XMLResourceIdentifier.hpp"
>
</File>
Modified: xerces/c/trunk/Projects/Win32/VC9/xerces-all/XercesLib/XercesLib.vcproj
URL: http://svn.apache.org/viewvc/xerces/c/trunk/Projects/Win32/VC9/xerces-all/XercesLib/XercesLib.vcproj?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/Projects/Win32/VC9/xerces-all/XercesLib/XercesLib.vcproj (original)
+++ xerces/c/trunk/Projects/Win32/VC9/xerces-all/XercesLib/XercesLib.vcproj Mon Mar 10 07:10:09 2008
@@ -1713,14 +1713,6 @@
>
</File>
<File
- RelativePath="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\..\src\xercesc\util\XMLRegisterCleanup.hpp"
- >
- </File>
- <File
RelativePath="..\..\..\..\..\src\xercesc\util\XMLResourceIdentifier.hpp"
>
</File>
Modified: xerces/c/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/Makefile.am?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/Makefile.am (original)
+++ xerces/c/trunk/src/Makefile.am Mon Mar 10 07:10:09 2008
@@ -710,7 +710,6 @@
xercesc/util/XMLMsgLoader.hpp \
xercesc/util/XMLNetAccessor.hpp \
xercesc/util/XMLNumber.hpp \
- xercesc/util/XMLRegisterCleanup.hpp \
xercesc/util/XMLResourceIdentifier.hpp \
xercesc/util/XMLString.hpp \
xercesc/util/XMLStringTokenizer.hpp \
@@ -789,7 +788,6 @@
xercesc/util/XMLInitializer.cpp \
xercesc/util/XMLMsgLoader.cpp \
xercesc/util/XMLNumber.cpp \
- xercesc/util/XMLRegisterCleanup.cpp \
xercesc/util/XMLString.cpp \
xercesc/util/XMLStringTokenizer.cpp \
xercesc/util/XMLUCS4Transcoder.cpp \
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMDocumentTypeImpl.cpp Mon Mar 10 07:10:09 2008
@@ -28,7 +28,7 @@
#include <xercesc/util/XMLChar.hpp>
#include <xercesc/util/Mutexes.hpp>
#include <xercesc/util/PlatformUtils.hpp>
-#include <xercesc/util/XMLRegisterCleanup.hpp>
+#include <xercesc/util/XMLInitializer.hpp>
#include "DOMNamedNodeMapImpl.hpp"
#include "DOMDocumentImpl.hpp"
@@ -36,40 +36,21 @@
XERCES_CPP_NAMESPACE_BEGIN
-// ---------------------------------------------------------------------------
-// Local static data
-// ---------------------------------------------------------------------------
-
static DOMDocument* sDocument = 0;
-static XMLRegisterCleanup documentCleanup;
-static void reinitDocument()
+void XMLInitializer::initializeDOMDocumentTypeImpl()
{
- if (sDocument) {
- sDocument->release();
- sDocument = 0;
- }
+ static const XMLCh gCoreStr[] = { chLatin_C, chLatin_o, chLatin_r, chLatin_e, chNull };
+ DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(gCoreStr);
+ sDocument = impl->createDocument(); // document type object (DTD).
}
-static DOMDocument& gDocTypeDocument()
+void XMLInitializer::terminateDOMDocumentTypeImpl()
{
- if (!sDocument)
- {
- XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
-
- if (!sDocument)
- {
- static const XMLCh gCoreStr[] = { chLatin_C, chLatin_o, chLatin_r, chLatin_e, chNull };
- DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(gCoreStr);
- sDocument = impl->createDocument(); // document type object (DTD).
- documentCleanup.registerCleanup(reinitDocument);
- }
- }
-
- return *sDocument;
+ sDocument->release();
+ sDocument = 0;
}
-
DOMDocumentTypeImpl::DOMDocumentTypeImpl(DOMDocument *ownerDoc,
const XMLCh *dtName,
bool heap)
@@ -92,7 +73,7 @@
fElements = new (ownerDoc) DOMNamedNodeMapImpl(this);
}
else {
- DOMDocument* doc = &gDocTypeDocument();
+ DOMDocument* doc = sDocument;
fName = ((DOMDocumentImpl *)doc)->getPooledString(dtName);
fEntities = new (doc) DOMNamedNodeMapImpl(this);
fNotations= new (doc) DOMNamedNodeMapImpl(this);
@@ -164,7 +145,7 @@
fElements = new (ownerDoc) DOMNamedNodeMapImpl(this);
}
else {
- DOMDocument* doc = &gDocTypeDocument();
+ DOMDocument* doc = sDocument;
fPublicId = ((DOMDocumentImpl*) doc)->cloneString(pubId);
fSystemId = ((DOMDocumentImpl*) doc)->cloneString(sysId);
fName = ((DOMDocumentImpl*) doc)->getPooledString(qualifiedName);
@@ -216,7 +197,7 @@
if (castToNodeImpl(this)->getOwnerDocument())
newNode = new (castToNodeImpl(this)->getOwnerDocument(), DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
else
- newNode = new (&gDocTypeDocument(), DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
+ newNode = new (sDocument, DOMMemoryManager::DOCUMENT_TYPE_OBJECT) DOMDocumentTypeImpl(*this, false, deep);
fNode.callUserDataHandlers(DOMUserDataHandler::NODE_CLONED, this, newNode);
return newNode;
@@ -343,7 +324,7 @@
if ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())
fPublicId = ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())->cloneString(value);
else {
- fPublicId = ((DOMDocumentImpl *)&gDocTypeDocument())->cloneString(value);
+ fPublicId = ((DOMDocumentImpl *)sDocument)->cloneString(value);
}
}
@@ -352,7 +333,7 @@
if ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())
fSystemId = ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())->cloneString(value);
else {
- fSystemId = ((DOMDocumentImpl *)&gDocTypeDocument())->cloneString(value);
+ fSystemId = ((DOMDocumentImpl *)sDocument)->cloneString(value);
}
}
@@ -361,7 +342,7 @@
if ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())
fInternalSubset = ((DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument())->cloneString(value);
else {
- fInternalSubset = ((DOMDocumentImpl *)&gDocTypeDocument())->cloneString(value);
+ fInternalSubset = ((DOMDocumentImpl *)sDocument)->cloneString(value);
}
}
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationImpl.cpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,6 @@
#include <xercesc/util/XMLInitializer.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
#include <xercesc/util/XMLChar.hpp>
-#include <xercesc/util/XMLRegisterCleanup.hpp>
#include <xercesc/util/XMLStringTokenizer.hpp>
#include <xercesc/util/XMLDOMMsg.hpp>
#include <xercesc/util/XMLMsgLoader.hpp>
@@ -65,116 +64,40 @@
{chLatin_X, chLatin_P, chLatin_a, chLatin_t, chLatin_h, chNull};
-// -----------------------------------------------------------------------
-// Message Loader for DOM
-// -----------------------------------------------------------------------
-static XMLMsgLoader *sMsgLoader4DOM = 0; // Points to the singleton instance
-static XMLMutex *sMutex4DOM = 0;
-static XMLRegisterCleanup mutex4DOMCleanup;
-static XMLRegisterCleanup msgLoader4DOMCleanup;
+static XMLMsgLoader *sMsgLoader = 0;
+static DOMImplementationImpl *gDomimp = 0;
-static void reinitMsgLoader4DOM()
-{
- delete sMsgLoader4DOM;
- sMsgLoader4DOM = 0;
-}
-
-static void reinitMutex4DOM()
+void XMLInitializer::initializeDOMImplementationImpl()
{
- delete sMutex4DOM;
- sMutex4DOM = 0;
-}
+ sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain);
-static XMLMutex& getMutex4DOM()
-{
- if (!sMutex4DOM)
- {
- XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
+ if (!sMsgLoader)
+ XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
- // If we got here first, then register it and set the registered flag
- if (!sMutex4DOM)
- {
- sMutex4DOM = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
- mutex4DOMCleanup.registerCleanup(reinitMutex4DOM);
- }
- }
- return *sMutex4DOM;
+ gDomimp = new DOMImplementationImpl;
}
-XMLMsgLoader* DOMImplementationImpl::getMsgLoader4DOM()
+void XMLInitializer::terminateDOMImplementationImpl()
{
- if (!sMsgLoader4DOM)
- {
- XMLMutexLock lock(&getMutex4DOM());
-
- if (!sMsgLoader4DOM)
- {
- sMsgLoader4DOM = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain);
-
- if (!sMsgLoader4DOM)
- XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
- else
- msgLoader4DOMCleanup.registerCleanup(reinitMsgLoader4DOM);
- }
- }
-
- return sMsgLoader4DOM;
-}
+ delete gDomimp;
+ gDomimp = 0;
-void XMLInitializer::initializeMsgLoader4DOM()
-{
- sMsgLoader4DOM = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLDOMMsgDomain);
- if (sMsgLoader4DOM) {
- msgLoader4DOMCleanup.registerCleanup(reinitMsgLoader4DOM);
- }
+ delete sMsgLoader;
+ sMsgLoader = 0;
}
-// -----------------------------------------------------------------------
-// Singleton DOMImplementationImpl
-// -----------------------------------------------------------------------
-static DOMImplementationImpl *gDomimp = 0; // Points to the singleton instance
- // of DOMImplementation that is returnedreturned
- // by any call to getImplementation().
-static XMLRegisterCleanup implementationCleanup;
-
-static void reinitImplementation()
+//
+//
+XMLMsgLoader* DOMImplementationImpl::getMsgLoader4DOM()
{
- delete gDomimp;
- gDomimp = 0;
+ return sMsgLoader;
}
-// getImplementation() - Always returns the same singleton instance, which
-// is lazily created on the first call. Note that
-// DOM_Implementation must be thread-safe because
-// it is common to all DOM documents, and while a single
-// document is not thread-safe within itself, we do
-// promise that different documents can safely be
-// used concurrently by different threads.
-//
DOMImplementationImpl *DOMImplementationImpl::getDOMImplementationImpl()
{
- if (!gDomimp)
- {
- XMLMutexLock lock(&getMutex4DOM());
-
- if (!gDomimp)
- {
- gDomimp = new DOMImplementationImpl;
- implementationCleanup.registerCleanup(reinitImplementation);
- }
- }
-
return gDomimp;
}
-void XMLInitializer::initializeDOMImplementationImpl()
-{
- gDomimp = new DOMImplementationImpl;
- if (gDomimp) {
- implementationCleanup.registerCleanup(reinitImplementation);
- }
-}
-
// ------------------------------------------------------------
// DOMImplementation Virtual interface
// ------------------------------------------------------------
@@ -270,7 +193,7 @@
)
{
// load the text, the msgToLoad+XMLDOMMsgs::DOMEXCEPTION_ERRX+msgToLoad is the corresponding XMLDOMMsg Code
- return DOMImplementationImpl::getMsgLoader4DOM()->loadMsg(XMLDOMMsg::DOMEXCEPTION_ERRX+msgToLoad, toFill, maxChars);
+ return sMsgLoader->loadMsg(XMLDOMMsg::DOMEXCEPTION_ERRX+msgToLoad, toFill, maxChars);
}
bool DOMImplementation::loadDOMExceptionMsg
@@ -281,7 +204,7 @@
)
{
// load the text, the msgToLoad+XMLDOMMsgs::DOMLSEXCEPTION_ERRX+msgToLoad is the corresponding XMLDOMMsg Code
- return DOMImplementationImpl::getMsgLoader4DOM()->loadMsg(XMLDOMMsg::DOMLSEXCEPTION_ERRX+msgToLoad-DOMLSException::PARSE_ERR+1, toFill, maxChars);
+ return sMsgLoader->loadMsg(XMLDOMMsg::DOMLSEXCEPTION_ERRX+msgToLoad-DOMLSException::PARSE_ERR+1, toFill, maxChars);
}
bool DOMImplementation::loadDOMExceptionMsg
@@ -292,7 +215,7 @@
)
{
// load the text, the XMLDOMMsgs::DOMRANGEEXCEPTION_ERRX+msgToLoad is the corresponding XMLDOMMsg Code
- return DOMImplementationImpl::getMsgLoader4DOM()->loadMsg(XMLDOMMsg::DOMRANGEEXCEPTION_ERRX+msgToLoad, toFill, maxChars);
+ return sMsgLoader->loadMsg(XMLDOMMsg::DOMRANGEEXCEPTION_ERRX+msgToLoad, toFill, maxChars);
}
// ------------------------------------------------------------
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationRegistry.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationRegistry.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationRegistry.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMImplementationRegistry.cpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,10 +19,10 @@
* $Id$
*/
+#include <xercesc/util/Mutexes.hpp>
+#include <xercesc/util/RefVectorOf.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLInitializer.hpp>
-#include <xercesc/util/RefVectorOf.hpp>
-#include <xercesc/util/XMLRegisterCleanup.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
#include <xercesc/dom/DOMImplementationSource.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
@@ -31,109 +31,47 @@
XERCES_CPP_NAMESPACE_BEGIN
-
-// -----------------------------------------------------------------------
-// Static constants. These are lazily initialized on first usage.
-// (Static constructors can not be safely used because
-// of order of initialization dependencies.)
-// -----------------------------------------------------------------------
-// Points to the singleton instance of a registry of DOMImplementationSource
+// Points to the singleton instance of a registry of DOMImplementationSource.
+//
static RefVectorOf<DOMImplementationSource>* gDOMImplSrcVector = 0;
-// Global mutex that is used to synchronize access to the vector
+// Global mutex that is used to synchronize access to the vector.
+//
static XMLMutex* gDOMImplSrcVectorMutex = 0;
-static XMLRegisterCleanup cleanupDOMImplSrcVector;
-static XMLRegisterCleanup cleanupDOMImplSrcVectorMutex;
-
-// -----------------------------------------------------------------------
-// Function prototypes for internally used functions.
-// -----------------------------------------------------------------------
-RefVectorOf<DOMImplementationSource>* getDOMImplSrcVector();
-XMLMutex& getDOMImplSrcVectorMutex();
-
-
-// -----------------------------------------------------------------------
-// Reset the static data
-// -----------------------------------------------------------------------
-static void reinitDOMImplSrcVector()
+void XMLInitializer::initializeDOMImplementationRegistry()
{
- delete gDOMImplSrcVector;
- gDOMImplSrcVector = 0;
+ gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
+ gDOMImplSrcVector = new RefVectorOf<DOMImplementationSource>(3, false);
}
-static void reinitDOMImplSrcVectorMutex()
+void XMLInitializer::terminateDOMImplementationRegistry()
{
+ delete gDOMImplSrcVector;
+ gDOMImplSrcVector = 0;
+
delete gDOMImplSrcVectorMutex;
gDOMImplSrcVectorMutex = 0;
}
// -----------------------------------------------------------------------
-// Get the static data
-// -----------------------------------------------------------------------
-RefVectorOf<DOMImplementationSource>* getDOMImplSrcVector()
-{
- // Note: we are not synchronizing on creation since that caller is doing
- // it (i.e. caller is locking a mutex before calling us)
- if (!gDOMImplSrcVector)
- {
- gDOMImplSrcVector = new RefVectorOf<DOMImplementationSource>(3, false);
- cleanupDOMImplSrcVector.registerCleanup(reinitDOMImplSrcVector);
- }
-
- return gDOMImplSrcVector;
-}
-
-XMLMutex& getDOMImplSrcVectorMutex()
-{
- if (!gDOMImplSrcVectorMutex)
- {
- XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
-
- if (!gDOMImplSrcVectorMutex)
- {
- gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
- cleanupDOMImplSrcVectorMutex.registerCleanup(reinitDOMImplSrcVectorMutex);
- }
- }
-
- return *gDOMImplSrcVectorMutex;
-}
-
-void XMLInitializer::initializeDOMImplementationRegistry()
-{
- // mutex
- gDOMImplSrcVectorMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
- if (gDOMImplSrcVectorMutex) {
- cleanupDOMImplSrcVectorMutex.registerCleanup(reinitDOMImplSrcVectorMutex);
- }
-
- // vector
- gDOMImplSrcVector = new RefVectorOf<DOMImplementationSource>(3, false);
- if (gDOMImplSrcVector) {
- cleanupDOMImplSrcVector.registerCleanup(reinitDOMImplSrcVector);
- }
-}
-
-
-// -----------------------------------------------------------------------
// DOMImplementationRegistry Functions
// -----------------------------------------------------------------------
DOMImplementation *DOMImplementationRegistry::getDOMImplementation(const XMLCh* features) {
- XMLMutexLock lock(&getDOMImplSrcVectorMutex());
+ XMLMutexLock lock(gDOMImplSrcVectorMutex);
- unsigned int len = getDOMImplSrcVector()->size();
+ unsigned int len = gDOMImplSrcVector->size();
// Put our defined source there
if (len == 0) {
- getDOMImplSrcVector()->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl());
+ gDOMImplSrcVector->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl());
- len = getDOMImplSrcVector()->size();
+ len = gDOMImplSrcVector->size();
}
for (unsigned int i = len; i > 0; i--) {
- DOMImplementationSource* source = getDOMImplSrcVector()->elementAt(i-1);
+ DOMImplementationSource* source = gDOMImplSrcVector->elementAt(i-1);
DOMImplementation* impl = source->getDOMImplementation(features);
if (impl)
return impl;
@@ -146,18 +84,18 @@
DOMImplementationListImpl* list = new DOMImplementationListImpl;
- XMLMutexLock lock(&getDOMImplSrcVectorMutex());
+ XMLMutexLock lock(gDOMImplSrcVectorMutex);
- unsigned int len = getDOMImplSrcVector()->size();
+ unsigned int len = gDOMImplSrcVector->size();
// Put our defined source there
if (len == 0)
- getDOMImplSrcVector()->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl());
+ gDOMImplSrcVector->addElement((DOMImplementationSource*)DOMImplementationImpl::getDOMImplementationImpl());
- len = getDOMImplSrcVector()->size();
+ len = gDOMImplSrcVector->size();
for (unsigned int i = len; i > 0; i--) {
- DOMImplementationSource* source = getDOMImplSrcVector()->elementAt(i-1);
+ DOMImplementationSource* source = gDOMImplSrcVector->elementAt(i-1);
DOMImplementationList* oneList = source->getDOMImplementationList(features);
unsigned int oneListLen=oneList->getLength();
for(unsigned int j=0; j<oneListLen; j++)
@@ -168,9 +106,10 @@
return list;
}
-void DOMImplementationRegistry::addSource (DOMImplementationSource* source) {
- XMLMutexLock lock(&getDOMImplSrcVectorMutex());
- getDOMImplSrcVector()->addElement(source);
+void DOMImplementationRegistry::addSource (DOMImplementationSource* source)
+{
+ XMLMutexLock lock(gDOMImplSrcVectorMutex);
+ gDOMImplSrcVector->addElement(source);
}
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMNodeImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMNodeImpl.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMNodeImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMNodeImpl.cpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,7 +34,6 @@
#include <xercesc/dom/DOMException.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
-#include <xercesc/util/XMLRegisterCleanup.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLInitializer.hpp>
#include <stdio.h>
@@ -59,28 +58,19 @@
const unsigned short DOMNodeImpl::CHILDNODE = 0x1<<11;
const unsigned short DOMNodeImpl::TOBERELEASED = 0x1<<12;
-// -----------------------------------------------------------------------
-// Reset the singleton gEmptyNodeList
-// -----------------------------------------------------------------------
-static DOMNodeListImpl *gEmptyNodeList = 0; // make a singleton empty node list
-static XMLMutex* gEmptyNodeListMutex = 0;
-static XMLRegisterCleanup emptyNodeListCleanup;
+//
+//
+static DOMNodeListImpl *gEmptyNodeList = 0; // Singleton empty node list.
-static void reinitEmptyNodeList()
+void XMLInitializer::initializeDOMNodeListImpl()
{
- delete gEmptyNodeList;
- gEmptyNodeList = 0;
-
- delete gEmptyNodeListMutex;
- gEmptyNodeListMutex = 0;
+ gEmptyNodeList = new DOMNodeListImpl(0);
}
-void XMLInitializer::initializeEmptyNodeList()
+void XMLInitializer::terminateDOMNodeListImpl()
{
- gEmptyNodeList = new DOMNodeListImpl(0);
- if (gEmptyNodeList) {
- emptyNodeListCleanup.registerCleanup(reinitEmptyNodeList);
- }
+ delete gEmptyNodeList;
+ gEmptyNodeList = 0;
}
// -----------------------------------------------------------------------
@@ -90,7 +80,7 @@
: fOwnerNode(ownerNode)
{
this->flags = 0;
- // as long as we do not have any owner, fOwnerNode is our ownerDocument
+ // as long as we do not have any owner, fOwnerNode is our ownerDocument
}
// This only makes a shallow copy, cloneChildren must also be called for a
@@ -127,30 +117,7 @@
DOMNodeList *DOMNodeImpl::getChildNodes() const {
-
- if (!gEmptyNodeList)
- {
- if (!gEmptyNodeListMutex)
- {
- XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
-
- if (!gEmptyNodeListMutex)
- gEmptyNodeListMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
- }
-
- // Use a faux scope to synchronize while we do this
- {
- XMLMutexLock lock(gEmptyNodeListMutex);
-
- if (!gEmptyNodeList)
- {
- gEmptyNodeList = new DOMNodeListImpl(0);
- emptyNodeListCleanup.registerCleanup(reinitEmptyNodeList);
- }
- }
- }
-
- return (DOMNodeList *)gEmptyNodeList;
+ return gEmptyNodeList;
}
@@ -659,16 +626,16 @@
return reverseTreeOrderBitPattern(other->compareDocumentPosition(thisNode));
}
- // Otherwise, the order of two nodes is determined by looking for common containers --
- // containers which contain both. A node directly contains any child nodes.
- // A node also directly contains any other nodes attached to it such as attributes
- // contained in an element or entities and notations contained in a document type.
- // Nodes contained in contained nodes are also contained, but less-directly as
+ // Otherwise, the order of two nodes is determined by looking for common containers --
+ // containers which contain both. A node directly contains any child nodes.
+ // A node also directly contains any other nodes attached to it such as attributes
+ // contained in an element or entities and notations contained in a document type.
+ // Nodes contained in contained nodes are also contained, but less-directly as
// the number of intervening containers increases.
- // If one of the nodes being compared contains the other node, then the container precedes
- // the contained node, and reversely the contained node follows the container. For example,
- // when comparing an element against its own attribute or child, the element node precedes
+ // If one of the nodes being compared contains the other node, then the container precedes
+ // the contained node, and reversely the contained node follows the container. For example,
+ // when comparing an element against its own attribute or child, the element node precedes
// its attribute node and its child node, which both follow it.
const DOMNode* tmpNode;
@@ -692,20 +659,20 @@
hisDepth++;
}
- // If there is no common container node, then the order is based upon order between the
- // root container of each node that is in no container. In this case, the result is
- // disconnected and implementation-specific. This result is stable as long as these
- // outer-most containing nodes remain in memory and are not inserted into some other
- // containing node. This would be the case when the nodes belong to different documents
+ // If there is no common container node, then the order is based upon order between the
+ // root container of each node that is in no container. In this case, the result is
+ // disconnected and implementation-specific. This result is stable as long as these
+ // outer-most containing nodes remain in memory and are not inserted into some other
+ // containing node. This would be the case when the nodes belong to different documents
// or fragments, and cloning the document or inserting a fragment might change the order.
if(myRoot!=hisRoot)
return DOMNode::DOCUMENT_POSITION_DISCONNECTED | DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
(myRoot<hisRoot?DOMNode::DOCUMENT_POSITION_PRECEDING:DOMNode::DOCUMENT_POSITION_FOLLOWING);
- // If neither of the previous cases apply, then there exists a most-direct container common
- // to both nodes being compared. In this case, the order is determined based upon the two
- // determining nodes directly contained in this most-direct common container that either
+ // If neither of the previous cases apply, then there exists a most-direct container common
+ // to both nodes being compared. In this case, the order is determined based upon the two
+ // determining nodes directly contained in this most-direct common container that either
// are or contain the corresponding nodes being compared.
// if the two depths are different, go to the same one
@@ -723,7 +690,7 @@
// We now have nodes at the same depth in the tree. Find a common ancestor.
const DOMNode *myNodeP=myRoot;
const DOMNode *hisNodeP=hisRoot;
- while(myRoot!=hisRoot)
+ while(myRoot!=hisRoot)
{
myNodeP = myRoot;
hisNodeP = hisRoot;
@@ -736,8 +703,8 @@
bool bMyNodeIsChild=(myNodeType!=DOMNode::ATTRIBUTE_NODE && myNodeType!=DOMNode::ENTITY_NODE && myNodeType!=DOMNode::NOTATION_NODE);
bool bHisNodeIsChild=(hisNodeType!=DOMNode::ATTRIBUTE_NODE && hisNodeType!=DOMNode::ENTITY_NODE && hisNodeType!=DOMNode::NOTATION_NODE);
- // If these two determining nodes are both child nodes, then the natural DOM order of these
- // determining nodes within the containing node is returned as the order of the corresponding nodes.
+ // If these two determining nodes are both child nodes, then the natural DOM order of these
+ // determining nodes within the containing node is returned as the order of the corresponding nodes.
// This would be the case, for example, when comparing two child elements of the same element.
if(bMyNodeIsChild && bHisNodeIsChild)
{
@@ -750,8 +717,8 @@
return DOMNode::DOCUMENT_POSITION_PRECEDING;
}
- // If one of the two determining nodes is a child node and the other is not, then the corresponding
- // node of the child node follows the corresponding node of the non-child node. This would be the case,
+ // If one of the two determining nodes is a child node and the other is not, then the corresponding
+ // node of the child node follows the corresponding node of the non-child node. This would be the case,
// for example, when comparing an attribute of an element with a child element of the same element.
else if(!bMyNodeIsChild && bHisNodeIsChild)
return DOMNode::DOCUMENT_POSITION_FOLLOWING;
@@ -760,16 +727,16 @@
else
{
- // If neither of the two determining node is a child node and one determining node has a greater value
- // of nodeType than the other, then the corresponding node precedes the other. This would be the case,
+ // If neither of the two determining node is a child node and one determining node has a greater value
+ // of nodeType than the other, then the corresponding node precedes the other. This would be the case,
// for example, when comparing an entity of a document type against a notation of the same document type.
if(myNodeType!=hisNodeType)
return (myNodeType<hisNodeType)?DOMNode::DOCUMENT_POSITION_FOLLOWING:DOMNode::DOCUMENT_POSITION_PRECEDING;
- // If neither of the two determining node is a child node and nodeType is the same for both determining
- // nodes, then an implementation-dependent order between the determining nodes is returned. This order
- // is stable as long as no nodes of the same nodeType are inserted into or removed from the direct container.
- // This would be the case, for example, when comparing two attributes of the same element, and inserting
+ // If neither of the two determining node is a child node and nodeType is the same for both determining
+ // nodes, then an implementation-dependent order between the determining nodes is returned. This order
+ // is stable as long as no nodes of the same nodeType are inserted into or removed from the direct container.
+ // This would be the case, for example, when comparing two attributes of the same element, and inserting
// or removing additional attributes might change the order between existing attributes.
return DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | ((myNodeP<hisNodeP)?DOMNode::DOCUMENT_POSITION_FOLLOWING:DOMNode::DOCUMENT_POSITION_PRECEDING);
}
@@ -805,39 +772,39 @@
*
* Excerpt from http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#Node3-textContent
*
- * textContent of type DOMString, introduced in DOM Level 3
- *
- * This attribute returns the text content of this node and its descendants. When it is defined
- * to be null, setting it has no effect.
- *
- * When set, any possible children this node may have are removed and replaced by a single Text node
- * containing the string this attribute is set to.
- *
- * On getting, no serialization is performed, the returned string does not contain any markup.
- * No whitespace normalization is performed, the returned string does not contain the element content
- * whitespaces Fundamental Interfaces.
+ * textContent of type DOMString, introduced in DOM Level 3
+ *
+ * This attribute returns the text content of this node and its descendants. When it is defined
+ * to be null, setting it has no effect.
+ *
+ * When set, any possible children this node may have are removed and replaced by a single Text node
+ * containing the string this attribute is set to.
+ *
+ * On getting, no serialization is performed, the returned string does not contain any markup.
+ * No whitespace normalization is performed, the returned string does not contain the element content
+ * whitespaces Fundamental Interfaces.
*
* Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
*
- * The string returned is made of the text content of this node depending on its type,
- * as defined below:
+ * The string returned is made of the text content of this node depending on its type,
+ * as defined below:
*
- * Node type Content
+ * Node type Content
* ==================== ========================================================================
- * ELEMENT_NODE concatenation of the textContent attribute value of every child node,
- * ENTITY_NODE excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes.
- * ENTITY_REFERENCE_NODE This is the empty string if the node has no children.
- * DOCUMENT_FRAGMENT_NODE
+ * ELEMENT_NODE concatenation of the textContent attribute value of every child node,
+ * ENTITY_NODE excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes.
+ * ENTITY_REFERENCE_NODE This is the empty string if the node has no children.
+ * DOCUMENT_FRAGMENT_NODE
* --------------------------------------------------------------------------------------------------
* ATTRIBUTE_NODE
* TEXT_NODE
* CDATA_SECTION_NODE
- * COMMENT_NODE,
- * PROCESSING_INSTRUCTION_NODE nodeValue
+ * COMMENT_NODE,
+ * PROCESSING_INSTRUCTION_NODE nodeValue
* --------------------------------------------------------------------------------------------------
- * DOCUMENT_NODE,
- * DOCUMENT_TYPE_NODE,
- * NOTATION_NODE null
+ * DOCUMENT_NODE,
+ * DOCUMENT_TYPE_NODE,
+ * NOTATION_NODE null
*
***/
@@ -859,7 +826,7 @@
XMLSize_t nRemainingBuffer = rnBufferLength;
rnBufferLength = 0;
- if (pzBuffer)
+ if (pzBuffer)
*pzBuffer = 0;
DOMNode *thisNode = castToNode(this);
@@ -873,7 +840,7 @@
{
DOMNode* current = thisNode->getFirstChild();
- while (current != NULL)
+ while (current != NULL)
{
if (current->getNodeType() != DOMNode::COMMENT_NODE &&
current->getNodeType() != DOMNode::PROCESSING_INSTRUCTION_NODE)
@@ -886,7 +853,7 @@
rnBufferLength += nContentLength;
nRemainingBuffer -= nContentLength;
}
- else
+ else
{
XMLSize_t nContentLength = 0;
castToNodeImpl(current)->getTextContent(NULL, nContentLength);
@@ -910,14 +877,14 @@
const XMLCh* pzValue = thisNode->getNodeValue();
XMLSize_t nStrLen = XMLString::stringLen(pzValue);
- if (pzBuffer)
+ if (pzBuffer)
{
XMLSize_t nContentLength = (nRemainingBuffer >= nStrLen) ? nStrLen : nRemainingBuffer;
XMLString::copyNString(pzBuffer + rnBufferLength, pzValue, nContentLength);
rnBufferLength += nContentLength;
nRemainingBuffer -= nContentLength;
}
- else
+ else
{
rnBufferLength += nStrLen;
}
@@ -942,7 +909,7 @@
void DOMNodeImpl::setTextContent(const XMLCh* textContent){
DOMNode *thisNode = castToNode(this);
- switch (thisNode->getNodeType())
+ switch (thisNode->getNodeType())
{
case DOMNode::ELEMENT_NODE:
case DOMNode::ENTITY_NODE:
@@ -954,12 +921,12 @@
// Remove all childs
DOMNode* current = thisNode->getFirstChild();
- while (current != NULL)
+ while (current != NULL)
{
thisNode->removeChild(current);
current = thisNode->getFirstChild();
}
- if (textContent != NULL)
+ if (textContent != NULL)
{
// Add textnode containing data
current = ((DOMDocumentImpl*)thisNode->getOwnerDocument())->createTextNode(textContent);
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.cpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,7 +26,6 @@
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLInitializer.hpp>
#include <xercesc/util/XMLMsgLoader.hpp>
-#include <xercesc/util/XMLRegisterCleanup.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
@@ -42,91 +41,25 @@
XERCES_CPP_NAMESPACE_BEGIN
-// ---------------------------------------------------------------------------
-// Local static data
-// ---------------------------------------------------------------------------
-
-static bool sRegistered = false;
-
-static XMLMutex* sNormalizerMutex = 0;
-static XMLRegisterCleanup normalizerMutexCleanup;
-
static XMLMsgLoader* gMsgLoader = 0;
-static XMLRegisterCleanup cleanupMsgLoader;
-
-// ---------------------------------------------------------------------------
-// Local, static functions
-// ---------------------------------------------------------------------------
-
-// Cleanup for the message loader
-void DOMNormalizer::reinitMsgLoader()
+void XMLInitializer::initializeDOMNormalizer()
{
- delete gMsgLoader;
- gMsgLoader = 0;
-}
-
-// Cleanup for the normalizer mutex
-void DOMNormalizer::reinitNormalizerMutex()
-{
- delete sNormalizerMutex;
- sNormalizerMutex = 0;
- sRegistered = false;
-}
-
-//
-// We need to fault in this mutex. But, since its used for synchronization
-// itself, we have to do this the low level way using a compare and swap.
-//
-static XMLMutex& gNormalizerMutex()
-{
- if (!sNormalizerMutex)
- {
- XMLMutexLock lock(XMLPlatformUtils::fgAtomicMutex);
-
- // If we got here first, then register it and set the registered flag
- if (!sRegistered)
- {
- sNormalizerMutex = new XMLMutex(XMLPlatformUtils::fgMemoryManager);
- normalizerMutexCleanup.registerCleanup(DOMNormalizer::reinitNormalizerMutex);
- sRegistered = true;
- }
- }
- return *sNormalizerMutex;
-}
+ gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain);
-static XMLMsgLoader& gNormalizerMsgLoader()
-{
if (!gMsgLoader)
- {
- XMLMutexLock lockInit(&gNormalizerMutex());
-
- // If we haven't loaded our message yet, then do that
- if (!gMsgLoader)
- {
- gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain);
- if (!gMsgLoader)
- XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
-
- // Register this object to be cleaned up at termination
- cleanupMsgLoader.registerCleanup(DOMNormalizer::reinitMsgLoader);
- }
- }
-
- return *gMsgLoader;
+ XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
}
-void XMLInitializer::initializeDOMNormalizerMsgLoader()
+void XMLInitializer::terminateDOMNormalizer()
{
- gMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgXMLErrDomain);
-
- // Register this object to be cleaned up at termination
- if (gMsgLoader) {
- cleanupMsgLoader.registerCleanup(DOMNormalizer::reinitMsgLoader);
- }
+ delete gMsgLoader;
+ gMsgLoader = 0;
}
-DOMNormalizer::DOMNormalizer(MemoryManager* const manager)
+//
+//
+DOMNormalizer::DOMNormalizer(MemoryManager* const manager)
: fDocument(0)
, fConfiguration(0)
, fErrorHandler(0)
@@ -142,13 +75,13 @@
}
void DOMNormalizer::normalizeDocument(DOMDocumentImpl *doc) {
-
+
fDocument = doc;
fConfiguration = (DOMConfigurationImpl*)doc->getDOMConfig();
DOMConfigurationImpl *dci = (DOMConfigurationImpl*)fDocument->getDOMConfig();
if(dci)
- fErrorHandler = dci->getErrorHandler();
- else
+ fErrorHandler = dci->getErrorHandler();
+ else
fErrorHandler = 0;
DOMNode *child = 0;
@@ -174,7 +107,7 @@
namespaceFixUp((DOMElementImpl*)node);
}
else {
- //this is done in namespace fixup so no need to do it if namespace is on
+ //this is done in namespace fixup so no need to do it if namespace is on
if(attrMap) {
for(unsigned int i = 0; i < attrMap->getLength(); i++) {
attrMap->item(i)->normalize();
@@ -194,7 +127,7 @@
fNSScope->removeScope();
break;
}
- case DOMNode::COMMENT_NODE: {
+ case DOMNode::COMMENT_NODE: {
if (!(fConfiguration->featureValues & DOMConfigurationImpl::FEATURE_COMMENTS)) {
DOMNode *prevSibling = node->getPreviousSibling();
DOMNode *parent = node->getParentNode();
@@ -222,20 +155,20 @@
text->insertData(0, prevSibling->getNodeValue());
parent->removeChild(prevSibling);
}
- return text; // Don't advance;
+ return text; // Don't advance;
}
break;
}
case DOMNode::TEXT_NODE: {
DOMNode *next = node->getNextSibling();
-
+
if(next != 0 && next->getNodeType() == DOMNode::TEXT_NODE) {
((DOMText*)node)->appendData(next->getNodeValue());
node->getParentNode()->removeChild(next);
return node;
} else {
const XMLCh* nv = node->getNodeValue();
- if (nv == 0 || *nv == 0) {
+ if (nv == 0 || *nv == 0) {
node->getParentNode()->removeChild(node);
}
}
@@ -259,14 +192,14 @@
const XMLCh *uri = at->getNamespaceURI();
const XMLCh *value = at->getNodeValue();
-
+
if(XMLString::equals(XMLUni::fgXMLNSURIName, uri)) {
if(XMLString::equals(XMLUni::fgXMLNSURIName, value)) {
error(XMLErrs::NSDeclInvalid, ele);
}
else {
const XMLCh *prefix = at->getPrefix();
-
+
if(XMLString::equals(prefix, XMLUni::fgXMLNSString)) {
fNSScope->addOrChangeBinding(at->getLocalName(), value, fMemoryManager);
}
@@ -304,17 +237,17 @@
// hp aCC complains this i is a redefinition of the i on line 283
for(unsigned int j = 0; j < len; j++) {
DOMAttr *at = (DOMAttr*)attrMap->item(j);
- const XMLCh *uri = at->getNamespaceURI();
+ const XMLCh *uri = at->getNamespaceURI();
const XMLCh* prefix = at->getPrefix();
if(!XMLString::equals(XMLUni::fgXMLNSURIName, uri)) {
if(uri != 0) {
if(prefix == 0 || !fNSScope->isValidBinding(prefix, uri)) {
-
+
const XMLCh* newPrefix = fNSScope->getPrefix(uri);
if(newPrefix != 0) {
- at->setPrefix(newPrefix);
+ at->setPrefix(newPrefix);
}
else {
if(prefix != 0 && !fNSScope->getUri(prefix)) {
@@ -378,7 +311,7 @@
buf.set(XMLUni::fgXMLNSString);
buf.append(chColon);
buf.append(prefix);
- element->setAttributeNS(XMLUni::fgXMLNSURIName, buf.getRawBuffer(), uri);
+ element->setAttributeNS(XMLUni::fgXMLNSURIName, buf.getRawBuffer(), uri);
}
}
@@ -396,7 +329,7 @@
preBuf.append(integerToXMLCh(fNewNamespaceCount));
((DOMNormalizer *)this)->fNewNamespaceCount++;
}
-
+
XMLBuffer buf(1023, fMemoryManager);
buf.set(XMLUni::fgXMLNSString);
buf.append(chColon);
@@ -426,7 +359,7 @@
if(!s)
addScope(manager);
-
+
Scope *curScope = fScopes->elementAt(s - 1);
curScope->addOrChangeBinding(prefix, uri, manager);
@@ -476,17 +409,17 @@
if(!fUriHash) {
fPrefixHash = new (manager) RefHashTableOf<XMLCh>(10, (bool) false, manager);
fUriHash = new (manager) RefHashTableOf<XMLCh>(10, (bool) false, manager);
-
+
if(fBaseScopeWithBindings) {
RefHashTableOfEnumerator<XMLCh> preEnumer(fBaseScopeWithBindings->fPrefixHash, false, manager);
while(preEnumer.hasMoreElements()) {
const XMLCh* prefix = (XMLCh*) preEnumer.nextElementKey();
const XMLCh* uri = fBaseScopeWithBindings->fPrefixHash->get((void*)prefix);
-
+
//have to cast here because otherwise we have delete problems under windows :(
fPrefixHash->put((void *)prefix, (XMLCh*)uri);
}
-
+
RefHashTableOfEnumerator<XMLCh> uriEnumer(fBaseScopeWithBindings->fUriHash, false, manager);
while(uriEnumer.hasMoreElements()) {
const XMLCh* uri = (XMLCh*) uriEnumer.nextElementKey();
@@ -516,7 +449,7 @@
else if(fBaseScopeWithBindings) {
uri = fBaseScopeWithBindings->getUri(prefix);
}
-
+
return uri ? uri : 0;
}
@@ -541,7 +474,7 @@
const XMLSize_t maxChars = 2047;
XMLCh errText[maxChars + 1];
- if (!gNormalizerMsgLoader().loadMsg(code, errText, maxChars))
+ if (!gMsgLoader->loadMsg(code, errText, maxChars))
{
// <TBD> Should probably load a default message here
}
Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.hpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMNormalizer.hpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,7 +49,7 @@
class DOMNormalizer : public XMemory {
- //the following are the data structures maintain the stack of namespace information
+ //the following are the data structures maintain the stack of namespace information
class InScopeNamespaces : public XMemory {
class Scope : public XMemory {
public:
@@ -69,7 +69,7 @@
Scope& operator= (const Scope& other);
};
- public:
+ public:
InScopeNamespaces(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
~InScopeNamespaces();
void addOrChangeBinding(const XMLCh *prefix, const XMLCh *uri,
@@ -99,12 +99,6 @@
*/
void normalizeDocument(DOMDocumentImpl *doc);
- // -----------------------------------------------------------------------
- // Notification that lazy data has been deleted
- // -----------------------------------------------------------------------
- static void reinitNormalizerMutex();
- static void reinitMsgLoader();
-
private:
// unimplemented
DOMNormalizer ( const DOMNormalizer& toCopy);
@@ -122,7 +116,7 @@
void namespaceFixUp(DOMElementImpl *ele) const;
/**
- * Converts an integer to an XMLCh - max 15 digits long.
+ * Converts an integer to an XMLCh - max 15 digits long.
*/
const XMLCh * integerToXMLCh(unsigned int i) const;
@@ -132,16 +126,16 @@
* In case prefix is empty will add/update default namespace declaration.
*/
void addOrChangeNamespaceDecl(const XMLCh* prefix, const XMLCh* uri, DOMElementImpl *element) const;
-
+
/**
- * Adds a custom namespace in the form "NSx" where x is an integer that
+ * Adds a custom namespace in the form "NSx" where x is an integer that
* has not yet used in the document
*/
const XMLCh* addCustomNamespaceDecl(const XMLCh* uri, DOMElementImpl *element) const;
/**
- * Report an error
+ * Report an error
*/
void error(const XMLErrs::Codes code, const DOMNode *node) const;
Modified: xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLFormatter.hpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -167,7 +167,7 @@
//@{
/**
* @param outEncoding the encoding for the formatted content
- * @param docVersion
+ * @param docVersion
* @param target the formatTarget where the formatted content is written to
* @param escapeFlags the escape style for certain character
* @param unrepFlags the reaction to unrepresentable character
@@ -211,7 +211,7 @@
, const UnRepFlags unrepFlags = UnRep_Fail
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
-
+
~XMLFormatter();
//@}
@@ -266,10 +266,15 @@
const XMLCh* getEncodingName() const;
/**
- * @return return the transcoder used internally for transcoding the formatter conent
+ * @return return constant transcoder used internally for transcoding the formatter conent
*/
inline const XMLTranscoder* getTranscoder() const;
+ /**
+ * @return return the transcoder used internally for transcoding the formatter conent
+ */
+ inline XMLTranscoder* getTranscoder();
+
//@}
// -----------------------------------------------------------------------
@@ -349,19 +354,19 @@
// -----------------------------------------------------------------------
// Private helper methods
// -----------------------------------------------------------------------
- const XMLByte* getCharRef(XMLSize_t &count,
- XMLByte* &ref,
- const XMLCh * stdRef);
-
+ const XMLByte* getCharRef(XMLSize_t &count,
+ XMLByte* &ref,
+ const XMLCh * stdRef);
+
void writeCharRef(const XMLCh &toWrite);
void writeCharRef(unsigned long toWrite);
bool inEscapeList(const XMLFormatter::EscapeFlags escStyle
, const XMLCh toCheck);
-
- XMLSize_t handleUnEscapedChars(const XMLCh * srcPtr,
- const XMLSize_t count,
+
+ XMLSize_t handleUnEscapedChars(const XMLCh * srcPtr,
+ const XMLSize_t count,
const UnRepFlags unrepFlags);
void specialFormat
@@ -480,6 +485,11 @@
}
inline const XMLTranscoder* XMLFormatter::getTranscoder() const
+{
+ return fXCoder;
+}
+
+inline XMLTranscoder* XMLFormatter::getTranscoder()
{
return fXCoder;
}
Modified: xerces/c/trunk/src/xercesc/framework/XMLValidator.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLValidator.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLValidator.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLValidator.cpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,76 +23,27 @@
// Includes
// ---------------------------------------------------------------------------
#include <xercesc/framework/XMLValidator.hpp>
-#include <xercesc/util/Mutexes.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLInitializer.hpp>
#include <xercesc/util/XMLMsgLoader.hpp>
-#include <xercesc/util/XMLRegisterCleanup.hpp>
#include <xercesc/internal/XMLScanner.hpp>
XERCES_CPP_NAMESPACE_BEGIN
-// ---------------------------------------------------------------------------
-// Local static functions
-// ---------------------------------------------------------------------------
-
-static XMLMutex* sMsgMutex = 0;
-static XMLRegisterCleanup msgLoaderCleanup;
-
static XMLMsgLoader* sMsgLoader = 0;
-static XMLRegisterCleanup validatorMutexCleanup;
-//
-// We need to fault in this mutex. But, since its used for synchronization
-// itself, we have to do this the low level way using a compare and swap.
-//
-static XMLMutex& gValidatorMutex()
+void XMLInitializer::initializeXMLValidator()
{
- if (!sMsgMutex)
- {
- XMLMutexLock lockInit(XMLPlatformUtils::fgAtomicMutex);
-
- if (!sMsgMutex)
- {
- sMsgMutex = new (XMLPlatformUtils::fgMemoryManager) XMLMutex(XMLPlatformUtils::fgMemoryManager);
- validatorMutexCleanup.registerCleanup(XMLValidator::reinitMsgMutex);
- }
- }
-
- return *sMsgMutex;
-}
+ sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain);
-static XMLMsgLoader& getMsgLoader()
-{
if (!sMsgLoader)
- {
- // Lock the mutex
- XMLMutexLock lockInit(&gValidatorMutex());
-
- if (!sMsgLoader)
- {
- sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain);
- if (!sMsgLoader)
- XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
-
- //
- // Register this XMLMsgLoader for cleanup at Termination.
- //
- msgLoaderCleanup.registerCleanup(XMLValidator::reinitMsgLoader);
- }
- }
-
- return *sMsgLoader;
+ XMLPlatformUtils::panic(PanicHandler::Panic_CantLoadMsgDomain);
}
-void XMLInitializer::initializeValidatorMsgLoader()
+void XMLInitializer::terminateXMLValidator()
{
- sMsgLoader = XMLPlatformUtils::loadMsgSet(XMLUni::fgValidityDomain);
-
- // Register this XMLMsgLoader for cleanup at Termination.
- if (sMsgLoader) {
- msgLoaderCleanup.registerCleanup(XMLValidator::reinitMsgLoader);
- }
+ delete sMsgLoader;
+ sMsgLoader = 0;
}
// ---------------------------------------------------------------------------
@@ -118,9 +69,9 @@
XMLCh errText[msgSize + 1];
// load the text
- if (!getMsgLoader().loadMsg(toEmit, errText, msgSize))
- {
- // <TBD> Probably should load a default msg here
+ if (!sMsgLoader->loadMsg(toEmit, errText, msgSize))
+ {
+ // <TBD> Probably should load a default msg here
}
//
@@ -176,9 +127,9 @@
XMLCh errText[maxChars + 1];
// load the text
- if (!getMsgLoader().loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager()))
- {
- // <TBD> Should probably load a default message here
+ if (!sMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager()))
+ {
+ // <TBD> Should probably load a default message here
}
//
@@ -234,9 +185,9 @@
XMLCh errText[maxChars + 1];
// load the text
- if (!getMsgLoader().loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager()))
- {
- // <TBD> Should probably load a default message here
+ if (!sMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager()))
+ {
+ // <TBD> Should probably load a default message here
}
//
@@ -293,9 +244,9 @@
XMLCh errText[maxChars + 1];
// load the text
- if (!getMsgLoader().loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager()))
- {
- // <TBD> Should probably load a default message here
+ if (!sMsgLoader->loadMsg(toEmit, errText, maxChars, text1, text2, text3, text4, fScanner->getMemoryManager()))
+ {
+ // <TBD> Should probably load a default message here
}
//
@@ -340,24 +291,6 @@
, fReaderMgr(0)
, fScanner(0)
{
-}
-
-// -----------------------------------------------------------------------
-// Notification that lazy data has been deleted
-// -----------------------------------------------------------------------
-void XMLValidator::reinitMsgMutex()
-{
- delete sMsgMutex;
- sMsgMutex = 0;
-}
-
-// -----------------------------------------------------------------------
-// Reinitialise the message loader
-// -----------------------------------------------------------------------
-void XMLValidator::reinitMsgLoader()
-{
- delete sMsgLoader;
- sMsgLoader = 0;
}
XERCES_CPP_NAMESPACE_END
Modified: xerces/c/trunk/src/xercesc/framework/XMLValidator.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/XMLValidator.hpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/XMLValidator.hpp (original)
+++ xerces/c/trunk/src/xercesc/framework/XMLValidator.hpp Mon Mar 10 07:10:09 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -304,7 +304,7 @@
, const char* const text2 = 0
, const char* const text3 = 0
, const char* const text4 = 0
- );
+ );
void emitError
(
const XMLValid::Codes toEmit
@@ -313,17 +313,10 @@
, const XMLCh* const text2 = 0
, const XMLCh* const text3 = 0
, const XMLCh* const text4 = 0
-
+
);
//@}
-
- // -----------------------------------------------------------------------
- // Notification that lazy data has been deleted
- // -----------------------------------------------------------------------
- static void reinitMsgMutex();
-
- static void reinitMsgLoader();
protected :
// -----------------------------------------------------------------------
Modified: xerces/c/trunk/src/xercesc/framework/psvi/XSModel.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/framework/psvi/XSModel.cpp?rev=635560&r1=635559&r2=635560&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/framework/psvi/XSModel.cpp (original)
+++ xerces/c/trunk/src/xercesc/framework/psvi/XSModel.cpp Mon Mar 10 07:10:09 2008
@@ -137,7 +137,6 @@
);
DatatypeValidatorFactory dvFactory(manager);
- dvFactory.expandRegistryToFullSchemaSet();
addS4SToXSModel
(
namespaceItem
@@ -286,7 +285,6 @@
if (!fAddedS4SGrammar)
{
DatatypeValidatorFactory dvFactory(manager);
- dvFactory.expandRegistryToFullSchemaSet();
XSNamespaceItem* namespaceItem = new (manager) XSNamespaceItem
(
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org