# DynamicContext.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright (c) 2001-2006
    00003  *     DecisionSoft Limited. All rights reserved.
    00004  * Copyright (c) 2004-2006
    00005  *     Progress Software Corporation. All rights reserved.
    00006  * Copyright (c) 2004-2006
    00007  *     Oracle. All rights reserved.
    00008  *
    00009  * See the file LICENSE for redistribution information.
    00010  *
    00011  * $Id: DynamicContext.hpp,v 1.15 2006/11/01 16:37:11 jpcs Exp $
    00012  */
    00013
    00014 #ifndef _DYNAMICCONTEXT_HPP
    00015 #define _DYNAMICCONTEXT_HPP
    00016
    00017 #include <xqilla/context/StaticContext.hpp>
    00018 #include <xqilla/context/XQDebugCallback.hpp>
    00019 #include <xqilla/items/ATDurationOrDerived.hpp>
    00020
    00021 class Sequence;
    00022 class Item;
    00023 class URIResolver;
    00024 class VariableStore;
    00025 class ItemFactory;
    00026
    00028 class XQILLA_API DynamicContext : public StaticContext
    00029 {
    00030 public:
    00031   virtual ~DynamicContext() {};
    00032
    00034   virtual void incrementDocumentRefCount(const XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* document) const = 0;
    00036   virtual void decrementDocumentRefCount(const XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* document) const = 0;
    00037
    00039   virtual void clearDynamicContext() = 0;
    00040
    00042   virtual Item::Ptr getContextItem() const = 0;
    00044   virtual void setContextItem(const Item::Ptr &item) = 0;
    00048   virtual void setExternalContextNode(const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node) = 0;
    00049
    00051   virtual unsigned int getContextPosition() const = 0;
    00053   virtual void setContextPosition(unsigned int pos) = 0;
    00054
    00056   virtual unsigned int getContextSize() const = 0;
    00058   virtual void setContextSize(unsigned int size) = 0;
    00059
    00061   virtual VariableStore* getVariableStore() = 0;
    00062
    00064   virtual time_t getCurrentTime() const = 0;
    00066   virtual void setCurrentTime(time_t newTime) = 0;
    00067
    00069   virtual ATDurationOrDerived::Ptr getImplicitTimezone() const = 0;
    00071   virtual void setImplicitTimezone(const ATDurationOrDerived::Ptr &timezoneAsDuration) = 0;
    00072
    00085   virtual void registerURIResolver(URIResolver *resolver) = 0;
    00086   /* Resolve the given uri (and baseUri) to a DOMDocument. If the uri
    00087      is relative, the base uri is obtained from the context. */
    00088   virtual Sequence resolveDocument(const XMLCh* uri, const LocationInfo *location) = 0;
    00089   /* Resolve the given uri (and baseUri) to a ist of DOMNode objects. If the uri
    00090      is relative, the base uri is obtained from the context. */
    00091   virtual Sequence resolveCollection(const XMLCh* uri, const LocationInfo *location) = 0;
    00092   virtual Sequence resolveDefaultCollection() = 0;
    00094   virtual Node::Ptr validate(const Node::Ptr &node, DocumentCache::ValidationMode valMode) = 0;
    00095
    00097   virtual void trace(const XMLCh* message1, const XMLCh* message2) = 0;
    00098
    00100   virtual void setDebugCallback(XQDebugCallback* callback) = 0;
    00102   virtual XQDebugCallback* getDebugCallback() const = 0;
    00103
    00108   virtual void testInterrupt() const {}
    00109 };
    00110
    00111 #endif