#pragma once #include "indexer/feature.hpp" #include "std/map.hpp" namespace stats { struct GeneralInfo { uint64_t m_count, m_size; double m_length, m_area; GeneralInfo() : m_count(0), m_size(0), m_length(0), m_area(0) {} void Add(uint64_t szBytes, double len = 0, double area = 0) { if (szBytes > 0) { ++m_count; m_size += szBytes; m_length += len; m_area += 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 { map m_byGeomType; map m_byClassifType; map m_byPointsCount, m_byTrgCount; map m_byAreaSize; GeneralInfo m_inner[3]; }; void FileContainerStatistic(string const & fPath); void CalcStatistic(string const & fPath, MapInfo & info); void PrintStatistic(MapInfo & info); void PrintTypeStatistic(MapInfo & info); }