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, 2018 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 
26 class Sequence;
27 class Result;
28 class Item;
29 class URIResolver;
30 class VariableStore;
31 class SequenceBuilder;
32 class UpdateFactory;
33 class RegexGroupStore;
34 class DebugListener;
35 class StackFrame;
36 
38 class XQILLA_API DynamicContext : public StaticContext
39 {
40 public:
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 
88  virtual ATDurationOrDerived::Ptr getImplicitTimezone() const = 0;
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 
144  virtual SequenceBuilder *createSequenceBuilder() const = 0;
145 
148  virtual UpdateFactory *createUpdateFactory() const = 0;
149 
151  virtual void testInterrupt() const = 0;
152 };
153 
154 #endif
virtual ~DynamicContext()
Definition: DynamicContext.hpp:41
This is an abstract class used to resolve URIs in different ways.
Definition: URIResolver.hpp:37
A class that represents an item in a query call stack.
Definition: StackFrame.hpp:45
Definition: SequenceBuilder.hpp:31
The parse time static context interface.
Definition: StaticContext.hpp:57
A scoped pointer wrapper for the lazily evaluated query result.
Definition: Result.hpp:37
A class used to listen for debugging information.
Definition: DebugListener.hpp:34
Definition: UpdateFactory.hpp:32
Definition: Item.hpp:36
The execution time dynamic context interface.
Definition: DynamicContext.hpp:38
The pure virtual base class for accessing regular expression group values at runtime.
Definition: RegexGroupStore.hpp:30
The pure virtual base class for accessing variables at runtime.
Definition: VariableStore.hpp:31
A class that gives records a location in the query.
Definition: LocationInfo.hpp:29
An eagerly evaluated result of a query execution.
Definition: Sequence.hpp:39