MCPcopy Create free account
hub / github.com/comaps/comaps / BuildIndexFromDataFile

Function BuildIndexFromDataFile

libs/indexer/index_builder.cpp:15–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace indexer
14{
15bool BuildIndexFromDataFile(std::string const & dataFile, std::string const & tmpFile)
16{
17 try
18 {
19 std::string const idxFileName(tmpFile + GEOM_INDEX_TMP_EXT);
20 {
21 FeaturesVectorTest features(dataFile);
22 FileWriter writer(idxFileName);
23
24 BuildIndex(features.GetHeader(), features.GetVector(), writer, tmpFile);
25 }
26
27 FilesContainerW(dataFile, FileWriter::OP_WRITE_EXISTING).Write(idxFileName, INDEX_FILE_TAG);
28 FileWriter::DeleteFileX(idxFileName);
29 }
30 catch (Reader::Exception const & e)
31 {
32 LOG(LERROR, ("Error while reading file: ", e.Msg()));
33 return false;
34 }
35 catch (Writer::Exception const & e)
36 {
37 LOG(LERROR, ("Error writing index file: ", e.Msg()));
38 return false;
39 }
40
41 return true;
42}
43} // namespace indexer

Callers 3

generator_tool.cppFile · 0.85
BuildFeaturesMethod · 0.85
FinishMethod · 0.85

Calls 5

BuildIndexFunction · 0.85
DeleteFileXFunction · 0.85
GetHeaderMethod · 0.80
FilesContainerWClass · 0.70
WriteMethod · 0.45

Tested by 2

BuildFeaturesMethod · 0.68
FinishMethod · 0.68