#pragma once #include #include #include #include #include #include #include #include namespace DB { using DisksMap = std::map; /** * Disk factory. Responsible for creating new disk objects. */ class DiskFactory final : private boost::noncopyable { public: using Creator = std::function; static DiskFactory & instance(); void registerDiskType(const String & disk_type, Creator creator); DiskPtr create( const String & name, const Poco::Util::AbstractConfiguration & config, const String & config_prefix, ContextPtr context, const DisksMap & map) const; private: using DiskTypeRegistry = std::unordered_map; DiskTypeRegistry registry; }; }