23#include <xqilla/framework/XQillaExport.hpp>
31#include <xercesc/util/RefHashTableOf.hpp>
35class XQGlobalVariable;
38class DelayedFuncFactory;
41typedef std::vector<XQGlobalVariable*, XQillaAllocator<XQGlobalVariable*> >
GlobalVariables;
43typedef std::vector<DelayedFuncFactory*, XQillaAllocator<DelayedFuncFactory*> >
DelayedFunctions;
45typedef XERCES_CPP_NAMESPACE_QUALIFIER RefHashTableOf<XQQuery>
ModuleMap;
47class XQILLA_API
ModuleCache :
public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
50 ModuleCache(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *mm);
75class XQILLA_API XQQuery :
public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
93 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager)
const;
248 const XMLCh *functionDeclaration,
bool isPrivate =
false,
249 int line = 1,
int column = 1);
251 const char *functionDeclaration,
bool isPrivate =
false,
252 int line = 1,
int column = 1);
268 const XMLCh*
getFile()
const {
return m_szCurrentFile; }
306 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr);
308 XQQuery(
const XQQuery &);
309 XQQuery &operator=(
const XQQuery &);
311 XQQuery *parseModule(
const XMLCh *ns,
const XMLCh *at,
const LocationInfo *location)
const;
316 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* m_memMgr;
324 bool m_bIsLibraryModule;
325 const XMLCh* m_szTargetNamespace;
326 const XMLCh* m_szQueryText;
327 const XMLCh* m_szCurrentFile;
335 bool m_moduleCacheOwned;
339 enum { BEFORE, DURING, AFTER } m_staticTyped;
std::vector< const XMLCh *, XQillaAllocator< const XMLCh * > > VectorOfStrings
Definition DocumentCache.hpp:37
std::vector< XQUserFunction *, XQillaAllocator< XQUserFunction * > > UserFunctions
Definition StaticContext.hpp:48
xercesc::RefHashTableOf< XQQuery > ModuleMap
Definition XQQuery.hpp:45
std::vector< DelayedFuncFactory *, XQillaAllocator< DelayedFuncFactory * > > DelayedFunctions
Definition XQQuery.hpp:43
std::vector< XQQuery *, XQillaAllocator< XQQuery * > > ImportedModules
Definition XQQuery.hpp:42
std::vector< XQGlobalVariable *, XQillaAllocator< XQGlobalVariable * > > GlobalVariables
Definition XQQuery.hpp:41
The execution time dynamic context interface.
Definition DynamicContext.hpp:39
Definition EventHandler.hpp:30
RefCountPointer< const Item > Ptr
Definition Item.hpp:39
A class that gives records a location in the query.
Definition LocationInfo.hpp:30
Definition XQQuery.hpp:48
void put(XQQuery *module)
XQQuery * getByURI(const XMLCh *uri) const
ModuleMap byURI_
Definition XQQuery.hpp:56
XQQuery * getByNamespace(const XMLCh *ns) const
ModuleMap byNamespace_
Definition XQQuery.hpp:57
ModuleCache(xercesc::MemoryManager *mm)
ImportedModules ordered_
Definition XQQuery.hpp:58
A scoped pointer wrapper for the lazily evaluated query result.
Definition Result.hpp:38
Encapsulates a query expression.
Definition XQQuery.hpp:76
void execute(EventHandler *events, const Item::Ptr &contextItem, DynamicContext *context) const
Executes the query or stylesheet using the given context item and DynamicContext, sending the output ...
const XMLCh * getModuleTargetNamespace() const
Gets the module taget namespace for this query.
void addDelayedFunction(const XMLCh *uri, const XMLCh *name, size_t numArgs, const XMLCh *functionDeclaration, bool isPrivate=false, int line=1, int column=1)
Adds a function defined in XQuery syntax.
const DynamicContext * getStaticContext() const
Definition XQQuery.hpp:276
std::string getQueryPlan() const
Returns the query plan as XML. This is designed for debug and informative purposes only.
void addDelayedFunction(const XMLCh *uri, const XMLCh *name, size_t numArgs, const char *functionDeclaration, bool isPrivate=false, int line=1, int column=1)
void setQueryBody(ASTNode *query)
Set the query body to an ASTNode.
void setNext(XQQuery *n)
Definition XQQuery.hpp:279
XQQuery * getNext() const
Definition XQQuery.hpp:278
void setVersion3(bool v)
Definition XQQuery.hpp:274
bool getVersion3() const
Definition XQQuery.hpp:273
bool isModuleCacheOwned() const
Definition XQQuery.hpp:265
void staticTyping(StaticTyper *styper=0)
Perform type calculation and related optimizations.
bool getIsLibraryModule() const
Returns whether this query is a module or not.
Result execute(const XMLCh *templateQName, DynamicContext *context) const
Executes the stylesheet starting at the named template using the given DynamicContext,...
friend class XQilla
Definition XQQuery.hpp:345
DynamicContext * createDynamicContext(xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const
Creates a DynamicContext based on the static context used to parse this query.
void setQueryText(const XMLCh *v)
void importModule(XQQuery *module)
friend class QueryResult
Definition XQQuery.hpp:344
ModuleCache * getModuleCache() const
Definition XQQuery.hpp:264
void execute(EventHandler *events, DynamicContext *context) const
Executes the query using the given DynamicContext, sending the output of the query to the given Event...
void setModuleTargetNamespace(const XMLCh *uri)
Sets the module target namespace for this query.
void setFile(const XMLCh *file)
Sets the name of the file that this query was parsed from.
const ImportedModules & getImportedModules() const
Returns a vector of all XQGlobalVariable objects from the query.
Definition XQQuery.hpp:262
const XMLCh * getFile() const
Returns the name of the file that this query was parsed from.
Definition XQQuery.hpp:268
void addVariable(XQGlobalVariable *varDef)
Adds a XQGlobalVariable to the query.
const UserFunctions & getFunctions() const
Returns a vector of all XQUserFunction objects from the query.
Definition XQQuery.hpp:243
friend class DelayedModule
Definition XQQuery.hpp:346
void addFunction(XQUserFunction *fnDef)
Adds an XQUserFunction to the query (also adds it as a template if necessary)
const XMLCh * getQueryText() const
Returns the expression that was parsed to create this XQQuery object.
Definition XQQuery.hpp:224
void setIsLibraryModule(bool bIsModule=true)
Sets whether this query is a module or not.
void execute(EventHandler *events, const XMLCh *templateQName, DynamicContext *context) const
Executes the stylesheet starting at the named template using the given DynamicContext,...
ASTNode * getQueryBody() const
Get the query body as an ASTNode.
void importModule(const XMLCh *szUri, VectorOfStrings *locations, const LocationInfo *location)
Performs a module import from the given target namespace and locations.
bool staticTypingOnce(StaticTyper *styper=0)
XQQuery * findModuleForFunction(const XMLCh *uri, const XMLCh *name, int numArgs)
Result execute(const Item::Ptr &contextItem, DynamicContext *context) const
Executes the query or stylesheet using the given context item and DynamicContext, returning a lazy it...
void staticResolution()
Perform static resolution on the query.
XQQuery * findModuleForVariable(const XMLCh *uri, const XMLCh *name)
const DelayedFunctions & getDelayedFunctions() const
Returns a vector of all XQUserFunction objects from the query.
Definition XQQuery.hpp:254
const GlobalVariables & getVariables() const
Returns a vector of all XQGlobalVariable objects from the query.
Definition XQQuery.hpp:259
Result execute(DynamicContext *context) const
Executes the query using the given DynamicContext, returning a lazy iterator over the results.