co-maps/libs/search/lazy_centers_table.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
667 B
C++
Raw Normal View History

2025-11-22 13:58:55 +01:00
#pragma once
#include "indexer/centers_table.hpp"
#include "coding/files_container.hpp"
#include "geometry/point2d.hpp"
#include <cstdint>
#include <memory>
class MwmValue;
namespace search
{
class LazyCentersTable
{
public:
enum State
{
STATE_NOT_LOADED,
STATE_LOADED,
STATE_FAILED
};
explicit LazyCentersTable(MwmValue const & value);
inline State GetState() const { return m_state; }
void EnsureTableLoaded();
[[nodiscard]] bool Get(uint32_t id, m2::PointD & center);
private:
MwmValue const & m_value;
State m_state;
FilesContainerR::TReader m_reader;
std::unique_ptr<CentersTable> m_table;
};
} // namespace search