Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


Function.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(FUNCTION_HEADER_GUARD_1357924680)
19 #define FUNCTION_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base header file. Must be first.
25 
27 
28 
29 #include <vector>
30 
31 
32 
33 #include <xalanc/XPath/XObject.hpp>
35 
36 
37 XALAN_DECLARE_XERCES_CLASS(Locator)
38 
39 
40 
41 XALAN_CPP_NAMESPACE_BEGIN
42 
43 
44 
45 class XalanNode;
46 
47 
48 
49 // Base class for all XPath function classes.
50 //
51 // These are all inline, even though
52 // there are virtual functions, because we expect that they will only be
53 // needed by the XPath class.
55 {
56 public:
57 
58  typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType;
59 
60  explicit
61  Function();
62 
63  virtual
64  ~Function();
65 
69 
70  /**
71  * Execute an XPath function object. The function must return a valid
72  * object. Extension functions should override this version of execute(),
73  * rather than one of the other calls designed for a specific number of
74  * arguments, since the extension function mechanism will call this
75  * version first. Extension functions that accept more than three
76  * arguments _must_ override this version.
77  *
78  * @param executionContext executing context
79  * @param context current context node
80  * @param args vector of pointers to XObject arguments
81  * @param locator Locator instance for the XPath expression that contains the function call
82  * @return pointer to the result XObject
83  */
84  virtual XObjectPtr
85  execute(
86  XPathExecutionContext& executionContext,
87  XalanNode* context,
88  const XObjectArgVectorType& args,
89  const Locator* locator) const;
90 
91  /**
92  * Execute an XPath function object. The function must return a valid
93  * object. Called if function has no parameters.
94  *
95  * @param executionContext executing context
96  * @param context current context node
97  * @param locator Locator instance for the XPath expression that contains the function call
98  * @return pointer to the result XObject
99  */
100  virtual XObjectPtr
101  execute(
102  XPathExecutionContext& executionContext,
103  XalanNode* context,
104  const Locator* locator) const;
105 
106  /**
107  * Execute an XPath function object. The function must return a valid
108  * object. Called if function has one parameter.
109  *
110  * @param executionContext executing context
111  * @param context current context node
112  * @param arg pointer to XObject argument
113  * @param locator Locator instance for the XPath expression that contains the function call
114  * @return pointer to the result XObject
115  */
116  virtual XObjectPtr
117  execute(
118  XPathExecutionContext& executionContext,
119  XalanNode* context,
120  const XObjectPtr arg,
121  const Locator* locator) const;
122 
123  /**
124  * Execute an XPath function object. The function must return a valid
125  * object. Called if function has two parameters.
126  *
127  * @param executionContext executing context
128  * @param context current context node
129  * @param arg1 pointer to XObject argument
130  * @param arg2 pointer to XObject argument
131  * @param locator Locator instance for the XPath expression that contains the function call
132  * @return pointer to the result XObject
133  */
134  virtual XObjectPtr
135  execute(
136  XPathExecutionContext& executionContext,
137  XalanNode* context,
138  const XObjectPtr arg1,
139  const XObjectPtr arg2,
140  const Locator* locator) const;
141 
142  /**
143  * Execute an XPath function object. The function must return a valid
144  * object. Called if function has three parameters.
145  *
146  * @param executionContext executing context
147  * @param context current context node
148  * @param arg1 pointer to XObject arguments
149  * @param arg2 pointer to XObject argument
150  * @param arg3 pointer to XObject argument
151  * @param locator Locator instance for the XPath expression that contains the function call
152  * @return pointer to the result XObject
153  */
154  virtual XObjectPtr
155  execute(
156  XPathExecutionContext& executionContext,
157  XalanNode* context,
158  const XObjectPtr arg1,
159  const XObjectPtr arg2,
160  const XObjectPtr arg3,
161  const Locator* locator) const;
162 
163  /**
164  * Create a copy of the function object.
165  *
166  * @return pointer to the new object
167  */
168  virtual Function*
169  clone(MemoryManager& theManager) const = 0;
170 
171 protected:
172 
173  /**
174  * Get the error message to report when
175  * the function is called with the wrong
176  * number of arguments.
177  *
178  * @param theBuffer The XalanDOMString for the message.
179  * @return The error message
180  */
181  virtual const XalanDOMString&
182  getError(XalanDOMString& theBuffer) const = 0;
183 
184  /**
185  * Report the error returned from the getError()
186  * call.
187  *
188  * @param executionContext The current XPathExecutionContext
189  * @param context The context node
190  * @param locator The Locator instance for the XPath expression that contains the function call
191  */
192  void
193  generalError(
194  XPathExecutionContext& executionContext,
195  const XalanNode* context,
196  const Locator* locator) const;
197 
198 private:
199 
200  // Not implemented...
201  Function&
202  operator=(const Function&);
203 
204  bool
205  operator==(const Function&) const;
206 };
207 
208 
209 
210 XALAN_CPP_NAMESPACE_END
211 
212 
213 
214 #endif // FUNCTION_HEADER_GUARD_1357924680
Class to hold XObjectPtr return types.
Definition: XObject.hpp:883
XPathExecutionContext::GetCachedString GetCachedString
Definition: Function.hpp:67
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
Definition: Function.hpp:58
XPathExecutionContext::XObjectArgVectorType XObjectArgVectorType
Definition: Function.hpp:66
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
XPathExecutionContext::GetCachedNodeList GetCachedNodeList
Definition: Function.hpp:68
#define XALAN_XPATH_EXPORT

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo