blob: 88627061fab8220caf4565b7353b4b2510b69b9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "features_vector.hpp"
#include "features_offsets_table.hpp"
#include "data_factory.hpp"
#include "platform/constants.hpp"
#include "platform/mwm_version.hpp"
void FeaturesVector::GetByIndex(uint32_t index, FeatureType & ft) const
{
uint32_t offset = 0, size = 0;
auto const ftOffset = m_table ? m_table->GetFeatureOffset(index) : index;
m_RecordReader.ReadRecord(ftOffset, m_buffer, offset, size);
ft.Deserialize(m_LoadInfo.GetLoader(), &m_buffer[offset]);
}
FeaturesVectorTest::FeaturesVectorTest(string const & filePath)
: FeaturesVectorTest((FilesContainerR(filePath, READER_CHUNK_LOG_SIZE, READER_CHUNK_LOG_COUNT)))
{
}
FeaturesVectorTest::FeaturesVectorTest(FilesContainerR const & cont)
: m_cont(cont), m_header(m_cont), m_vector(m_cont, m_header, 0)
{
if (m_header.GetFormat() >= version::v5)
m_vector.m_table = feature::FeaturesOffsetsTable::CreateIfNotExistsAndLoad(m_cont).release();
}
FeaturesVectorTest::~FeaturesVectorTest()
{
delete m_vector.m_table;
}
|