#ifndef ARABICA_XPATHIC_XPATH_EXPRESSION_IMPL_H #define ARABICA_XPATHIC_XPATH_EXPRESSION_IMPL_H #include "xpath_expression.hpp" namespace Arabica { namespace XPath { namespace impl { template class NumericExpression : virtual public XPathExpression_impl { public: NumericExpression() { } virtual ValueType type() const { return NUMBER; } virtual XPathValue evaluate(const DOM::Node& context, const ExecutionContext& executionContext) const { return NumericValue::createValue(doEvaluateAsNumber(context, executionContext)); } // evaluate virtual double evaluateAsNumber(const DOM::Node& context, const ExecutionContext& executionContext) const { return doEvaluateAsNumber(context, executionContext); } // evaluateAsNumber protected: virtual double doEvaluateAsNumber(const DOM::Node& context, const ExecutionContext& executionContext) const = 0; ~NumericExpression() { } }; // class NumericExpression } // namespace impl } // namespace XPath } // namespace Arabica #endif