XQuilla/src/functions/FuncFactoryTemplate.hpp
2020-02-17 22:05:20 +01:00

61 lines
1.2 KiB
C++

/*
* Copyright (c) 2001-2006
* DecisionSoft Limited. All rights reserved.
* Copyright (c) 2004-2006
* Progress Software Corporation. All rights reserved.
* Copyright (c) 2004-2006
* Oracle. All rights reserved.
*
* See the file LICENSE for redistribution information.
*
* $Id: FuncFactoryTemplate.hpp,v 1.8 2006/11/01 16:37:19 jpcs Exp $
*/
/*
Factory template class
*/
#ifndef _FUNCFACTORYTEMPLATE_HPP
#define _FUNCFACTORYTEMPLATE_HPP
#include <xqilla/framework/XQillaExport.hpp>
#include <xqilla/functions/FuncFactory.hpp>
///Macro used to facilitate the creation of functions
template<class TYPE>
class FuncFactoryTemplate : public FuncFactory
{
public:
FuncFactoryTemplate()
{
}
virtual ASTNode *createInstance(const VectorOfASTNodes &args, XPath2MemoryManager* memMgr) const
{
return new (memMgr) TYPE(args, memMgr);
}
virtual const XMLCh *getName() const
{
return TYPE::name;
}
virtual const XMLCh *getURI() const
{
return TYPE::XMLChFunctionURI;
}
virtual unsigned int getMinArgs() const
{
return TYPE::minArgs;
}
virtual unsigned int getMaxArgs() const
{
return TYPE::maxArgs;
}
};
#endif