From 8827ec3c09d51aabd5c196f2611b0405b208acd2 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Sun, 4 May 2025 20:23:13 +0300 Subject: [PATCH] [indexer] Documentation Signed-off-by: mvglasow --- indexer/data_source.hpp | 47 ++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/indexer/data_source.hpp b/indexer/data_source.hpp index 7e429f282..5df8bffd6 100644 --- a/indexer/data_source.hpp +++ b/indexer/data_source.hpp @@ -19,20 +19,31 @@ public: /// Registers a new map. std::pair RegisterMap(platform::LocalCountryFile const & localFile); - /// Deregisters a map from internal records. - /// - /// \param countryFile A countryFile denoting a map to be deregistered. - /// \return True if the map was successfully deregistered. If map is locked - /// now, returns false. + /** + * @brief Deregisters a map from internal records. + * @param countryFile A `CountryFile` denoting a map to be deregistered. + * @return True if the map was successfully deregistered, false if the map is locked now. + */ bool DeregisterMap(platform::CountryFile const & countryFile); void ForEachFeatureIDInRect(FeatureIdCallback const & f, m2::RectD const & rect, int scale, covering::CoveringMode mode = covering::ViewportWithLowLevels) const; void ForEachInRect(FeatureCallback const & f, m2::RectD const & rect, int scale) const; - // Calls |f| for features closest to |center| until |stopCallback| returns true or distance - // |sizeM| from has been reached. Then for EditableDataSource calls |f| for each edited feature - // inside square with center |center| and side |2 * sizeM|. Edited features are not in the same - // hierarchy and there is no fast way to merge frozen and edited features. + + /** + * @brief Iterates over features within a given distance of a center point. + * + * Calls `f` for features closest to `center` until `stopCallback` returns true or distance + * `sizeM` from has been reached. Then for EditableDataSource calls `f` for each edited feature + * inside square with center `center` and side `2 * sizeM`. Edited features are not in the same + * hierarchy and there is no fast way to merge frozen and edited features. + * + * @brief f Callback function that is called on each feature. + * @brief stopCallback Callback function which decides whether to continue searching or stop. + * @brief center The center of the search area. + * @brief sizeM The size of the search area, as a distance from the center point. + * @brief scale + */ void ForClosestToPoint(FeatureCallback const & f, StopSearchCallback const & stopCallback, m2::PointD const & center, double sizeM, int scale) const; void ForEachInScale(FeatureCallback const & f, int scale) const; @@ -70,18 +81,24 @@ private: std::unique_ptr m_factory; }; -// DataSource which operates with features from mwm file and does not support features creation -// deletion or modification. +/** + * @brief A `DataSource` which operates with features from an MWM file and does not support + * creation, deletion or modification of features. + */ class FrozenDataSource : public DataSource { public: FrozenDataSource() : DataSource(std::make_unique()) {} }; -/// Guard for loading features from particular MWM by demand. -/// @note If you need to work with FeatureType from different threads you need to use -/// a unique FeaturesLoaderGuard instance for every thread. -/// For an example of concurrent extracting feature details please see ConcurrentFeatureParsingTest. +/** + * @brief Guard for loading features from particular MWM by demand. + * + * @note If you need to work with `FeatureType` from different threads, you need to use + * a unique `FeaturesLoaderGuard` instance for every thread. + * For an example of concurrent extracting feature details please see `ConcurrentFeatureParsingTest` + * in `routing/routing_integration_tests`. + */ class FeaturesLoaderGuard { public: