#pragma once #include #include #include namespace Poco { namespace Util { class AbstractConfiguration; } class Logger; } namespace DB { class Context; struct DictionaryStructure; /// creates IDictionarySource instance from config and DictionaryStructure class DictionarySourceFactory : public ext::singleton { public: using Creator = std::function; DictionarySourceFactory(); void registerSource(const std::string & source_type, Creator create_source); DictionarySourcePtr create( const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, const DictionaryStructure & dict_struct, Context & context) const; private: using TSourceRegistry = std::unordered_map; TSourceRegistry registered_sources; Poco::Logger * log; }; }