The Zorba class is the single point of access to the Zorba engine. More...
#include <zorba/zorba.h>
Public Member Functions | |
virtual XQuery_t | compileQuery (const String &aQuery, DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates and compiles an XQuery object. | |
virtual XQuery_t | compileQuery (const String &aQuery, const StaticContext_t &aContext, DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates and compiles an XQuery object using a StaticContext. | |
virtual XQuery_t | compileQuery (std::istream &aQuery, DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates and compiles an XQuery object. | |
virtual XQuery_t | compileQuery (std::istream &aQuery, const StaticContext_t &aContext, DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates and compiles an XQuery object using a StaticContext. | |
virtual XQuery_t | compileQuery (std::istream &aQuery, const Zorba_CompilerHints_t &aCompilerHints, DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates and compiles an XQuery object using the given CompilerHints. | |
virtual XQuery_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. | |
virtual XQuery_t | compileQuery (const String &aQuery, const Zorba_CompilerHints_t &aCompilerHints, DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates and compiles an XQuery object using the given CompilerHints. | |
virtual XQuery_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. | |
virtual XQuery_t | createQuery (DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates an XQuery object. | |
virtual StaticContext_t | createStaticContext (DiagnosticHandler *aDiagnosticHandler=0)=0 |
Creates a new StaticContext. | |
virtual audit::Provider * | getAuditProvider ()=0 |
Gets the singleton instance of Zorba's audit provider object. | |
virtual ItemFactory * | getItemFactory ()=0 |
Gets the singelton instance of the ItemFactory. | |
virtual XmlDataManager * | getXmlDataManager ()=0 |
Gets the singleton instance of the XmlDataManager object. | |
virtual void | shutdown ()=0 |
Releases all resources aquired by the Zorba XQuery Engine. | |
virtual | ~Zorba () |
Destructor. | |
Static Public Member Functions | |
static Zorba * | getInstance (void *store) |
Gets the singleton instance of the Zorba object. | |
static const Version & | version () |
Get information about the used version of Zorba. |
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, and (4) provides access to the ItemFactory.
context.cpp, datamanager.cpp, errors.cpp, external_functions.cpp, sax2.cpp, serialization.cpp, and simple.cpp.
virtual zorba::Zorba::~Zorba | ( | ) | [virtual] |
Destructor.
The destructor is called during static deinitialization if getInstance has been called at least once before.
virtual XQuery_t zorba::Zorba::compileQuery | ( | const String & | aQuery, |
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the query string for the new XQuery object. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | const String & | aQuery, |
const StaticContext_t & | aContext, | ||
const Zorba_CompilerHints_t & | aCompilerHints, | ||
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the query string for the new XQuery object. |
aContext | the StaticContext that contains information used for compiling the query. |
aCompilerHints | the CompilerHints used to compile the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | std::istream & | aQuery, |
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the input stream providing the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | std::istream & | aQuery, |
const StaticContext_t & | aContext, | ||
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the input stream providing the query. |
aContext | the StaticContext that contains information used for compiling the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | std::istream & | aQuery, |
const Zorba_CompilerHints_t & | aCompilerHints, | ||
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the input stream providing the query. |
aCompilerHints | the CompilerHints used to compile the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | const String & | aQuery, |
const StaticContext_t & | aContext, | ||
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the query string for the new XQuery object. |
aContext | the StaticContext that contains information used for compiling the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | std::istream & | aQuery, |
const StaticContext_t & | aContext, | ||
const Zorba_CompilerHints_t & | aCompilerHints, | ||
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the input stream providing the query. |
aContext | the StaticContext that contains information used for compiling the query. |
aCompilerHints | the CompilerHints used to compile the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::compileQuery | ( | const String & | aQuery, |
const Zorba_CompilerHints_t & | aCompilerHints, | ||
DiagnosticHandler * | aDiagnosticHandler = 0 |
||
) | [pure virtual] |
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.
aQuery | the query string for the new XQuery object. |
aCompilerHints | the CompilerHints used to compile the query. |
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual XQuery_t zorba::Zorba::createQuery | ( | DiagnosticHandler * | aDiagnosticHandler = 0 | ) | [pure virtual] |
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.
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual StaticContext_t zorba::Zorba::createStaticContext | ( | DiagnosticHandler * | aDiagnosticHandler = 0 | ) | [pure virtual] |
Creates a new StaticContext.
The method returns a StaticContext object that can be used for compiling a query. Instances of the StaticContext class are returned as a smart pointer. That is, objects of type StaticContext_t are reference counted object to an dynamically allocated StaticContext object. Hence, each object can h have multiple owners. The object is deleted if nobody holds on to an StaticContext_t object anymore.
Optionally, this method takes an DiagnosticHandler as parameter. In the case an DiagnosticHandler is passed as parameter, each error that occurs during setting or getting information out of the StaticContext, is reported to the passed DiagnosticHandler. If not DiagnosticHandler is given, exceptions are thrown for each of these errors.
aDiagnosticHandler | the DiagnosticHandler to which errors should be reported. |
virtual audit::Provider* zorba::Zorba::getAuditProvider | ( | ) | [pure virtual] |
Gets the singleton instance of Zorba's audit provider object.
static Zorba* zorba::Zorba::getInstance | ( | void * | store | ) | [static] |
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.
virtual ItemFactory* zorba::Zorba::getItemFactory | ( | ) | [pure virtual] |
Gets the singelton instance of the ItemFactory.
virtual XmlDataManager* zorba::Zorba::getXmlDataManager | ( | ) | [pure virtual] |
Gets the singleton instance of the XmlDataManager object.
virtual void zorba::Zorba::shutdown | ( | ) | [pure virtual] |
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.
static const Version& zorba::Zorba::version | ( | ) | [static] |
Get information about the used version of Zorba.