#ifndef ARABICA_XPATH_EXECUTION_CONTEXT_HPP #define ARABICA_XPATH_EXECUTION_CONTEXT_HPP #include #include "xpath_variable_resolver.hpp" #include "xpath_resolver_holder.hpp" namespace Arabica { namespace XPath { template > class ExecutionContext { public: ExecutionContext() : position_(-1), last_(-1) { } // ExecutionContext ExecutionContext(size_t last, const ExecutionContext& parent) : current_(parent.current_), position_(-1), last_(static_cast(last)), variableResolver_(parent.variableResolver_) { } // ExecutionContext const DOM::Node& currentNode() const { return current_; } int position() const { return position_; } int last() const { return last_; } void setCurrentNode(const DOM::Node& current) { current_ = current; } void setPosition(int pos) { position_ = pos; } void setLast(int last) { last_ = last; } const VariableResolver& variableResolver() const { return variableResolver_.get(); } void setVariableResolver(const VariableResolver& resolver) { variableResolver_.set(resolver); } void setVariableResolver(VariableResolverPtr& resolver) { variableResolver_.set(resolver); } private: DOM::Node current_; int position_; int last_; impl::ResolverHolder > variableResolver_; ExecutionContext(const ExecutionContext&); ExecutionContext& operator=(const ExecutionContext&); bool operator==(const ExecutionContext&) const; }; // class ExecutionContext } // namespace XPath } // namespace Arabica #endif