dbertoni 00/07/25 07:47:26
Modified: c/src/XPath XPathFactory.hpp
Log:
Added delete functor.
Revision Changes Path
1.6 +33 -1 xml-xalan/c/src/XPath/XPathFactory.hpp
Index: XPathFactory.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathFactory.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XPathFactory.hpp 2000/07/12 21:46:51 1.5
+++ XPathFactory.hpp 2000/07/25 14:47:25 1.6
@@ -111,6 +111,39 @@
virtual XPath*
create(bool fOptimize = true) = 0;
+ /**
+ *
+ * A functor for use with stl algorithms.
+ *
+ */
+#if defined(XALAN_NO_NAMESPACES)
+ struct DeleteXPathFunctor : public unary_function<const XPath*, void>
+#else
+ struct DeleteXPathFunctor : public std::unary_function<const XPath*,
void>
+#endif
+ {
+ public:
+
+ DeleteXPathFunctor(
+ XPathFactory& theFactoryInstance) :
+ m_factoryInstance(theFactoryInstance)
+ {
+ }
+
+ result_type
+ operator()(argument_type theXPath) const
+ {
+ m_factoryInstance.doReturnObject(theXPath,
+
false);
+ }
+
+ private:
+
+ XPathFactory& m_factoryInstance;
+ };
+
+ friend struct DeleteXPathFunctor;
+
protected:
virtual bool
@@ -154,7 +187,6 @@
};
friend struct ProtectedDeleteXPathFunctor;
-
};