Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
27
libs/search/feature_loader.cpp
Normal file
27
libs/search/feature_loader.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "search/feature_loader.hpp"
|
||||
|
||||
#include "editor/editable_data_source.hpp"
|
||||
|
||||
#include "indexer/feature.hpp"
|
||||
#include "indexer/feature_decl.hpp"
|
||||
|
||||
namespace search
|
||||
{
|
||||
FeatureLoader::FeatureLoader(DataSource const & dataSource) : m_dataSource(dataSource) {}
|
||||
|
||||
std::unique_ptr<FeatureType> FeatureLoader::Load(FeatureID const & id)
|
||||
{
|
||||
ASSERT(m_checker.CalledOnOriginalThread(), ());
|
||||
|
||||
auto const & mwmId = id.m_mwmId;
|
||||
if (!m_guard || m_guard->GetId() != mwmId)
|
||||
m_guard = std::make_unique<FeaturesLoaderGuard>(m_dataSource, mwmId);
|
||||
return m_guard->GetFeatureByIndex(id.m_index);
|
||||
}
|
||||
|
||||
void FeatureLoader::Reset()
|
||||
{
|
||||
ASSERT(m_checker.CalledOnOriginalThread(), ());
|
||||
m_guard.reset();
|
||||
}
|
||||
} // namespace search
|
||||
Loading…
Add table
Add a link
Reference in a new issue