Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2015-03-06 19:19:04 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:38:25 +0300
commitcbc137f24089dac4f4540e23747bb7b0259c936b (patch)
tree6ba7f4be58d6aed030973755b77af39cbed0c7ba /indexer/features_offsets_table.hpp
parentfa062c45a4f4c76ca313e9da41efe18948cea326 (diff)
Extract index path generation from offsets table class
Diffstat (limited to 'indexer/features_offsets_table.hpp')
-rw-r--r--indexer/features_offsets_table.hpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/indexer/features_offsets_table.hpp b/indexer/features_offsets_table.hpp
index 8f89c91ef2..5fa778560d 100644
--- a/indexer/features_offsets_table.hpp
+++ b/indexer/features_offsets_table.hpp
@@ -53,10 +53,10 @@ namespace feature
/// mapped to the memory and used by internal structures of
/// FeaturesOffsetsTable.
///
- /// \param countryName a countryName to save index file to
+ /// \param fileName a full path of the file to load or store data
/// \return a pointer to an instance of FeaturesOffsetsTable or nullptr
/// when it's not possible to load FeaturesOffsetsTable.
- static unique_ptr<FeaturesOffsetsTable> Load(string const & countryName);
+ static unique_ptr<FeaturesOffsetsTable> Load(string const & fileName);
/// Loads FeaturesOffsetsTable from FilesMappingContainer. Note
/// that some part of a file referenced by container will be
@@ -67,18 +67,19 @@ namespace feature
///
/// \warning May take a lot of time if there is no precomputed section
///
- /// \param countryName a country to create index to
+ /// \param fileName a full path of the file to load or store data
+ /// \param mwmFileContainer mwm container to read features data (if we need to construct them)
/// \return a pointer to an instance of FeaturesOffsetsTable or nullptr
/// when it's not possible to create FeaturesOffsetsTable.
- static unique_ptr<FeaturesOffsetsTable> CreateIfNotExistsAndLoad(string const & countryName);
+ static unique_ptr<FeaturesOffsetsTable> CreateIfNotExistsAndLoad(string const & fileName, FilesContainerR const & mwmFileContainer);
FeaturesOffsetsTable(FeaturesOffsetsTable const &) = delete;
FeaturesOffsetsTable const & operator=(FeaturesOffsetsTable const &) = delete;
/// Serializes current instance to a section in container.
///
- /// \param countryName a name of the country to create data
- void Save(string const & countryName);
+ /// \param fileName a full path of the file to store data
+ void Save(string const & fileName);
/// \param index index of a feature
/// \return offset a feature
@@ -102,15 +103,7 @@ namespace feature
return succinct::mapper::size_of(m_table);
}
- /// Delete temporary index file (only for features offsets table)
- static void CleanIndexFile(string const & countryName)
- {
- FileWriter::DeleteFileX(GetIndexFileName(countryName));
- }
-
private:
- static string GetIndexFileName(string const & countryName);
-
FeaturesOffsetsTable(succinct::elias_fano::elias_fano_builder & builder);
FeaturesOffsetsTable(string const &);