00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(FUNCTION_HEADER_GUARD_1357924680) 00019 #define FUNCTION_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base header file. Must be first. 00024 #include <xalanc/XPath/XPathDefinitions.hpp> 00025 00026 #include <xalanc/Include/XalanMemMgrAutoPtr.hpp> 00027 00028 00029 #include <vector> 00030 00031 00032 00033 #include <xalanc/XPath/XObject.hpp> 00034 #include <xalanc/XPath/XPathExecutionContext.hpp> 00035 00036 00037 XALAN_DECLARE_XERCES_CLASS(Locator) 00038 00039 00040 00041 XALAN_CPP_NAMESPACE_BEGIN 00042 00043 00044 00045 class XalanNode; 00046 00047 00048 00049 // Base class for all XPath function classes. 00050 // 00051 // These are all inline, even though 00052 // there are virtual functions, because we expect that they will only be 00053 // needed by the XPath class. 00054 class XALAN_XPATH_EXPORT Function 00055 { 00056 public: 00057 00058 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType; 00059 00060 explicit 00061 Function(); 00062 00063 virtual 00064 ~Function(); 00065 00066 typedef XPathExecutionContext::XObjectArgVectorType XObjectArgVectorType; 00067 typedef XPathExecutionContext::GetCachedString GetCachedString; 00068 typedef XPathExecutionContext::GetCachedNodeList GetCachedNodeList; 00069 00070 /** 00071 * Execute an XPath function object. The function must return a valid 00072 * object. Extension functions should override this version of execute(), 00073 * rather than one of the other calls designed for a specific number of 00074 * arguments, since the extension function mechanism will call this 00075 * version first. Extension functions that accept more than three 00076 * arguments _must_ override this version. 00077 * 00078 * @param executionContext executing context 00079 * @param context current context node 00080 * @param args vector of pointers to XObject arguments 00081 * @param locator Locator instance for the XPath expression that contains the function call 00082 * @return pointer to the result XObject 00083 */ 00084 virtual XObjectPtr 00085 execute( 00086 XPathExecutionContext& executionContext, 00087 XalanNode* context, 00088 const XObjectArgVectorType& args, 00089 const Locator* locator) const; 00090 00091 /** 00092 * Execute an XPath function object. The function must return a valid 00093 * object. Called if function has no parameters. 00094 * 00095 * @param executionContext executing context 00096 * @param context current context node 00097 * @param locator Locator instance for the XPath expression that contains the function call 00098 * @return pointer to the result XObject 00099 */ 00100 virtual XObjectPtr 00101 execute( 00102 XPathExecutionContext& executionContext, 00103 XalanNode* context, 00104 const Locator* locator) const; 00105 00106 /** 00107 * Execute an XPath function object. The function must return a valid 00108 * object. Called if function has one parameter. 00109 * 00110 * @param executionContext executing context 00111 * @param context current context node 00112 * @param arg pointer to XObject argument 00113 * @param locator Locator instance for the XPath expression that contains the function call 00114 * @return pointer to the result XObject 00115 */ 00116 virtual XObjectPtr 00117 execute( 00118 XPathExecutionContext& executionContext, 00119 XalanNode* context, 00120 const XObjectPtr arg, 00121 const Locator* locator) const; 00122 00123 /** 00124 * Execute an XPath function object. The function must return a valid 00125 * object. Called if function has two parameters. 00126 * 00127 * @param executionContext executing context 00128 * @param context current context node 00129 * @param arg1 pointer to XObject argument 00130 * @param arg2 pointer to XObject argument 00131 * @param locator Locator instance for the XPath expression that contains the function call 00132 * @return pointer to the result XObject 00133 */ 00134 virtual XObjectPtr 00135 execute( 00136 XPathExecutionContext& executionContext, 00137 XalanNode* context, 00138 const XObjectPtr arg1, 00139 const XObjectPtr arg2, 00140 const Locator* locator) const; 00141 00142 /** 00143 * Execute an XPath function object. The function must return a valid 00144 * object. Called if function has three parameters. 00145 * 00146 * @param executionContext executing context 00147 * @param context current context node 00148 * @param arg1 pointer to XObject arguments 00149 * @param arg2 pointer to XObject argument 00150 * @param arg3 pointer to XObject argument 00151 * @param locator Locator instance for the XPath expression that contains the function call 00152 * @return pointer to the result XObject 00153 */ 00154 virtual XObjectPtr 00155 execute( 00156 XPathExecutionContext& executionContext, 00157 XalanNode* context, 00158 const XObjectPtr arg1, 00159 const XObjectPtr arg2, 00160 const XObjectPtr arg3, 00161 const Locator* locator) const; 00162 00163 /** 00164 * Create a copy of the function object. 00165 * 00166 * @return pointer to the new object 00167 */ 00168 virtual Function* 00169 clone(MemoryManager& theManager) const = 0; 00170 00171 protected: 00172 00173 /** 00174 * Get the error message to report when 00175 * the function is called with the wrong 00176 * number of arguments. 00177 * 00178 * @param theBuffer The XalanDOMString for the message. 00179 * @return The error message 00180 */ 00181 virtual const XalanDOMString& 00182 getError(XalanDOMString& theBuffer) const = 0; 00183 00184 /** 00185 * Report the error returned from the getError() 00186 * call. 00187 * 00188 * @param executionContext The current XPathExecutionContext 00189 * @param context The context node 00190 * @param locator The Locator instance for the XPath expression that contains the function call 00191 */ 00192 void 00193 generalError( 00194 XPathExecutionContext& executionContext, 00195 const XalanNode* context, 00196 const Locator* locator) const; 00197 00198 private: 00199 00200 // Not implemented... 00201 Function& 00202 operator=(const Function&); 00203 00204 bool 00205 operator==(const Function&) const; 00206 }; 00207 00208 00209 00210 XALAN_CPP_NAMESPACE_END 00211 00212 00213 00214 #endif // FUNCTION_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|