Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2012-01-27 15:07:33 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:32:31 +0300
commitb84bc9172fdb5ed1ada0820eda43c655d22bf842 (patch)
tree512dc696db4196285fdddc4eb74062142898a9a2 /indexer/feature_data.hpp
parentf87031f54b1e60a7310efb5c2608fad6b62c27c8 (diff)
Replace FeatureBase::GetTypesFn with more suitable feature::TypesHolder.
Diffstat (limited to 'indexer/feature_data.hpp')
-rw-r--r--indexer/feature_data.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp
index 1b57d9b117..2c6032611a 100644
--- a/indexer/feature_data.hpp
+++ b/indexer/feature_data.hpp
@@ -8,6 +8,8 @@
#include "../std/vector.hpp"
+class FeatureBase;
+
namespace feature
{
enum EGeomType
@@ -46,6 +48,38 @@ namespace feature
LAYER_HIGH = 12
};
+
+ class TypesHolder
+ {
+ uint32_t m_types[max_types_count];
+ size_t m_size;
+
+ EGeomType m_geoType;
+
+ public:
+ TypesHolder() : m_size(0), m_geoType(GEOM_UNDEFINED) {}
+ TypesHolder(FeatureBase const & f);
+
+ /// Accumulation function.
+ inline void operator() (uint32_t t) { m_types[m_size++] = t; }
+
+ /// @name Selectors.
+ //@{
+ inline EGeomType GetGeoType() const { return m_geoType; }
+
+ inline size_t Size() const { return m_size; }
+ inline uint32_t operator[] (size_t i) const { return m_types[i]; }
+
+ inline bool Has(uint32_t t) const
+ {
+ for (size_t i = 0; i < m_size; ++i)
+ if (t == m_types[i])
+ return true;
+
+ return false;
+ }
+ //@}
+ };
}
/// Feature description struct.