#pragma once #include "IDictionary.h" #include namespace Poco { namespace Util { class AbstractConfiguration; } class Logger; } namespace DB { class Context; class DictionaryFactory : private boost::noncopyable { public: static DictionaryFactory & instance(); DictionaryPtr create( const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, const Context & context) const; DictionaryPtr create(const std::string & name, const ASTCreateQuery & ast, const Context & context) const; using Creator = std::function; bool isComplex(const std::string & layout_type) const { return layout_complexity.at(layout_type); } void registerLayout(const std::string & layout_type, Creator create_layout, bool is_complex); private: using LayoutRegistry = std::unordered_map; LayoutRegistry registered_layouts; using LayoutComplexity = std::unordered_map; LayoutComplexity layout_complexity; }; }