00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _VARIABLESTORE_HPP
00015 #define _VARIABLESTORE_HPP
00016
00017 #include <xqilla/framework/XQillaExport.hpp>
00018 #include <xercesc/util/XercesDefs.hpp>
00019 #include <vector>
00020 #include <xercesc/util/XMemory.hpp>
00021
00022 class Sequence;
00023 template<class TYPE> class VarHashEntry;
00024 template<class TYPE> class Scope;
00025 class StaticContext;
00026 class XPath2MemoryManager;
00027 class LocationInfo;
00028
00031 class XQILLA_API VariableStore : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
00032 {
00033 public:
00034 typedef Scope<Sequence> MyScope;
00035 typedef VarHashEntry<Sequence> Entry;
00036
00038 virtual ~VariableStore() {};
00039
00041 virtual void clear() = 0;
00042
00044 virtual void addLocalScope() = 0;
00046 virtual void addLogicalBlockScope() = 0;
00049 virtual void removeScope() = 0;
00050
00052 virtual MyScope *getScopeState() = 0;
00054 virtual void setScopeState(MyScope *state) = 0;
00055
00057 virtual void setGlobalVar(const XMLCh* ident, const Sequence &value,
00058 const StaticContext* context,
00059 const LocationInfo *location) = 0;
00060 virtual void setGlobalVar(const XMLCh* namespaceURI, const XMLCh* name, const Sequence &value,
00061 const StaticContext* context) = 0;
00062
00064 virtual void setVar(const XMLCh* ident, const Sequence &value,
00065 const StaticContext* context,
00066 const LocationInfo *location) = 0;
00067 virtual void setVar(const XMLCh* namespaceURI, const XMLCh* name, const Sequence &value,
00068 const StaticContext* context) = 0;
00069
00072 virtual void declareVar(const XMLCh* ident,
00073 const Sequence &value,
00074 const StaticContext* context,
00075 const LocationInfo *location) = 0;
00076 virtual void declareVar(const XMLCh* namespaceURI,
00077 const XMLCh* name,
00078 const Sequence &value,
00079 const StaticContext* context) = 0;
00080
00084 virtual const std::pair<bool, Sequence> getVar(const XMLCh* ident,
00085 const StaticContext* context,
00086 const LocationInfo *location) const = 0;
00087 virtual const std::pair<bool, Sequence> getVar(const XMLCh* namespaceURI,
00088 const XMLCh* name,
00089 const StaticContext* context) const = 0;
00090
00094 virtual Entry* getReferenceVar(const XMLCh* ident,
00095 const StaticContext* context,
00096 const LocationInfo *location) const = 0;
00097 virtual Entry* getReferenceVar(const XMLCh* namespaceURI,
00098 const XMLCh* name,
00099 const StaticContext* context) const = 0;
00100
00102 virtual const std::pair<bool, Sequence> getGlobalVar(const XMLCh* ident,
00103 const StaticContext* context,
00104 const LocationInfo *location) const = 0;
00105 virtual const std::pair<bool, Sequence> getGlobalVar(const XMLCh* namespaceURI,
00106 const XMLCh* name,
00107 const StaticContext* context) const = 0;
00108
00110 virtual void delVar(const XMLCh* ident, const StaticContext* context,
00111 const LocationInfo *location) = 0;
00112 virtual void delVar(const XMLCh* namespaceURI, const XMLCh* name, const StaticContext* context) = 0;
00113
00115 virtual void delGlobalVar(const XMLCh* ident, const StaticContext* context,
00116 const LocationInfo *location) = 0;
00117
00119 virtual XMLCh* print(XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* memMgr) const = 0;
00120
00122 virtual std::vector< std::pair<const XMLCh*, const XMLCh*> > getVars() const = 0;
00123 };
00124
00125 #endif