1#pragma once
2
3#include <memory>
4#include <string>
5#include <vector>
6#include "Entries.h"
7
8
9// Iterates over all regions in data source
10class IRegionsHierarchyReader
11{
12public:
13 virtual bool readNext(RegionEntry & entry) = 0;
14
15 virtual ~IRegionsHierarchyReader() {}
16};
17
18using IRegionsHierarchyReaderPtr = std::unique_ptr<IRegionsHierarchyReader>;
19
20
21// Data source for single regions hierarchy
22class IRegionsHierarchyDataSource
23{
24public:
25 // data modified since last createReader invocation
26 virtual bool isModified() const = 0;
27
28 virtual IRegionsHierarchyReaderPtr createReader() = 0;
29
30 virtual ~IRegionsHierarchyDataSource() {}
31};
32
33using IRegionsHierarchyDataSourcePtr = std::shared_ptr<IRegionsHierarchyDataSource>;
34
35
36// Provides data sources for different regions hierarchies
37class IRegionsHierarchiesDataProvider
38{
39public:
40 virtual std::vector<std::string> listCustomHierarchies() const = 0;
41
42 virtual IRegionsHierarchyDataSourcePtr getDefaultHierarchySource() const = 0;
43 virtual IRegionsHierarchyDataSourcePtr getHierarchySource(const std::string & name) const = 0;
44
45 virtual ~IRegionsHierarchiesDataProvider() {}
46};
47
48using IRegionsHierarchiesDataProviderPtr = std::shared_ptr<IRegionsHierarchiesDataProvider>;
49