blob: 5a338f0f6dee743fca66bdedc7cd98c1ab835c7f (
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
|
#pragma once
#include "indexer/feature_decl.hpp"
#include <map>
#include <memory>
#include <utility>
namespace df
{
using CustomFeatures = std::map<FeatureID, bool>;
struct CustomFeaturesContext
{
CustomFeatures const m_features;
explicit CustomFeaturesContext(CustomFeatures && features)
: m_features(std::move(features))
{}
bool NeedDiscardGeometry(FeatureID const & id) const
{
auto const it = m_features.find(id);
if (it == m_features.cend())
return false;
return it->second;
}
};
using CustomFeaturesContextPtr = std::shared_ptr<CustomFeaturesContext>;
using CustomFeaturesContextWeakPtr = std::weak_ptr<CustomFeaturesContext>;
} // namespace df
|