SourceForge.net Logo

DynamicContext.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001, 2008,
00003  *     DecisionSoft Limited. All rights reserved.
00004  * Copyright (c) 2004, 2011,
00005  *     Oracle and/or its affiliates. All rights reserved.
00006  *
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  *
00011  *     http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  */
00019 
00020 #ifndef _DYNAMICCONTEXT_HPP
00021 #define _DYNAMICCONTEXT_HPP
00022 
00023 #include <xqilla/context/StaticContext.hpp>
00024 #include <xqilla/items/ATDurationOrDerived.hpp>
00025 
00026 class Sequence;
00027 class Result;
00028 class Item;
00029 class URIResolver;
00030 class VariableStore;
00031 class SequenceBuilder;
00032 class UpdateFactory;
00033 class RegexGroupStore;
00034 class DebugListener;
00035 class StackFrame;
00036 
00038 class XQILLA_API DynamicContext : public StaticContext
00039 {
00040 public:
00041   virtual ~DynamicContext() {};
00042 
00043   virtual DynamicContext *createModuleDynamicContext(const DynamicContext* moduleCtx, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager *memMgr =
00044                                                      XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::fgMemoryManager) const = 0;
00045 
00047   virtual void clearDynamicContext() = 0;
00048 
00050   virtual Item::Ptr getContextItem() const = 0;
00052   virtual void setContextItem(const Item::Ptr &item) = 0;
00053 
00055   virtual size_t getContextPosition() const = 0;
00057   virtual void setContextPosition(size_t pos) = 0;
00058 
00060   virtual size_t getContextSize() const = 0;
00062   virtual void setContextSize(size_t size) = 0;
00063   
00065   virtual const VariableStore* getVariableStore() const = 0;
00067   virtual void setVariableStore(const VariableStore *store) = 0;
00069   virtual const VariableStore* getGlobalVariableStore() const = 0;
00071   virtual void setGlobalVariableStore(const VariableStore *store) = 0;
00073   virtual void setExternalVariable(const XMLCh *namespaceURI, const XMLCh *name, const Result &value) = 0;
00075   virtual void setExternalVariable(const XMLCh *qname, const Result &value) = 0;
00076 
00078   virtual const RegexGroupStore* getRegexGroupStore() const = 0;
00080   virtual void setRegexGroupStore(const RegexGroupStore *store) = 0;
00081 
00083   virtual time_t getCurrentTime() const = 0;
00085   virtual void setCurrentTime(time_t newTime) = 0;
00086 
00088   virtual ATDurationOrDerived::Ptr getImplicitTimezone() const = 0;
00090   virtual void setImplicitTimezone(const ATDurationOrDerived::Ptr &timezoneAsDuration) = 0;
00091 
00093   //  XQilla context specific accessors  //
00095 
00108   virtual void registerURIResolver(URIResolver *resolver, bool adopt) = 0;
00110   virtual URIResolver *getDefaultURIResolver() const = 0;
00112   virtual void setDefaultURIResolver(URIResolver *resolver, bool adopt) = 0;
00113 
00115   virtual void setDebugListener(DebugListener *listener) = 0;
00117   virtual DebugListener *getDebugListener() const = 0;
00118 
00120   virtual void setStackFrame(const StackFrame *frame) = 0;
00122   virtual const StackFrame *getStackFrame() const = 0;
00123 
00125   virtual Node::Ptr parseDocument(XERCES_CPP_NAMESPACE_QUALIFIER InputSource &srcToUse,
00126                                   const LocationInfo *location = 0, const QueryPathNode *projection = 0) = 0;
00129   virtual Sequence resolveDocument(const XMLCh* uri, const LocationInfo *location = 0,
00130                                    const QueryPathNode *projection = 0) = 0;
00133   virtual Sequence resolveCollection(const XMLCh* uri, const LocationInfo *location = 0,
00134                                      const QueryPathNode *projection = 0) = 0;
00136   virtual Sequence resolveDefaultCollection(const QueryPathNode *projection = 0) = 0;
00137 
00140   virtual bool putDocument(const Node::Ptr &document, const XMLCh *uri) = 0;
00141 
00144   virtual SequenceBuilder *createSequenceBuilder() const = 0;
00145 
00148   virtual UpdateFactory *createUpdateFactory() const = 0;
00149 
00151   virtual void testInterrupt() const = 0;
00152 };
00153 
00154 #endif