Qt 4.8
|
Responsible for loading and declaring available external variables. More...
#include <qexternalvariableloader_p.h>
Public Types | |
typedef QExplicitlySharedDataPointer< ExternalVariableLoader > | Ptr |
Public Functions | |
virtual SequenceType::Ptr | announceExternalVariable (const QXmlName name, const SequenceType::Ptr &declaredType) |
virtual bool | evaluateEBV (const QXmlName name, const QExplicitlySharedDataPointer< DynamicContext > &context) |
virtual Item::Iterator::Ptr | evaluateSequence (const QXmlName name, const QExplicitlySharedDataPointer< DynamicContext > &context) |
virtual Item | evaluateSingleton (const QXmlName name, const QExplicitlySharedDataPointer< DynamicContext > &context) |
ExternalVariableLoader () | |
virtual | ~ExternalVariableLoader () |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Responsible for loading and declaring available external variables.
An external variable in XQuery is a global variable that has been declared to receive its value from the XQuery implementation, as opposed to an initializing expression. Here is an example of a query with an external variable declaration, followed by a ordinary global variable:
declare variable $theName external; declare variable $theName := "the value"; "And here's the query body(a string literal)"
An external variable declaration can also specify a sequence type:
declare variable $theName as xs:integer external;
This class allows the user to supply the values to external variables. When an external variable declaration occur in the query, announceExternalVariable() is called.
Definition at line 90 of file qexternalvariableloader_p.h.
typedef QExplicitlySharedDataPointer<ExternalVariableLoader> QPatternist::ExternalVariableLoader::Ptr |
Definition at line 93 of file qexternalvariableloader_p.h.
|
inline |
Definition at line 94 of file qexternalvariableloader_p.h.
|
virtual |
Definition at line 52 of file qexternalvariableloader.cpp.
|
virtual |
Called when Patternist encounters an external variable in the query. It is guaranteed to be called once for each external variable appearing in a query module.
name | the name of the variable. Quaranteed to never be null . |
declaredType | the type that the user declared the variable to be of. Whether this type matches the actual value of the variable or not is irrelevant. Patternist will do the necessary error handling based on the sequence type that is returned from this function. If the user didn't declare a type, the type is item()* (zero or more items). Quaranteed to never be null . |
null
should be returned. Reimplemented in QPatternist::VariableLoader.
Definition at line 57 of file qexternalvariableloader.cpp.
|
virtual |
Definition at line 87 of file qexternalvariableloader.cpp.
Referenced by QPatternist::ExternalVariableReference::evaluateEBV(), and evaluateSingleton().
|
virtual |
This function is called at runtime when the external variable by name name
needs to be evaluated. It is not defined how many times this function will be called. It depends on aspects such as how the query was optimized.
name | the name of the variable. Quaranteed to never be null . |
context | the DynamicContext. |
Definition at line 68 of file qexternalvariableloader.cpp.
Referenced by evaluateEBV(), and QPatternist::ExternalVariableReference::evaluateSequence().
|
virtual |
Definition at line 80 of file qexternalvariableloader.cpp.
Referenced by evaluateSequence(), and QPatternist::ExternalVariableReference::evaluateSingleton().