You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dm...@apache.org on 2004/11/08 19:12:53 UTC
cvs commit: xml-xalan/c/src/xalanc/XalanEXSLT XalanEXSLTCommon.cpp XalanEXSLTCommon.hpp XalanEXSLTCommonImpl.hpp XalanEXSLTDateTime.cpp XalanEXSLTDateTime.hpp XalanEXSLTDateTimeImpl.hpp XalanEXSLTDynamic.cpp XalanEXSLTDynamic.hpp XalanEXSLTDynamicImpl.hpp XalanEXSLTMath.cpp XalanEXSLTMath.hpp XalanEXSLTMathImpl.hpp XalanEXSLTSet.cpp XalanEXSLTSet.hpp XalanEXSLTSetImpl.hpp XalanEXSLTString.cpp XalanEXSLTString.hpp XalanEXSLTStringImpl.hpp
dmitryh 2004/11/08 10:12:53
Modified: c/src/xalanc/XalanEXSLT XalanEXSLTCommon.cpp
XalanEXSLTCommon.hpp XalanEXSLTCommonImpl.hpp
XalanEXSLTDateTime.cpp XalanEXSLTDateTime.hpp
XalanEXSLTDateTimeImpl.hpp XalanEXSLTDynamic.cpp
XalanEXSLTDynamic.hpp XalanEXSLTDynamicImpl.hpp
XalanEXSLTMath.cpp XalanEXSLTMath.hpp
XalanEXSLTMathImpl.hpp XalanEXSLTSet.cpp
XalanEXSLTSet.hpp XalanEXSLTSetImpl.hpp
XalanEXSLTString.cpp XalanEXSLTString.hpp
XalanEXSLTStringImpl.hpp
Log:
Initial implementation on the pluggable memory management
Revision Changes Path
1.7 +14 -9 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTCommon.cpp
Index: XalanEXSLTCommon.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTCommon.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XalanEXSLTCommon.cpp 26 Feb 2004 23:01:37 -0000 1.6
+++ XalanEXSLTCommon.cpp 8 Nov 2004 18:12:53 -0000 1.7
@@ -147,7 +147,9 @@
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XalanDOMString theResult(executionContext.getMemoryManager());
+
+ executionContext.error(getError(theResult), context, locator);
}
assert(args[0].null() == false);
@@ -187,10 +189,12 @@
-const XalanDOMString
-XalanEXSLTFunctionObjectType::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionObjectType::getError(XalanDOMString& theResult) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_objectTypeFunctionName);
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theResult, s_objectTypeFunctionName);
+
+ return theResult;
}
@@ -245,7 +249,8 @@
// Note this is a special constructor of XalanEXSLTFunctionObjectType which
// allocates no memory. It is only used here, so we can have table-based
// initialization, but not have any memory allocation.
-static const XalanEXSLTFunctionObjectType s_objectTypeFunction(1);
+
+static const XalanEXSLTFunctionObjectType s_objectTypeFunction(XalanMemMgrs::getDummyMemMgr(), 1);
@@ -267,9 +272,9 @@
void
-XalanEXSLTCommonFunctionsInstaller::installGlobal()
+XalanEXSLTCommonFunctionsInstaller::installGlobal(MemoryManagerType& theManager)
{
- doInstallGlobal(s_commonNamespace, theFunctionTable);
+ doInstallGlobal( theManager, s_commonNamespace, theFunctionTable);
}
@@ -283,9 +288,9 @@
void
-XalanEXSLTCommonFunctionsInstaller::uninstallGlobal()
+XalanEXSLTCommonFunctionsInstaller::uninstallGlobal(MemoryManagerType& theManager)
{
- doUninstallGlobal(s_commonNamespace, theFunctionTable);
+ doUninstallGlobal(theManager, s_commonNamespace, theFunctionTable);
}
1.5 +3 -2 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTCommon.hpp
Index: XalanEXSLTCommon.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTCommon.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTCommon.hpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTCommon.hpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -38,13 +38,14 @@
installLocal(XPathEnvSupportDefault& theSupport);
static void
- installGlobal();
+ installGlobal(MemoryManagerType& theManager);
static void
uninstallLocal(XPathEnvSupportDefault& theSupport);
static void
- uninstallGlobal();
+ uninstallGlobal(MemoryManagerType& theManager);
+private:
};
1.6 +43 -26 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTCommonImpl.hpp
Index: XalanEXSLTCommonImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTCommonImpl.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XalanEXSLTCommonImpl.hpp 26 Feb 2004 23:01:37 -0000 1.5
+++ XalanEXSLTCommonImpl.hpp 8 Nov 2004 18:12:53 -0000 1.6
@@ -57,23 +57,28 @@
#else
virtual XalanEXSLTFunctionNodeSet*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionNodeSet(*this);
+ return cloneFunction_0<XalanEXSLTFunctionNodeSet>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,"node-set()");
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,theBuffer , "node-set()");
+
+ return theBuffer;
}
- virtual const XalanDOMString
- getInvalidArgumentTypeError() const
+
+ virtual const XalanDOMString&
+ getInvalidArgumentTypeError(XalanDOMString& theResult) const
{
- return XalanMessageLoader::getMessage(XalanMessages::InvalidArgumentType_1Param,"node-set()");;
+ XalanMessageLoader::getMessage(XalanMessages::InvalidArgumentType_1Param,theResult,"node-set()");
+
+ return theResult;
}
private:
@@ -94,26 +99,26 @@
typedef Function ParentType;
- XalanEXSLTFunctionObjectType() :
+ XalanEXSLTFunctionObjectType(MemoryManagerType& theManager) :
Function(),
- m_boolean(s_booleanString),
- m_external(s_externalString),
- m_nodeSet(s_nodeSetString),
- m_number(s_numberString),
- m_rtf(s_rtfString),
- m_string(s_stringString)
+ m_boolean(s_booleanString, theManager),
+ m_external(s_externalString, theManager),
+ m_nodeSet(s_nodeSetString, theManager),
+ m_number(s_numberString, theManager),
+ m_rtf(s_rtfString, theManager),
+ m_string(s_stringString, theManager)
{
}
// A dummy constructor for use internally. Do not use this one!!!!
- XalanEXSLTFunctionObjectType(int /* theDummy */) :
+ XalanEXSLTFunctionObjectType(MemoryManagerType& theManager, int /* theDummy */) :
Function(),
- m_boolean(),
- m_external(),
- m_nodeSet(),
- m_number(),
- m_rtf(),
- m_string()
+ m_boolean(theManager),
+ m_external(theManager),
+ m_nodeSet(theManager),
+ m_number(theManager),
+ m_rtf(theManager),
+ m_string(theManager)
{
}
@@ -140,15 +145,27 @@
#else
virtual XalanEXSLTFunctionObjectType*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionObjectType;
+ typedef XalanEXSLTFunctionObjectType Type;
+
+ XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type)));
+
+ Type* theResult = theGuard.get();
+
+ new (theResult) Type(theManager);
+
+ theGuard.release();
+
+ return theResult;
}
protected:
- const XalanDOMString
- getError() const;
+
+
+ const XalanDOMString&
+ getError(XalanDOMString& theResult) const;
private:
1.10 +12 -9 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDateTime.cpp
Index: XalanEXSLTDateTime.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDateTime.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XalanEXSLTDateTime.cpp 7 Aug 2004 19:04:24 -0000 1.9
+++ XalanEXSLTDateTime.cpp 8 Nov 2004 18:12:53 -0000 1.10
@@ -165,7 +165,9 @@
{
if (args.size() != 0)
{
- executionContext.error(getError(), context, locator);
+ XalanDOMString theResult(executionContext.getMemoryManager());
+
+ executionContext.error(getError(theResult), context, locator);
}
XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
@@ -246,10 +248,12 @@
-const XalanDOMString
-XalanEXSLTFunctionDateTime::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionDateTime::getError(XalanDOMString& theResult) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, s_dateTimeFunctionName);
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theResult, s_dateTimeFunctionName);
+
+ return theResult;
}
@@ -263,10 +267,9 @@
void
-XalanEXSLTDateTimeFunctionsInstaller::installGlobal()
+XalanEXSLTDateTimeFunctionsInstaller::installGlobal(MemoryManagerType& theManager)
{
- doInstallGlobal(s_dateTimeNamespace, theFunctionTable);
-
+ doInstallGlobal(theManager, s_dateTimeNamespace, theFunctionTable);
}
@@ -280,9 +283,9 @@
void
-XalanEXSLTDateTimeFunctionsInstaller::uninstallGlobal()
+XalanEXSLTDateTimeFunctionsInstaller::uninstallGlobal(MemoryManagerType& theManager)
{
- doUninstallGlobal(s_dateTimeNamespace, theFunctionTable);
+ doUninstallGlobal(theManager, s_dateTimeNamespace, theFunctionTable);
}
1.4 +4 -2 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDateTime.hpp
Index: XalanEXSLTDateTime.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDateTime.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XalanEXSLTDateTime.hpp 26 Feb 2004 23:01:37 -0000 1.3
+++ XalanEXSLTDateTime.hpp 8 Nov 2004 18:12:53 -0000 1.4
@@ -37,13 +37,15 @@
installLocal(XPathEnvSupportDefault& theSupport);
static void
- installGlobal();
+ installGlobal(MemoryManagerType& theManager);
static void
uninstallLocal(XPathEnvSupportDefault& theSupport);
static void
- uninstallGlobal();
+ uninstallGlobal(MemoryManagerType& theManager);
+
+private:
};
1.4 +6 -4 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDateTimeImpl.hpp
Index: XalanEXSLTDateTimeImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDateTimeImpl.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XalanEXSLTDateTimeImpl.hpp 26 Feb 2004 23:01:37 -0000 1.3
+++ XalanEXSLTDateTimeImpl.hpp 8 Nov 2004 18:12:53 -0000 1.4
@@ -63,15 +63,17 @@
#else
virtual XalanEXSLTFunctionDateTime*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionDateTime(*this);
+ return cloneFunction_0<XalanEXSLTFunctionDateTime>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const;
+
+
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theResult) const;
private:
1.5 +6 -4 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDynamic.cpp
Index: XalanEXSLTDynamic.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDynamic.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTDynamic.cpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTDynamic.cpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -120,9 +120,10 @@
void
-XalanEXSLTDynamicFunctionsInstaller::installGlobal()
+XalanEXSLTDynamicFunctionsInstaller::installGlobal(MemoryManagerType& theManager)
{
- doInstallGlobal(s_dynamicNamespace, theFunctionTable);
+ doInstallGlobal(theManager, s_dynamicNamespace, theFunctionTable);
+
}
@@ -136,9 +137,10 @@
void
-XalanEXSLTDynamicFunctionsInstaller::uninstallGlobal()
+XalanEXSLTDynamicFunctionsInstaller::uninstallGlobal(MemoryManagerType& theManager)
{
- doUninstallGlobal(s_dynamicNamespace, theFunctionTable);
+ doUninstallGlobal(theManager, s_dynamicNamespace, theFunctionTable);
+
}
1.5 +5 -2 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDynamic.hpp
Index: XalanEXSLTDynamic.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDynamic.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTDynamic.hpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTDynamic.hpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -38,13 +38,16 @@
installLocal(XPathEnvSupportDefault& theSupport);
static void
- installGlobal();
+ installGlobal(MemoryManagerType& theManager);
static void
uninstallLocal(XPathEnvSupportDefault& theSupport);
static void
- uninstallGlobal();
+ uninstallGlobal(MemoryManagerType& theManager);
+
+private:
+
};
1.8 +7 -5 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDynamicImpl.hpp
Index: XalanEXSLTDynamicImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTDynamicImpl.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- XalanEXSLTDynamicImpl.hpp 26 Feb 2004 23:01:37 -0000 1.7
+++ XalanEXSLTDynamicImpl.hpp 8 Nov 2004 18:12:53 -0000 1.8
@@ -70,17 +70,19 @@
#else
virtual XalanEXSLTFunctionEvaluate*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionEvaluate(*this);
+ return cloneFunction_0<XalanEXSLTFunctionEvaluate>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theResult) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,"evaluate()");
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theResult , "evaluate()");
+
+ return theResult;
}
private:
1.9 +134 -80 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp
Index: XalanEXSLTMath.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XalanEXSLTMath.cpp 26 Feb 2004 23:01:37 -0000 1.8
+++ XalanEXSLTMath.cpp 8 Nov 2004 18:12:53 -0000 1.9
@@ -65,7 +65,7 @@
DOMServices::getNodeData(*theCurrentNode, theStringValue);
- double theNumericValue = DOMStringToDouble(theStringValue);
+ double theNumericValue = DOMStringToDouble(theStringValue, executionContext.getMemoryManager());
if (DoubleSupport::isNaN(theNumericValue) == false)
{
@@ -80,7 +80,7 @@
DOMServices::getNodeData(*theCurrentNode, theStringValue);
- const double theCurrent = DOMStringToDouble(theStringValue);
+ const double theCurrent = DOMStringToDouble(theStringValue, executionContext.getMemoryManager());
if (DoubleSupport::isNaN(theCurrent) == true)
{
@@ -130,7 +130,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -140,11 +143,11 @@
-const XalanDOMString
-XalanEXSLTFunctionHighest::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionHighest::getError(XalanDOMString &theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_highestFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_highestFunctionName);
}
@@ -169,20 +172,23 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
- return findNodes(executionContext, args[0]->nodeset(), DoubleSupport::lessThan);
+ return findNodes(executionContext, args[0]->nodeset(), DoubleSupport::lessThan);
}
-const XalanDOMString
-XalanEXSLTFunctionLowest::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionLowest::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_lowestFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_lowestFunctionName);
}
@@ -210,7 +216,7 @@
DOMServices::getNodeData(*theNodeSet.item(0), theStringValue);
- double theResult = DOMStringToDouble(theStringValue);
+ double theResult = DOMStringToDouble(theStringValue, executionContext.getMemoryManager());
for (NodeRefListBase::size_type i = 1; i < theLength; ++i)
{
@@ -220,7 +226,7 @@
DOMServices::getNodeData(*theNodeSet.item(i), theStringValue);
- const double theCurrent = DOMStringToDouble(theStringValue);
+ const double theCurrent = DOMStringToDouble(theStringValue, executionContext.getMemoryManager());
if (DoubleSupport::isNaN(theCurrent) == true)
{
@@ -257,7 +263,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -267,10 +276,10 @@
-const XalanDOMString
-XalanEXSLTFunctionMin::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionMin::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_minFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_minFunctionName);
}
@@ -294,7 +303,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -304,10 +316,10 @@
-const XalanDOMString
-XalanEXSLTFunctionMax::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionMax::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_maxFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_maxFunctionName);
}
@@ -331,7 +343,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -340,15 +355,15 @@
using std::fabs;
#endif
- return executionContext.getXObjectFactory().createNumber(fabs(args[0]->num()));
+ return executionContext.getXObjectFactory().createNumber(fabs(args[0]->num()));
}
-const XalanDOMString
-XalanEXSLTFunctionAbs::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionAbs::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_absFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_absFunctionName);
}
@@ -375,7 +390,10 @@
{
if (args.empty() == false)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
#if defined(XALAN_STRICT_ANSI_HEADERS)
@@ -397,10 +415,10 @@
-const XalanDOMString
-XalanEXSLTFunctionRandom::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionRandom::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsNoArgument_1Param,s_randomFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsNoArgument_1Param, theBuffer, s_randomFunctionName);
}
@@ -425,7 +443,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -434,15 +455,15 @@
using std::acos;
#endif
- return executionContext.getXObjectFactory().createNumber(acos(args[0]->num()));
+ return executionContext.getXObjectFactory().createNumber(acos(args[0]->num()));
}
-const XalanDOMString
-XalanEXSLTFunctionAcos::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionAcos::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_acosFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_acosFunctionName);
}
@@ -468,7 +489,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -482,10 +506,10 @@
-const XalanDOMString
-XalanEXSLTFunctionAsin::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionAsin::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_asinFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_asinFunctionName);
}
@@ -510,7 +534,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -524,10 +551,10 @@
-const XalanDOMString
-XalanEXSLTFunctionAtan::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionAtan::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_atanFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_atanFunctionName);
}
@@ -553,7 +580,10 @@
{
if (args.size() != 2)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false && args[1].null() == false);
@@ -567,10 +597,10 @@
-const XalanDOMString
-XalanEXSLTFunctionAtan2::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionAtan2::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,s_atan2FunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param, theBuffer, s_atan2FunctionName);
}
@@ -957,7 +987,10 @@
{
if (args.size() != 2)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false && args[1].null() == false);
@@ -1052,7 +1085,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -1066,10 +1102,10 @@
-const XalanDOMString
-XalanEXSLTFunctionCos::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionCos::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_cosFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_cosFunctionName);
}
@@ -1093,7 +1129,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -1107,10 +1146,10 @@
-const XalanDOMString
-XalanEXSLTFunctionExp::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionExp::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_expFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_expFunctionName);
}
@@ -1134,7 +1173,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -1148,10 +1190,10 @@
-const XalanDOMString
-XalanEXSLTFunctionLog::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionLog::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_logFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_logFunctionName);
}
@@ -1177,7 +1219,10 @@
{
if (args.size() != 2)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false && args[1].null() == false);
@@ -1191,10 +1236,10 @@
-const XalanDOMString
-XalanEXSLTFunctionPower::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionPower::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,s_powerFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param, theBuffer, s_powerFunctionName);
}
@@ -1218,7 +1263,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -1232,10 +1280,10 @@
-const XalanDOMString
-XalanEXSLTFunctionSin::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionSin::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_sinFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_sinFunctionName);
}
@@ -1261,7 +1309,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -1275,10 +1326,10 @@
-const XalanDOMString
-XalanEXSLTFunctionSqrt::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionSqrt::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_sqrtFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_sqrtFunctionName);
}
@@ -1302,7 +1353,10 @@
{
if (args.size() != 1)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -1316,10 +1370,10 @@
-const XalanDOMString
-XalanEXSLTFunctionTan::getError() const
+const XalanDOMString&
+XalanEXSLTFunctionTan::getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,s_tanFunctionName);
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer, s_tanFunctionName);
}
@@ -1422,9 +1476,9 @@
void
-XalanEXSLTMathFunctionsInstaller::installGlobal()
+XalanEXSLTMathFunctionsInstaller::installGlobal(MemoryManagerType& theManager)
{
- doInstallGlobal(s_mathNamespace, theFunctionTable);
+ doInstallGlobal(theManager, s_mathNamespace, theFunctionTable);
// Sets the starting point for generating a series of pseudorandom integers,
// we need it for random() EXSLT function
@@ -1446,9 +1500,9 @@
void
-XalanEXSLTMathFunctionsInstaller::uninstallGlobal()
+XalanEXSLTMathFunctionsInstaller::uninstallGlobal(MemoryManagerType& theManager)
{
- doUninstallGlobal(s_mathNamespace, theFunctionTable);
+ doUninstallGlobal(theManager, s_mathNamespace, theFunctionTable);
}
1.5 +4 -2 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMath.hpp
Index: XalanEXSLTMath.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMath.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTMath.hpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTMath.hpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -38,13 +38,15 @@
installLocal(XPathEnvSupportDefault& theSupport);
static void
- installGlobal();
+ installGlobal(MemoryManagerType& theManager);
static void
uninstallLocal(XPathEnvSupportDefault& theSupport);
static void
- uninstallGlobal();
+ uninstallGlobal(MemoryManagerType& theManager);
+
+private:
};
1.6 +73 -74 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMathImpl.hpp
Index: XalanEXSLTMathImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMathImpl.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XalanEXSLTMathImpl.hpp 26 Feb 2004 23:01:37 -0000 1.5
+++ XalanEXSLTMathImpl.hpp 8 Nov 2004 18:12:53 -0000 1.6
@@ -67,15 +67,15 @@
#else
virtual XalanEXSLTFunctionAbs*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionAbs(*this);
+ return cloneFunction_0<XalanEXSLTFunctionAbs>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -122,15 +122,15 @@
#else
virtual XalanEXSLTFunctionRandom*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionRandom(*this);
+ return cloneFunction_0<XalanEXSLTFunctionRandom>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -177,15 +177,15 @@
#else
virtual XalanEXSLTFunctionAcos*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionAcos(*this);
+ return cloneFunction_0<XalanEXSLTFunctionAcos>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -232,15 +232,15 @@
#else
virtual XalanEXSLTFunctionAsin*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionAsin(*this);
+ return cloneFunction_0<XalanEXSLTFunctionAsin>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -287,15 +287,15 @@
#else
virtual XalanEXSLTFunctionAtan*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionAtan(*this);
+ return cloneFunction_0<XalanEXSLTFunctionAtan>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -342,15 +342,15 @@
#else
virtual XalanEXSLTFunctionAtan2*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionAtan2(*this);
+ return cloneFunction_0<XalanEXSLTFunctionAtan2>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -397,18 +397,17 @@
#else
virtual XalanEXSLTFunctionConstant*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionConstant(*this);
+ return cloneFunction_0<XalanEXSLTFunctionConstant>()(theManager);
}
protected:
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,"constant()");
-
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,theBuffer,"constant()");
}
private:
@@ -473,15 +472,15 @@
#else
virtual XalanEXSLTFunctionCos*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionCos(*this);
+ return cloneFunction_0<XalanEXSLTFunctionCos>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -528,15 +527,15 @@
#else
virtual XalanEXSLTFunctionExp*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionExp(*this);
+ return cloneFunction_0<XalanEXSLTFunctionExp>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -583,15 +582,15 @@
#else
virtual XalanEXSLTFunctionHighest*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionHighest(*this);
+ return cloneFunction_0<XalanEXSLTFunctionHighest>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -638,15 +637,15 @@
#else
virtual XalanEXSLTFunctionLog*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionLog(*this);
+ return cloneFunction_0<XalanEXSLTFunctionLog>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -693,15 +692,15 @@
#else
virtual XalanEXSLTFunctionLowest*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionLowest(*this);
+ return cloneFunction_0<XalanEXSLTFunctionLowest>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -748,15 +747,15 @@
#else
virtual XalanEXSLTFunctionMax*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionMax(*this);
+ return cloneFunction_0<XalanEXSLTFunctionMax>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -803,15 +802,15 @@
#else
virtual XalanEXSLTFunctionMin*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionMin(*this);
+ return cloneFunction_0<XalanEXSLTFunctionMin>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -858,15 +857,15 @@
#else
virtual XalanEXSLTFunctionPower*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionPower(*this);
+ return cloneFunction_0<XalanEXSLTFunctionPower>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -913,15 +912,15 @@
#else
virtual XalanEXSLTFunctionSin*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionSin(*this);
+ return cloneFunction_0<XalanEXSLTFunctionSin>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -968,15 +967,15 @@
#else
virtual XalanEXSLTFunctionSqrt*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionSqrt(*this);
+ return cloneFunction_0<XalanEXSLTFunctionSqrt>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
@@ -1023,15 +1022,15 @@
#else
virtual XalanEXSLTFunctionTan*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionTan(*this);
+ return cloneFunction_0<XalanEXSLTFunctionTan>()(theManager);
}
protected:
- const XalanDOMString
- getError() const;
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const;
private:
1.5 +14 -8 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTSet.cpp
Index: XalanEXSLTSet.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTSet.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTSet.cpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTSet.cpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -40,12 +40,14 @@
{
if (args.size() != 2)
{
- executionContext.error(getError(), context, locator);
+ XalanDOMString theResult(executionContext.getMemoryManager());
+
+ executionContext.error(getError(theResult), context, locator);
}
assert(args[0].null() == false && args[1].null() == false);
- const NodeRefListBase& nodeset1 = args[0]->nodeset();
+ const NodeRefListBase& nodeset1 = args[0]->nodeset();
const NodeRefListBase& nodeset2 = args[1]->nodeset();
const NodeRefListBase::size_type theLength1 = nodeset1.getLength();
@@ -158,7 +160,9 @@
{
if (args.size() != 2)
{
- executionContext.error(getError(), context, locator);
+ XalanDOMString theResult(executionContext.getMemoryManager());
+
+ executionContext.error(getError(theResult), context, locator);
}
return findNodes(executionContext, args, LeadingCompareFunctor(executionContext));
@@ -199,7 +203,9 @@
{
if (args.size() != 2)
{
- executionContext.error(getError(), context, locator);
+ XalanDOMString theResult(executionContext.getMemoryManager());
+
+ executionContext.error(getError(theResult), context, locator);
}
return findNodes(executionContext, args, TrailingCompareFunctor(executionContext));
@@ -366,9 +372,9 @@
void
-XalanEXSLTSetFunctionsInstaller::installGlobal()
+XalanEXSLTSetFunctionsInstaller::installGlobal(MemoryManagerType& theManager)
{
- doInstallGlobal(s_setNamespace, theFunctionTable);
+ doInstallGlobal(theManager, s_setNamespace, theFunctionTable);
}
@@ -382,9 +388,9 @@
void
-XalanEXSLTSetFunctionsInstaller::uninstallGlobal()
+XalanEXSLTSetFunctionsInstaller::uninstallGlobal(MemoryManagerType& theManager)
{
- doUninstallGlobal(s_setNamespace, theFunctionTable);
+ doUninstallGlobal(theManager, s_setNamespace, theFunctionTable);
}
1.5 +4 -2 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTSet.hpp
Index: XalanEXSLTSet.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTSet.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTSet.hpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTSet.hpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -38,13 +38,15 @@
installLocal(XPathEnvSupportDefault& theSupport);
static void
- installGlobal();
+ installGlobal(MemoryManagerType& theManager);
static void
uninstallLocal(XPathEnvSupportDefault& theSupport);
static void
- uninstallGlobal();
+ uninstallGlobal(MemoryManagerType& theManager);
+
+private:
};
1.6 +41 -35 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTSetImpl.hpp
Index: XalanEXSLTSetImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTSetImpl.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XalanEXSLTSetImpl.hpp 26 Feb 2004 23:01:37 -0000 1.5
+++ XalanEXSLTSetImpl.hpp 8 Nov 2004 18:12:53 -0000 1.6
@@ -59,19 +59,18 @@
#else
virtual XalanEXSLTFunctionDifference*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionDifference(*this);
+ return cloneFunction_0<XalanEXSLTFunctionDifference>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,"difference()");
-
-
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,theBuffer , "difference()");
+ return theBuffer;
}
private:
@@ -105,20 +104,21 @@
#else
virtual XalanEXSLTFunctionDistinct*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionDistinct(*this);
+ return cloneFunction_0<XalanEXSLTFunctionDistinct>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,"distinct()");
-
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, theBuffer , "distinct()");
+ return theBuffer;
}
+
private:
// Not implemented...
@@ -165,20 +165,22 @@
#else
virtual XalanEXSLTFunctionHasSameNode*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionHasSameNode(*this);
+ return cloneFunction_0<XalanEXSLTFunctionHasSameNode>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,"has-same-node()");
-
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param, theBuffer, "has-same-node()");
+ return theBuffer;
}
+
+
private:
// Not implemented...
@@ -210,21 +212,22 @@
#else
virtual XalanEXSLTFunctionIntersection*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionIntersection(*this);
+ return cloneFunction_0<XalanEXSLTFunctionIntersection>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,"distinct()");
-
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param, theBuffer, "distinct()");
+ return theBuffer;
}
+
private:
// Not implemented...
@@ -271,18 +274,19 @@
#else
virtual XalanEXSLTFunctionLeading*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionLeading(*this);
+ return cloneFunction_0<XalanEXSLTFunctionLeading>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,"leading()");
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param, theBuffer, "leading()");
+ return theBuffer;
}
private:
@@ -331,17 +335,19 @@
#else
virtual XalanEXSLTFunctionTrailing*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionTrailing(*this);
+ return cloneFunction_0<XalanEXSLTFunctionTrailing>()(theManager);
}
protected:
- virtual const XalanDOMString
- getError() const
+ virtual const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param,"trailing()");
+ XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoArguments_1Param, theBuffer ,"trailing()");
+
+ return theBuffer;
}
private:
1.10 +65 -33 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTString.cpp
Index: XalanEXSLTString.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTString.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XalanEXSLTString.cpp 11 Aug 2004 15:20:35 -0000 1.9
+++ XalanEXSLTString.cpp 8 Nov 2004 18:12:53 -0000 1.10
@@ -73,7 +73,11 @@
if (theSize != 2 && theSize != 3)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+
+ XalanDOMString& theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false && args[1].null() == false && (theSize == 2 || args[2].null() == false));
@@ -159,7 +163,7 @@
-static const XalanDOMString s_emptyString;
+static const XalanDOMString s_emptyString(XalanMemMgrs::getDummyMemMgr());
@@ -171,8 +175,12 @@
const LocatorType* locator) const
{
if (args.size() != 1)
- {
- executionContext.error(getError(), context, locator);
+ {
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+
+ XalanDOMString& theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false);
@@ -224,7 +232,11 @@
if (theSize != 1 && theSize != 2)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+
+ XalanDOMString& theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false && (theSize == 1 || args[1].null() == false));
@@ -326,7 +338,11 @@
if (theSize != 2 && theSize != 3)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+
+ XalanDOMString& theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false &&
@@ -348,6 +364,9 @@
XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
XalanDOMString &theResult = theGuard.get();
+ XPathExecutionContext::GetAndReleaseCachedString theGuard1(executionContext);
+ XalanDOMString &theBuffer = theGuard1.get();
+
XALAN_USING_STD(find)
for (XalanDOMString::size_type i = 0; i < theString.length(); ++i)
@@ -364,8 +383,8 @@
(escapeReserved &&
find(s_reservedChars,s_reservedChars+s_reservedCharsSize,ch)
!= s_reservedChars+s_reservedCharsSize))
- {
- theResult+= escapedOctet(ch);
+ {
+ theResult+= escapedOctet(ch, theBuffer);
}
else
{
@@ -377,9 +396,10 @@
{
const XalanDOMChar highByte = XalanDOMChar((ch >> 6) | 0xC0);
const XalanDOMChar lowByte = XalanDOMChar((ch & 0x3F) | 0x80);
- escapedOctet(highByte);
- theResult+= escapedOctet(highByte);
- theResult+= escapedOctet(lowByte);
+
+
+ theResult+= escapedOctet(highByte,theBuffer);
+ theResult+= escapedOctet(lowByte,theBuffer);
}
// Character is in a higher supplementary plane
else if((ch & 0xFC00) == 0xD800) // high surrogate
@@ -394,19 +414,20 @@
const XalanDOMChar byte3 = XalanDOMChar(0x80 + ((highSurrogate & 0x0003) << 4) + ((lowSurrogate & 0x03C0) >> 6));
const XalanDOMChar byte4 = XalanDOMChar(0x80 + (lowSurrogate & 0x003F));
- theResult+= escapedOctet(byte1);
- theResult+= escapedOctet(byte2);
- theResult+= escapedOctet(byte3);
- theResult+= escapedOctet(byte4);
+ theResult+= escapedOctet(byte1,theBuffer);
+ theResult+= escapedOctet(byte2,theBuffer);
+ theResult+= escapedOctet(byte3,theBuffer);
+ theResult+= escapedOctet(byte4,theBuffer);
}
else
{
const XalanDOMChar highByte = XalanDOMChar((ch >> 12) | 0xE0);
const XalanDOMChar middleByte = XalanDOMChar(((ch & 0x0FC0) >> 6) | 0x80);
const XalanDOMChar lowByte = XalanDOMChar((ch & 0x3F) | 0x80);
- theResult+= escapedOctet(highByte);
- theResult+= escapedOctet(middleByte);
- theResult+= escapedOctet(lowByte);
+
+ theResult+= escapedOctet(highByte,theBuffer);
+ theResult+= escapedOctet(middleByte,theBuffer);
+ theResult+= escapedOctet(lowByte,theBuffer);
}
}
@@ -414,13 +435,14 @@
}
-const XalanDOMString
-XalanEXSLTFunctionEncodeURI::escapedOctet(const XalanDOMChar theChar) const
+const XalanDOMString&
+XalanEXSLTFunctionEncodeURI::escapedOctet(const XalanDOMChar theChar,
+ XalanDOMString& theResult) const
{
- XalanDOMString theResult;
+ theResult = XalanUnicode::charPercentSign;
+
+ XalanDOMString stringBuffer(theResult.getMemoryManager());
- theResult += XalanUnicode::charPercentSign;
- XalanDOMString stringBuffer;
UnsignedLongToHexDOMString(theChar, stringBuffer);
if (stringBuffer.length() == 1)
{
@@ -443,7 +465,11 @@
if (theSize != 1 && theSize != 2)
{
- executionContext.error(getError(), context, locator);
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+
+ XalanDOMString& theBuffer = theGuard.get();
+
+ executionContext.error(getError(theBuffer), context, locator);
}
assert(args[0].null() == false &&
@@ -573,27 +599,31 @@
XalanDOMChar byte = 0;
XalanDOMChar curChar = lowHexChar;
+
for (int place = 0; place < 2; ++place)
{
if (curChar >= XalanUnicode::charDigit_0
&& curChar <= XalanUnicode::charDigit_9) // Digit
{
- byte += XalanDOMChar((curChar - XalanUnicode::charDigit_0) << (place * 4));
+ byte = byte + XalanDOMChar((curChar - XalanUnicode::charDigit_0) << (place * 4));
}
else if (curChar >= XalanUnicode::charLetter_A
&& curChar <= XalanUnicode::charLetter_F) // Uppercase
{
- byte += XalanDOMChar((curChar - XalanUnicode::charLetter_A + 10) << (place * 4));
+ byte = byte + XalanDOMChar((curChar - XalanUnicode::charLetter_A + 10) << (place * 4));
}
else if (curChar >= XalanUnicode::charLetter_a
&& curChar <= XalanUnicode::charLetter_f) // Lowercase
{
- byte += XalanDOMChar((curChar - XalanUnicode::charLetter_a + 10) << place);
+ byte = byte + XalanDOMChar((curChar - XalanUnicode::charLetter_a + 10) << place);
}
else
{
+ XPathExecutionContext::GetAndReleaseCachedString theGuard(executionContext);
+ XalanDOMString &theBuffer = theGuard.get();
+
executionContext.error(
- XalanMessageLoader::getMessage(XalanMessages::InvalidURI),
+ XalanMessageLoader::getMessage(XalanMessages::InvalidURI,theBuffer),
context,
locator);
}
@@ -707,7 +737,9 @@
// Note this is a special constructor of XalanEXSLTFunctionPadding which
// allocates no memory. It is only used here, so we can have table-based
// initialization, but not have any memory allocation.
-static const XalanEXSLTFunctionPadding s_paddingFunction(1);
+
+static const XalanEXSLTFunctionPadding s_paddingFunction(XalanMemMgrs::getDummyMemMgr(), 1);
+
static const XalanEXSLTFunctionEncodeURI s_encodeUriFunction;
static const XalanEXSLTFunctionDecodeURI s_decodeUriFunction;
@@ -734,9 +766,9 @@
void
-XalanEXSLTStringFunctionsInstaller::installGlobal()
+XalanEXSLTStringFunctionsInstaller::installGlobal(MemoryManagerType& theManager)
{
- doInstallGlobal(s_stringNamespace, theFunctionTable);
+ doInstallGlobal(theManager, s_stringNamespace, theFunctionTable);
}
@@ -750,9 +782,9 @@
void
-XalanEXSLTStringFunctionsInstaller::uninstallGlobal()
+XalanEXSLTStringFunctionsInstaller::uninstallGlobal(MemoryManagerType& theManager)
{
- doUninstallGlobal(s_stringNamespace, theFunctionTable);
+ doUninstallGlobal(theManager, s_stringNamespace, theFunctionTable);
}
1.5 +5 -2 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTString.hpp
Index: XalanEXSLTString.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTString.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XalanEXSLTString.hpp 26 Feb 2004 23:01:37 -0000 1.4
+++ XalanEXSLTString.hpp 8 Nov 2004 18:12:53 -0000 1.5
@@ -38,13 +38,16 @@
installLocal(XPathEnvSupportDefault& theSupport);
static void
- installGlobal();
+ installGlobal(MemoryManagerType& theManager);
static void
uninstallLocal(XPathEnvSupportDefault& theSupport);
static void
- uninstallGlobal();
+ uninstallGlobal(MemoryManagerType& theManager);
+
+private:
+
};
1.9 +49 -31 xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTStringImpl.hpp
Index: XalanEXSLTStringImpl.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTStringImpl.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- XalanEXSLTStringImpl.hpp 26 Feb 2004 23:01:37 -0000 1.8
+++ XalanEXSLTStringImpl.hpp 8 Nov 2004 18:12:53 -0000 1.9
@@ -44,6 +44,7 @@
{
}
+
virtual
~XalanEXSLTFunctionAlign()
{
@@ -67,17 +68,17 @@
#else
virtual XalanEXSLTFunctionAlign*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionAlign(*this);
+ return cloneFunction_0<XalanEXSLTFunctionAlign>()(theManager);
}
protected:
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoOrThreeArguments_1Param,"align()");
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoOrThreeArguments_1Param,theBuffer, "align()");
}
private:
@@ -131,17 +132,17 @@
#else
virtual XalanEXSLTFunctionConcat*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionConcat(*this);
+ return cloneFunction_0<XalanEXSLTFunctionConcat>()(theManager);
}
protected:
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,"concat()");
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,theBuffer,"concat()");
}
private:
@@ -162,16 +163,22 @@
typedef Function ParentType;
- XalanEXSLTFunctionPadding() :
+ XalanEXSLTFunctionPadding(MemoryManagerType& theManager) :
Function(),
- m_space(s_spaceString)
+ m_space(s_spaceString,theManager)
{
}
// A dummy constructor for use internally. Do not use this one!!!!
- XalanEXSLTFunctionPadding(int /* theDummy */) :
+ XalanEXSLTFunctionPadding(MemoryManagerType& theManager, int /* theDummy */) :
Function(),
- m_space()
+ m_space(theManager)
+ {
+ }
+
+ XalanEXSLTFunctionPadding(const XalanEXSLTFunctionPadding& other, MemoryManagerType& theManager) :
+ Function(other),
+ m_space(other.m_space, theManager)
{
}
@@ -180,6 +187,16 @@
{
}
+ void
+ swap(XalanEXSLTFunctionPadding& other)
+ {
+//#pragma message ("Break costness here!")
+ XalanDOMString* thisString = const_cast<XalanDOMString*>(&m_space);
+
+ XalanDOMString* otherString = const_cast<XalanDOMString*>(&(other.m_space));
+
+ thisString->swap(*otherString);
+ }
// These methods are inherited from Function ...
virtual XObjectPtr
@@ -198,17 +215,17 @@
#else
virtual XalanEXSLTFunctionPadding*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionPadding;
+ return cloneFunction<XalanEXSLTFunctionPadding>()(*this, theManager);
}
protected:
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAccepts1Or2Argument_1Param,"padding()");
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAccepts1Or2Argument_1Param,theBuffer,"padding()");
}
private:
@@ -264,21 +281,22 @@
#else
virtual XalanEXSLTFunctionEncodeURI*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionEncodeURI;
+ return cloneFunction_0<XalanEXSLTFunctionEncodeURI>()(theManager);
}
protected:
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoOrThreeArguments_1Param,"encode-uri()");
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAcceptsTwoOrThreeArguments_1Param,theBuffer, "encode-uri()");
}
- const XalanDOMString
- escapedOctet(const XalanDOMChar theChar) const;
+ const XalanDOMString&
+ escapedOctet(const XalanDOMChar theChar,
+ XalanDOMString& theBuffer) const;
static const XalanDOMChar s_reservedChars[];
static const XalanDOMString::size_type s_reservedCharsSize;
@@ -334,17 +352,17 @@
#else
virtual XalanEXSLTFunctionDecodeURI*
#endif
- clone() const
+ clone(MemoryManagerType& theManager) const
{
- return new XalanEXSLTFunctionDecodeURI;
+ return cloneFunction_0<XalanEXSLTFunctionDecodeURI>()(theManager);
}
protected:
- const XalanDOMString
- getError() const
+ const XalanDOMString&
+ getError(XalanDOMString& theBuffer) const
{
- return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAccepts1Or2Argument_1Param,"decode-uri()");
+ return XalanMessageLoader::getMessage(XalanMessages::EXSLTFunctionAccepts1Or2Argument_1Param,theBuffer,"decode-uri()");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org