23 #include <xqilla/framework/XQillaExport.hpp>
31 #include <xercesc/util/RefHashTableOf.hpp>
35 class XQGlobalVariable;
38 class DelayedFuncFactory;
41 typedef std::vector<XQGlobalVariable*, XQillaAllocator<XQGlobalVariable*> >
GlobalVariables;
43 typedef std::vector<DelayedFuncFactory*, XQillaAllocator<DelayedFuncFactory*> >
DelayedFunctions;
45 typedef XERCES_CPP_NAMESPACE_QUALIFIER RefHashTableOf<XQQuery>
ModuleMap;
47 class XQILLA_API
ModuleCache :
public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
50 ModuleCache(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *mm);
53 XQQuery *getByURI(
const XMLCh *uri)
const;
54 XQQuery *getByNamespace(
const XMLCh *ns)
const;
75 class XQILLA_API
XQQuery :
public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
92 DynamicContext *createDynamicContext(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
93 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager)
const;
201 void staticResolution();
215 void staticTyping(StaticTyper *styper = 0);
216 bool staticTypingOnce(StaticTyper *styper = 0);
225 void setQueryText(
const XMLCh *v);
228 std::string getQueryPlan()
const;
236 ASTNode* getQueryBody()
const;
238 void setQueryBody(ASTNode* query);
241 void addFunction(XQUserFunction* fnDef);
247 void addDelayedFunction(
const XMLCh *uri,
const XMLCh *name,
size_t numArgs,
248 const XMLCh *functionDeclaration,
bool isPrivate =
false,
249 int line = 1,
int column = 1);
250 void addDelayedFunction(
const XMLCh *uri,
const XMLCh *name,
size_t numArgs,
251 const char *functionDeclaration,
bool isPrivate =
false,
252 int line = 1,
int column = 1);
257 void addVariable(XQGlobalVariable* varDef);
268 const XMLCh*
getFile()
const {
return m_szCurrentFile; }
271 void setFile(
const XMLCh* file);
287 void setIsLibraryModule(
bool bIsModule=
true);
289 bool getIsLibraryModule()
const;
291 void setModuleTargetNamespace(
const XMLCh* uri);
293 const XMLCh* getModuleTargetNamespace()
const;
296 void importModule(
XQQuery *module);
298 XQQuery *findModuleForVariable(
const XMLCh *uri,
const XMLCh *name);
299 XQQuery *findModuleForFunction(
const XMLCh *uri,
const XMLCh *name,
int numArgs);
306 XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr);
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;
344 friend class QueryResult;
346 friend class DelayedModule;
bool getVersion3() const
Definition: XQQuery.hpp:273
const UserFunctions & getFunctions() const
Returns a vector of all XQUserFunction objects from the query.
Definition: XQQuery.hpp:243
Definition: XQQuery.hpp:47
Definition: EventHandler.hpp:29
const GlobalVariables & getVariables() const
Returns a vector of all XQGlobalVariable objects from the query.
Definition: XQQuery.hpp:259
const DelayedFunctions & getDelayedFunctions() const
Returns a vector of all XQUserFunction objects from the query.
Definition: XQQuery.hpp:254
void setNext(XQQuery *n)
Definition: XQQuery.hpp:279
std::vector< const XMLCh *, XQillaAllocator< const XMLCh * > > VectorOfStrings
Definition: DocumentCache.hpp:35
A scoped pointer wrapper for the lazily evaluated query result.
Definition: Result.hpp:37
ModuleMap byNamespace_
Definition: XQQuery.hpp:57
std::vector< XQUserFunction *, XQillaAllocator< XQUserFunction * > > UserFunctions
Definition: StaticContext.hpp:48
const XMLCh * getFile() const
Returns the name of the file that this query was parsed from.
Definition: XQQuery.hpp:268
bool isModuleCacheOwned() const
Definition: XQQuery.hpp:265
Encapsulates a query expression.
Definition: XQQuery.hpp:75
ImportedModules ordered_
Definition: XQQuery.hpp:58
std::vector< DelayedFuncFactory *, XQillaAllocator< DelayedFuncFactory * > > DelayedFunctions
Definition: XQQuery.hpp:43
std::vector< XQGlobalVariable *, XQillaAllocator< XQGlobalVariable * > > GlobalVariables
Definition: XQQuery.hpp:39
void setVersion3(bool v)
Definition: XQQuery.hpp:274
xercesc::RefHashTableOf< XQQuery > ModuleMap
Definition: XQQuery.hpp:45
ModuleMap byURI_
Definition: XQQuery.hpp:56
std::vector< XQQuery *, XQillaAllocator< XQQuery * > > ImportedModules
Definition: XQQuery.hpp:42
The execution time dynamic context interface.
Definition: DynamicContext.hpp:38
const ImportedModules & getImportedModules() const
Returns a vector of all XQGlobalVariable objects from the query.
Definition: XQQuery.hpp:262
ModuleCache * getModuleCache() const
Definition: XQQuery.hpp:264
A class that gives records a location in the query.
Definition: LocationInfo.hpp:29
const DynamicContext * getStaticContext() const
Definition: XQQuery.hpp:276
Provides factory methods for creating XQQuery and DynamicContext objects.
Definition: XQilla.hpp:52
const XMLCh * getQueryText() const
Returns the expression that was parsed to create this XQQuery object.
Definition: XQQuery.hpp:224
XQQuery * getNext() const
Definition: XQQuery.hpp:278