Public Member Functions | Static Public Member Functions
zorba::Zorba Class Reference

The Zorba class is the single point of access to the Zorba engine. More...

#include <zorba/zorba.h>

List of all members.

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::ProvidergetAuditProvider ()=0
 Gets the singleton instance of Zorba's audit provider object.
virtual ItemFactorygetItemFactory ()=0
 Gets the singelton instance of the ItemFactory.
virtual XmlDataManagergetXmlDataManager ()=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 ZorbagetInstance (void *store)
 Gets the singleton instance of the Zorba object.
static const Versionversion ()
 Get information about the used version of Zorba.

Detailed Description

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.

Examples:

context.cpp, datamanager.cpp, errors.cpp, external_functions.cpp, sax2.cpp, serialization.cpp, and simple.cpp.

Definition at line 46 of file zorba.h.


Constructor & Destructor Documentation

virtual zorba::Zorba::~Zorba ( ) [virtual]

Destructor.

The destructor is called during static deinitialization if getInstance has been called at least once before.


Member Function Documentation

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.

Parameters:
aQuerythe query string for the new XQuery object.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
Examples:
context.cpp, datamanager.cpp, errors.cpp, external_functions.cpp, sax2.cpp, serialization.cpp, and simple.cpp.
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.

Parameters:
aQuerythe query string for the new XQuery object.
aContextthe StaticContext that contains information used for compiling the query.
aCompilerHintsthe CompilerHints used to compile the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aQuerythe input stream providing the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aQuerythe input stream providing the query.
aContextthe StaticContext that contains information used for compiling the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aQuerythe input stream providing the query.
aCompilerHintsthe CompilerHints used to compile the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aQuerythe query string for the new XQuery object.
aContextthe StaticContext that contains information used for compiling the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aQuerythe input stream providing the query.
aContextthe StaticContext that contains information used for compiling the query.
aCompilerHintsthe CompilerHints used to compile the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aQuerythe query string for the new XQuery object.
aCompilerHintsthe CompilerHints used to compile the query.
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created and compiled XQuery object.
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.

Parameters:
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
XQuery the newly created XQuery object.
Examples:
simple.cpp.
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.

Parameters:
aDiagnosticHandlerthe DiagnosticHandler to which errors should be reported.
Returns:
StaticContext_t a new StaticContext object.
Examples:
context.cpp, errors.cpp, external_functions.cpp, and simple.cpp.
virtual audit::Provider* zorba::Zorba::getAuditProvider ( ) [pure virtual]

Gets the singleton instance of Zorba's audit provider object.

Returns:
audit::Provider the singelton instance of Zorba's audit provider.
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.

Returns:
Zorba the singleton Zorba object
Examples:
context.cpp, datamanager.cpp, errors.cpp, external_functions.cpp, sax2.cpp, serialization.cpp, and simple.cpp.
virtual ItemFactory* zorba::Zorba::getItemFactory ( ) [pure virtual]

Gets the singelton instance of the ItemFactory.

Returns:
ItemFactory the singleton instance of the ItemFactory.
Examples:
context.cpp, datamanager.cpp, errors.cpp, and simple.cpp.
virtual XmlDataManager* zorba::Zorba::getXmlDataManager ( ) [pure virtual]

Gets the singleton instance of the XmlDataManager object.

Returns:
XmlDataManager the singelton instance of the XmlDataManager.
Examples:
context.cpp, datamanager.cpp, and simple.cpp.
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.

Examples:
context.cpp, datamanager.cpp, errors.cpp, external_functions.cpp, sax2.cpp, serialization.cpp, and simple.cpp.
static const Version& zorba::Zorba::version ( ) [static]

Get information about the used version of Zorba.

Returns:
Version information about the used Zorba version.
Examples:
simple.cpp.

The documentation for this class was generated from the following file:
blog comments powered by Disqus