#pragma once #include #include #include #include namespace DB { class Context; class InterpreterFactory : private boost::noncopyable { public: static InterpreterFactory & instance(); struct Arguments { ASTPtr & query; ContextMutablePtr context; const SelectQueryOptions & options; bool allow_materialized; }; using InterpreterPtr = std::unique_ptr; InterpreterPtr get( ASTPtr & query, ContextMutablePtr context, const SelectQueryOptions & options = {}); using CreatorFn = std::function; using Interpreters = std::unordered_map; void registerInterpreter(const std::string & name, CreatorFn creator_fn); private: Interpreters interpreters; }; }