SourceForge.net Logo
ExternalFunction.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001, 2008,
3  * DecisionSoft Limited. All rights reserved.
4  * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef _EXTERNALFUNCTION_HPP
21 #define _EXTERNALFUNCTION_HPP
22 
23 #include <xqilla/framework/XQillaExport.hpp>
24 
25 #include <xercesc/util/XMLUniDefs.hpp>
26 
27 class Result;
28 class PendingUpdateList;
29 class DynamicContext;
31 
32 class XQILLA_API ExternalFunction
33 {
34 public:
35  class XQILLA_API Arguments
36  {
37  public:
38  virtual ~Arguments() {}
39 
41  virtual Result getArgument(size_t index, DynamicContext *context) const = 0;
42  };
43 
44  virtual ~ExternalFunction() {}
45 
46  const XMLCh *getURI() const { return uri_; }
47  const XMLCh *getName() const { return name_; }
48  const XMLCh *getURINameHash() const { return uriName_; }
49  unsigned int getNumberOfArguments() const { return numArgs_; }
50 
52  virtual Result execute(const Arguments *args, DynamicContext *context) const;
54  virtual PendingUpdateList executeUpdate(const Arguments *args, DynamicContext *context) const;
55 
56 protected:
57  ExternalFunction(const XMLCh *uri, const XMLCh *name, unsigned int numberOfArgs, XPath2MemoryManager *mm);
58 
59  const XMLCh *uri_;
60  const XMLCh *name_;
61  const XMLCh *uriName_;
62  unsigned int numArgs_;
63 };
64 
65 #endif
66 
Definition: ExternalFunction.hpp:35
Definition: XPath2MemoryManager.hpp:45
const XMLCh * name_
Definition: ExternalFunction.hpp:60
const XMLCh * uri_
Definition: ExternalFunction.hpp:59
virtual ~ExternalFunction()
Definition: ExternalFunction.hpp:44
unsigned int numArgs_
Definition: ExternalFunction.hpp:62
const XMLCh * getURI() const
Definition: ExternalFunction.hpp:46
Definition: ExternalFunction.hpp:32
A scoped pointer wrapper for the lazily evaluated query result.
Definition: Result.hpp:37
const XMLCh * uriName_
Definition: ExternalFunction.hpp:61
virtual ~Arguments()
Definition: ExternalFunction.hpp:38
The execution time dynamic context interface.
Definition: DynamicContext.hpp:38
const XMLCh * getURINameHash() const
Definition: ExternalFunction.hpp:48
const XMLCh * getName() const
Definition: ExternalFunction.hpp:47
unsigned int getNumberOfArguments() const
Definition: ExternalFunction.hpp:49