#ifndef ARABICA_XPATH_VARIABLE_COMPILE_TIME_RESOLVER_HPP #define ARABICA_XPATH_VARIABLE_COMPILE_TIME_RESOLVER_HPP #include "xpath_variable.hpp" namespace Arabica { namespace XPath { template > class VariableCompileTimeResolver { public: virtual ~VariableCompileTimeResolver() { } virtual XPathExpression_impl* compileVariable(const string_type& namespace_uri, const string_type& name) const = 0; }; // class VariableCompileTimeResolver template class VariableCompileTimeResolverPtr : public boost::shared_ptr > { public: explicit VariableCompileTimeResolverPtr(VariableCompileTimeResolver* vr) : boost::shared_ptr >(vr) { } // VariableCompileTimeResolverPtr }; // class VariableCompileTimeResolverPtr template > class DefaultVariableCompileTimeResolver : public VariableCompileTimeResolver { public: virtual XPathExpression_impl* compileVariable(const string_type& namespace_uri, const string_type& name) const { return new Variable(namespace_uri, name); } // compileVariable }; // DefaultVariableCompileTimeResolver template > class NullVariableCompileTimeResolver : public VariableCompileTimeResolver { public: virtual XPathExpression_impl* compileVariable(const string_type& namespace_uri, const string_type& name) const { return 0; } // compileVariable }; // class NullVariableCompileTimeResolver } // namespace XPath } // namespace Arabica #endif