v1.1.0
This commit is contained in:
parent
625a590fae
commit
9b71614762
1556 changed files with 70210 additions and 50502 deletions
|
@ -8,7 +8,7 @@
|
|||
*
|
||||
* See the file LICENSE for redistribution information.
|
||||
*
|
||||
* $Id: FunctionLookup.hpp,v 1.10 2006/11/01 16:37:13 jpcs Exp $
|
||||
* $Id: FunctionLookup.hpp,v 1.13 2007/01/17 17:11:12 gmfeinberg Exp $
|
||||
*/
|
||||
|
||||
#ifndef _FLOOKUP_HPP
|
||||
|
@ -18,26 +18,57 @@
|
|||
|
||||
#include <vector>
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
#include <xercesc/util/RefHash2KeysTableOf.hpp>
|
||||
#include <xqilla/ast/ASTNode.hpp>
|
||||
|
||||
class FuncFactory;
|
||||
class XPath2MemoryManager;
|
||||
class ExternalFunction;
|
||||
|
||||
class XQILLA_API FunctionLookup
|
||||
{
|
||||
public:
|
||||
virtual ~FunctionLookup() {}
|
||||
FunctionLookup(XPath2MemoryManager* memMgr);
|
||||
~FunctionLookup();
|
||||
|
||||
///adds a function to the custom function table
|
||||
virtual void insertFunction(FuncFactory *func) = 0;
|
||||
void insertFunction(FuncFactory *func);
|
||||
/// replaces the implementation of an existing function
|
||||
virtual void replaceFunction(FuncFactory *func) = 0;
|
||||
void replaceFunction(FuncFactory *func);
|
||||
///returns the approriate Function object
|
||||
virtual ASTNode* lookUpFunction(const XMLCh* URI, const XMLCh* fname, const VectorOfASTNodes &args, XPath2MemoryManager* memMgr) const = 0;
|
||||
ASTNode* lookUpFunction(const XMLCh* URI, const XMLCh* fname,
|
||||
const VectorOfASTNodes &args,
|
||||
XPath2MemoryManager* memMgr) const;
|
||||
|
||||
/// returns all the defined functions
|
||||
virtual std::vector< std::pair<const XMLCh*,const XMLCh*> > getFunctions() const = 0;
|
||||
virtual std::vector< FuncFactory* > getFunctionFactories() const = 0;
|
||||
///adds a function to the external function table
|
||||
void insertExternalFunction(const ExternalFunction *func);
|
||||
///returns the approriate ExternalFunction object
|
||||
const ExternalFunction *lookUpExternalFunction(const XMLCh* URI,
|
||||
const XMLCh* fname,
|
||||
unsigned int numArgs) const;
|
||||
void insertUpdateFunctions(XPath2MemoryManager *memMgr);
|
||||
|
||||
private:
|
||||
XERCES_CPP_NAMESPACE_QUALIFIER RefHash2KeysTableOf< FuncFactory > _funcTable;
|
||||
XERCES_CPP_NAMESPACE_QUALIFIER RefHash2KeysTableOf< const ExternalFunction > _exFuncTable;
|
||||
|
||||
public:
|
||||
// static (global table interfaces)
|
||||
static void insertGlobalFunction(FuncFactory *func);
|
||||
static void insertGlobalExternalFunction(const ExternalFunction *func);
|
||||
// next two look in global table first, then the contextTable
|
||||
static ASTNode* lookUpGlobalFunction(const XMLCh* URI, const XMLCh* fname,
|
||||
const VectorOfASTNodes &args,
|
||||
XPath2MemoryManager* memMgr,
|
||||
const FunctionLookup *contextTable);
|
||||
static const ExternalFunction *lookUpGlobalExternalFunction(
|
||||
const XMLCh* URI, const XMLCh* fname, unsigned int numArgs,
|
||||
const FunctionLookup *contextTable);
|
||||
static void initialize();
|
||||
static void terminate();
|
||||
private:
|
||||
static FunctionLookup *g_globalFunctionTable;
|
||||
static XPath2MemoryManager *g_memMgr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue