#pragma once #include #include #include #include #include #include namespace DB { class Context; /** * 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, const Context & context) const; private: using DiskTypeRegistry = std::unordered_map; DiskTypeRegistry registry; }; }