1 | #include "RegionsHierarchies.h" |
---|---|
2 | |
3 | #include <Poco/DirectoryIterator.h> |
4 | #include <common/logger_useful.h> |
5 | |
6 | |
7 | RegionsHierarchies::RegionsHierarchies(IRegionsHierarchiesDataProviderPtr data_provider) |
8 | { |
9 | Logger * log = &Logger::get("RegionsHierarchies"); |
10 | |
11 | LOG_DEBUG(log, "Adding default regions hierarchy"); |
12 | data.emplace("", data_provider->getDefaultHierarchySource()); |
13 | |
14 | for (const auto & name : data_provider->listCustomHierarchies()) |
15 | { |
16 | LOG_DEBUG(log, "Adding regions hierarchy for "<< name); |
17 | data.emplace(name, data_provider->getHierarchySource(name)); |
18 | } |
19 | |
20 | reload(); |
21 | } |
22 |