2005-08-04 22:42:30 +02:00
|
|
|
#ifndef ARABICA_XPATH_EXECUTION_CONTEXT_HPP
|
|
|
|
#define ARABICA_XPATH_EXECUTION_CONTEXT_HPP
|
|
|
|
|
2005-08-17 11:17:18 +02:00
|
|
|
#include <Utils/StringAdaptor.h>
|
2005-08-04 22:42:30 +02:00
|
|
|
#include "xpath_variable_resolver.hpp"
|
|
|
|
#include "xpath_resolver_holder.hpp"
|
|
|
|
|
|
|
|
namespace Arabica
|
|
|
|
{
|
|
|
|
namespace XPath
|
|
|
|
{
|
|
|
|
|
|
|
|
class ExecutionContext
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ExecutionContext() :
|
2005-08-05 23:01:12 +02:00
|
|
|
position_(static_cast<size_t>(-1)),
|
|
|
|
last_(static_cast<size_t>(-1))
|
2005-08-04 22:42:30 +02:00
|
|
|
{
|
|
|
|
} // ExecutionContext
|
|
|
|
|
|
|
|
ExecutionContext(size_t last, const ExecutionContext& parent) :
|
2005-08-05 23:01:12 +02:00
|
|
|
position_(static_cast<size_t>(-1)),
|
2005-08-04 22:42:30 +02:00
|
|
|
last_(last),
|
|
|
|
variableResolver_(parent.variableResolver_)
|
|
|
|
{
|
|
|
|
} // ExecutionContext
|
|
|
|
|
|
|
|
size_t position() const { return position_; }
|
|
|
|
size_t last() const { return last_; }
|
|
|
|
|
|
|
|
void setPosition(unsigned int pos) { position_ = pos; }
|
|
|
|
|
2005-08-17 11:17:18 +02:00
|
|
|
const VariableResolver<std::string, Arabica::default_string_adaptor<std::string> >& variableResolver() const { return variableResolver_.get(); }
|
|
|
|
void setVariableResolver(const VariableResolver<std::string, Arabica::default_string_adaptor<std::string> >& resolver) { variableResolver_.set(resolver); }
|
|
|
|
void setVariableResolver(VariableResolverPtr<std::string, Arabica::default_string_adaptor<std::string> >& resolver) { variableResolver_.set(resolver); }
|
2005-08-04 22:42:30 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
size_t position_;
|
|
|
|
size_t last_;
|
2005-08-17 11:17:18 +02:00
|
|
|
ResolverHolder<const VariableResolver<std::string, Arabica::default_string_adaptor<std::string> > > variableResolver_;
|
2005-08-04 22:42:30 +02:00
|
|
|
|
|
|
|
ExecutionContext(const ExecutionContext&);
|
|
|
|
ExecutionContext& operator=(const ExecutionContext&);
|
|
|
|
bool operator==(const ExecutionContext&) const;
|
|
|
|
}; // class ExecutionContext
|
|
|
|
|
|
|
|
} // namespace XPath
|
|
|
|
} // namespace Arabica
|
|
|
|
|
|
|
|
#endif
|