zorba::Zorba#include <zorba/zorba.h> The Zorba class is the single point of access to the Zorba engine. There exists one instance of the Zorba class per process. It can be used to (1) create and compile queries, (2) create static contexts, (3) provides access to the XmlDataManager, (4) provides access to the ItemFactory, and (5) provides access to the PropertiesGlobal.Public Static Functions
Public Functions
Public Static FunctionsgetInstanceZorba * getInstance(void *store) Gets the singleton instance of the Zorba object. The Zorba object provides factory methods for creating and/or compiling XQuery objects, creating StaticContext objects, and accessing components as, for example, the ItemFactory or the XmlDataManager.The first time this function is called, the Zorba Engine is initialized. Thereby, it initializes all the libraries that are used in the system, i.e. ICU, libxml2, xerces, and libcurl. Public FunctionscompileQueryXQuery_t compileQuery(const String &aQuery, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object. This methods creates an XQuery object and compiles the query string passed to this method.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(const String &aQuery, const StaticContext_t &aContext, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object using a StaticContext. This methods creates an XQuery object and compiles the query string passed to this method. Compilation is done using the information contained in the StaticContext that is passed as parameter.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(const String &aQuery, const Zorba_CompilerHints_t &aCompilerHints, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object using the given CompilerHints. This methods creates an XQuery object and compiles the query string passed to this method. Compilation and optimization is done with respect to the given CompilerHints.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(const String &aQuery, const StaticContext_t &aContext, const Zorba_CompilerHints_t &aCompilerHints, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object using the given CompilerHints and StaticContext. This methods creates an XQuery object and compiles the query string passed to this method. Compilation and optimization is done with respect to the given CompilerHints. Moreover, compilation is done using the information contained in the StaticContext.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(std::istream &aQuery, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object. This methods creates an XQuery object and compiles the query that is passed to this method as an input stream.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(std::istream &aQuery, const StaticContext_t &aContext, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object using a StaticContext. This methods creates an XQuery object and compiles the query that is passed to this method as an input stream. Compilation is done using the information contained in the StaticContext that is passed as parameter.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(std::istream &aQuery, const Zorba_CompilerHints_t &aCompilerHints, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object using the given CompilerHints. This methods creates an XQuery object and compiles the query that is passed to this method as an input stream. Compilation and optimization is done with respect to the given CompilerHints.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
compileQueryXQuery_t compileQuery(std::istream &aQuery, const StaticContext_t &aContext, const Zorba_CompilerHints_t &aCompilerHints, DiagnosticHandler *aDiagnosticHandler=0)=0 Creates and compiles an XQuery object using the given CompilerHints and StaticContext. This methods creates an XQuery object and compiles the query that is passed to this method as an input stream. Compilation and optimization is done with respect to the given CompilerHints. Moreover, compilation is done using the information contained in the StaticContext.Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
createQueryXQuery_t createQuery(DiagnosticHandler *aDiagnosticHandler=0)=0 Creates an XQuery object. This methods creates an XQuery object without implicitliy assigning it a query. An object returned by this method can be compiled (see compileQuery).Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during compiling or executing the query, is reported to the passed error handler. If no DiagnosticHandler is given, exceptions are thrown for each of these errors. Parameters
createStaticContextStaticContext_t createStaticContext(DiagnosticHandler *aDiagnosticHandler=0)=0 Creates a new StaticContext. The method returns a smart pointer to a new StaticContext object that can be used for compiling a query. Parameters
ReturnsStaticContext_t a smart pointer to a new StaticContext object.getAuditProvideraudit::Provider * getAuditProvider()=0 Gets the singleton instance of Zorba's audit provider object.
getPropertiesGlobalPropertiesGlobal * getPropertiesGlobal()=0 getXmlDataManagerXmlDataManager_t getXmlDataManager()=0 shutdownvoid shutdown()=0 Releases all resources aquired by the Zorba XQuery Engine. Also releases resources aquired by the libraries used (i.e. icu, libxml2, xerces, libcurl).Before calling shutdown, all xquery objects, items, contexts, ... have to be closed or gone out of scope; otherwise this call may fail.After shutdown has been called, any calls to zorba are invalid.getInstance may be used to reinitialize the engine. ~Zorba ~Zorba() Destructor. The destructor is called during static deinitialization if getInstance has been called at least once before. |