#pragma once #include #include #include #include #include #include #include namespace DB { class IMergeSelector; using MergeSelectorPtr = std::shared_ptr; class MergeSelectorFactory final : private boost::noncopyable { private: using Creator = std::function; using CreatorByNameMap = std::unordered_map; using EnumToName = std::unordered_map; CreatorByNameMap creators; EnumToName enum_to_name_mapping; MergeSelectorFactory() = default; public: static MergeSelectorFactory & instance(); MergeSelectorPtr get(const std::string & name, const std::any & settings = {}) const; MergeSelectorPtr get(MergeSelectorAlgorithm algorithm, const std::any & settings = {}) const; void registerPrivateSelector(std::string name, Creator && creator); void registerPublicSelector(std::string name, MergeSelectorAlgorithm enum_value, Creator && creator); }; }