SourceForge.net Logo
DynamicContext.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2001, 2008,
3 * DecisionSoft Limited. All rights reserved.
4 * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved.
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef _DYNAMICCONTEXT_HPP
21#define _DYNAMICCONTEXT_HPP
22
25
26class Sequence;
27class Result;
28class Item;
29class URIResolver;
30class VariableStore;
31class SequenceBuilder;
32class UpdateFactory;
33class RegexGroupStore;
34class DebugListener;
35class StackFrame;
36
38class XQILLA_API DynamicContext : public StaticContext
39{
40public:
41 virtual ~DynamicContext() {};
42
43 virtual DynamicContext *createModuleDynamicContext(const DynamicContext* moduleCtx, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
44 XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager) const = 0;
45
47 virtual void clearDynamicContext() = 0;
48
50 virtual Item::Ptr getContextItem() const = 0;
52 virtual void setContextItem(const Item::Ptr &item) = 0;
53
55 virtual size_t getContextPosition() const = 0;
57 virtual void setContextPosition(size_t pos) = 0;
58
60 virtual size_t getContextSize() const = 0;
62 virtual void setContextSize(size_t size) = 0;
63
65 virtual const VariableStore* getVariableStore() const = 0;
67 virtual void setVariableStore(const VariableStore *store) = 0;
69 virtual const VariableStore* getGlobalVariableStore() const = 0;
71 virtual void setGlobalVariableStore(const VariableStore *store) = 0;
73 virtual void setExternalVariable(const XMLCh *namespaceURI, const XMLCh *name, const Result &value) = 0;
75 virtual void setExternalVariable(const XMLCh *qname, const Result &value) = 0;
76
78 virtual const RegexGroupStore* getRegexGroupStore() const = 0;
80 virtual void setRegexGroupStore(const RegexGroupStore *store) = 0;
81
83 virtual time_t getCurrentTime() const = 0;
85 virtual void setCurrentTime(time_t newTime) = 0;
86
90 virtual void setImplicitTimezone(const ATDurationOrDerived::Ptr &timezoneAsDuration) = 0;
91
93 // XQilla context specific accessors //
95
108 virtual void registerURIResolver(URIResolver *resolver, bool adopt) = 0;
110 virtual URIResolver *getDefaultURIResolver() const = 0;
112 virtual void setDefaultURIResolver(URIResolver *resolver, bool adopt) = 0;
113
115 virtual void setDebugListener(DebugListener *listener) = 0;
117 virtual DebugListener *getDebugListener() const = 0;
118
120 virtual void setStackFrame(const StackFrame *frame) = 0;
122 virtual const StackFrame *getStackFrame() const = 0;
123
125 virtual Node::Ptr parseDocument(XERCES_CPP_NAMESPACE_QUALIFIER InputSource &srcToUse,
126 const LocationInfo *location = 0, const QueryPathNode *projection = 0) = 0;
129 virtual Sequence resolveDocument(const XMLCh* uri, const LocationInfo *location = 0,
130 const QueryPathNode *projection = 0) = 0;
133 virtual Sequence resolveCollection(const XMLCh* uri, const LocationInfo *location = 0,
134 const QueryPathNode *projection = 0) = 0;
136 virtual Sequence resolveDefaultCollection(const QueryPathNode *projection = 0) = 0;
137
140 virtual bool putDocument(const Node::Ptr &document, const XMLCh *uri) = 0;
141
145
148 virtual UpdateFactory *createUpdateFactory() const = 0;
149
151 virtual void testInterrupt() const = 0;
152};
153
154#endif
RefCountPointer< const ATDurationOrDerived > Ptr
Definition ATDurationOrDerived.hpp:35
A class used to listen for debugging information.
Definition DebugListener.hpp:34
The execution time dynamic context interface.
Definition DynamicContext.hpp:39
virtual void setStackFrame(const StackFrame *frame)=0
Sets the current stack frame whilst debugging.
virtual Sequence resolveDefaultCollection(const QueryPathNode *projection=0)=0
Resolve the default collection to a sequence of Node objects.
virtual Sequence resolveDocument(const XMLCh *uri, const LocationInfo *location=0, const QueryPathNode *projection=0)=0
Resolve the given uri (and baseUri) to an XML document.
virtual ATDurationOrDerived::Ptr getImplicitTimezone() const =0
Return the implicit timezone for this system.
virtual Sequence resolveCollection(const XMLCh *uri, const LocationInfo *location=0, const QueryPathNode *projection=0)=0
Resolve the given uri (and baseUri) to a sequence of Node objects.
virtual ~DynamicContext()
Definition DynamicContext.hpp:41
virtual void setGlobalVariableStore(const VariableStore *store)=0
set the variable store for globally scoped variables
virtual size_t getContextPosition() const =0
Get the context position.
virtual SequenceBuilder * createSequenceBuilder() const =0
Create a new SequenceBuilder, which is used to turn a stream of events into a Sequence.
virtual void setRegexGroupStore(const RegexGroupStore *store)=0
set the regex group store
virtual bool putDocument(const Node::Ptr &document, const XMLCh *uri)=0
Attempts to put the document specified to the given URI by calling the registered URIResolver objects...
virtual void setContextPosition(size_t pos)=0
Set the context position.
virtual void setContextSize(size_t size)=0
Set the context size.
virtual void setExternalVariable(const XMLCh *qname, const Result &value)=0
set the value of an external global variable with the given QName
virtual void setVariableStore(const VariableStore *store)=0
set the variable store
virtual void setDefaultURIResolver(URIResolver *resolver, bool adopt)=0
Sets the default URIResolver.
virtual const VariableStore * getGlobalVariableStore() const =0
get the variable store for globally scoped variables
virtual void setCurrentTime(time_t newTime)=0
Set the current time.
virtual const RegexGroupStore * getRegexGroupStore() const =0
get the regex group store
virtual URIResolver * getDefaultURIResolver() const =0
Returns the default URIResolver.
virtual void setContextItem(const Item::Ptr &item)=0
Set the context item to item.
virtual const StackFrame * getStackFrame() const =0
Gets the listener for debug messages.
virtual Node::Ptr parseDocument(xercesc::InputSource &srcToUse, const LocationInfo *location=0, const QueryPathNode *projection=0)=0
Parse an XML document from the provided InputSource.
virtual size_t getContextSize() const =0
Get the context size.
virtual time_t getCurrentTime() const =0
Return the current time.
virtual void setExternalVariable(const XMLCh *namespaceURI, const XMLCh *name, const Result &value)=0
set the value of an external global variable with the given uri/localname pair
virtual Item::Ptr getContextItem() const =0
Get the context Item.
virtual void setDebugListener(DebugListener *listener)=0
Set the listener for debug messages.
virtual DynamicContext * createModuleDynamicContext(const DynamicContext *moduleCtx, xercesc::MemoryManager *memMgr=xercesc::XMLPlatformUtils::fgMemoryManager) const =0
virtual void setImplicitTimezone(const ATDurationOrDerived::Ptr &timezoneAsDuration)=0
Set the implicit timezone.
virtual void testInterrupt() const =0
Test if the query should be interrupted, and throw if so.
virtual void registerURIResolver(URIResolver *resolver, bool adopt)=0
Register a callback object for resolving URIs.
virtual void clearDynamicContext()=0
Resets the dynamic context, as if it had never been used.
virtual const VariableStore * getVariableStore() const =0
get the variable store
virtual UpdateFactory * createUpdateFactory() const =0
Creates a new UpdateFactory, used for performing updates.
virtual DebugListener * getDebugListener() const =0
Gets the listener for debug messages.
Definition Item.hpp:37
RefCountPointer< const Item > Ptr
Definition Item.hpp:39
A class that gives records a location in the query.
Definition LocationInfo.hpp:30
RefCountPointer< const Node > Ptr
Definition Node.hpp:36
The pure virtual base class for accessing regular expression group values at runtime.
Definition RegexGroupStore.hpp:31
A scoped pointer wrapper for the lazily evaluated query result.
Definition Result.hpp:38
Definition SequenceBuilder.hpp:32
An eagerly evaluated result of a query execution.
Definition Sequence.hpp:40
A class that represents an item in a query call stack.
Definition StackFrame.hpp:46
The parse time static context interface.
Definition StaticContext.hpp:58
This is an abstract class used to resolve URIs in different ways.
Definition URIResolver.hpp:38
Definition UpdateFactory.hpp:33
The pure virtual base class for accessing variables at runtime.
Definition VariableStore.hpp:32