#pragma once #include #include #include #include "Entries.h" namespace DB { // Iterates over all regions in data source class IRegionsHierarchyReader { public: virtual bool readNext(RegionEntry & entry) = 0; virtual ~IRegionsHierarchyReader() = default; }; using IRegionsHierarchyReaderPtr = std::unique_ptr; // Data source for single regions hierarchy class IRegionsHierarchyDataSource { public: // data modified since last createReader invocation virtual bool isModified() const = 0; virtual IRegionsHierarchyReaderPtr createReader() = 0; virtual ~IRegionsHierarchyDataSource() = default; }; using IRegionsHierarchyDataSourcePtr = std::shared_ptr; // Provides data sources for different regions hierarchies class IRegionsHierarchiesDataProvider { public: virtual std::vector listCustomHierarchies() const = 0; virtual IRegionsHierarchyDataSourcePtr getDefaultHierarchySource() const = 0; virtual IRegionsHierarchyDataSourcePtr getHierarchySource(const std::string & name) const = 0; virtual ~IRegionsHierarchiesDataProvider() = default; }; using IRegionsHierarchiesDataProviderPtr = std::shared_ptr; }