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:
authorIlya Zverev <zverik@textual.ru>2015-09-12 16:03:10 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:05:00 +0300
commitc54944d79419888debe327e4244eb1e16ad85027 (patch)
tree9a1bf26a0fc489d6efdb50ea0f11991836a7b129 /generator/statistics.hpp
parent480a748695739a51219ad09b0adc9d7d75024647 (diff)
[stats] type_statistics key for generator_tool, better area calculation
Diffstat (limited to 'generator/statistics.hpp')
-rw-r--r--generator/statistics.hpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/generator/statistics.hpp b/generator/statistics.hpp
index 968777fd35..9240374ace 100644
--- a/generator/statistics.hpp
+++ b/generator/statistics.hpp
@@ -10,15 +10,18 @@ namespace stats
struct GeneralInfo
{
uint64_t m_count, m_size;
+ double m_length, m_area;
- GeneralInfo() : m_count(0), m_size(0) {}
+ GeneralInfo() : m_count(0), m_size(0), m_length(0), m_area(0) {}
- void Add(uint64_t sz)
+ void Add(uint64_t szBytes, double len = 0, double area = 0)
{
- if (sz > 0)
+ if (szBytes > 0)
{
++m_count;
- m_size += sz;
+ m_size += szBytes;
+ m_length += len;
+ m_area += area;
}
}
};
@@ -43,17 +46,11 @@ namespace stats
map<AreaType, GeneralInfo> m_byAreaSize;
GeneralInfo m_inner[3];
-
- template <class TKey, class TSet>
- void AddToSet(TKey key, uint32_t sz, TSet & theSet)
- {
- if (sz > 0)
- theSet[key].Add(sz);
- }
};
void FileContainerStatistic(string const & fPath);
void CalcStatistic(string const & fPath, MapInfo & info);
void PrintStatistic(MapInfo & info);
+ void PrintTypeStatistic(MapInfo & info);
}