#pragma once #include "indexer/feature.hpp" #include #include #include namespace stats { struct GeneralInfo { GeneralInfo() : m_count(0), m_size(0), m_names(0), m_length(0), m_area(0) {} void Add(uint64_t szBytes, double len = 0, double area = 0, bool hasName = false) { if (szBytes > 0) { ++m_count; m_size += szBytes; m_length += len; m_area += area; if (hasName) ++m_names; } } uint64_t m_count; uint64_t m_size; uint64_t m_names; double m_length; double m_area; }; template struct IntegralType { T m_val; explicit IntegralType(T v) : m_val(v) {} bool operator<(IntegralType const & rhs) const { return m_val < rhs.m_val; } }; using ClassifType = IntegralType; using CountType = IntegralType; using AreaType = IntegralType; struct MapInfo { std::map m_byGeomType; std::map m_byClassifType; std::map m_byPointsCount, m_byTrgCount; std::map m_byAreaSize; GeneralInfo m_inner[3]; }; void FileContainerStatistic(std::string const & fPath); void CalcStatistic(std::string const & fPath, MapInfo & info); void PrintStatistic(MapInfo & info); void PrintTypeStatistic(MapInfo & info); }