[indexer] Documentation

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-05-04 20:23:13 +03:00
parent 7be0b8a256
commit 8827ec3c09

View File

@@ -19,20 +19,31 @@ public:
/// Registers a new map. /// Registers a new map.
std::pair<MwmId, RegResult> RegisterMap(platform::LocalCountryFile const & localFile); std::pair<MwmId, RegResult> RegisterMap(platform::LocalCountryFile const & localFile);
/// Deregisters a map from internal records. /**
/// * @brief Deregisters a map from internal records.
/// \param countryFile A countryFile denoting a map to be deregistered. * @param countryFile A `CountryFile` denoting a map to be deregistered.
/// \return True if the map was successfully deregistered. If map is locked * @return True if the map was successfully deregistered, false if the map is locked now.
/// now, returns false. */
bool DeregisterMap(platform::CountryFile const & countryFile); bool DeregisterMap(platform::CountryFile const & countryFile);
void ForEachFeatureIDInRect(FeatureIdCallback const & f, m2::RectD const & rect, int scale, void ForEachFeatureIDInRect(FeatureIdCallback const & f, m2::RectD const & rect, int scale,
covering::CoveringMode mode = covering::ViewportWithLowLevels) const; covering::CoveringMode mode = covering::ViewportWithLowLevels) const;
void ForEachInRect(FeatureCallback const & f, m2::RectD const & rect, int scale) 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 * @brief Iterates over features within a given distance of a center point.
// hierarchy and there is no fast way to merge frozen and edited features. *
* 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, void ForClosestToPoint(FeatureCallback const & f, StopSearchCallback const & stopCallback,
m2::PointD const & center, double sizeM, int scale) const; m2::PointD const & center, double sizeM, int scale) const;
void ForEachInScale(FeatureCallback const & f, int scale) const; void ForEachInScale(FeatureCallback const & f, int scale) const;
@@ -70,18 +81,24 @@ private:
std::unique_ptr<FeatureSourceFactory> m_factory; std::unique_ptr<FeatureSourceFactory> 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 class FrozenDataSource : public DataSource
{ {
public: public:
FrozenDataSource() : DataSource(std::make_unique<FeatureSourceFactory>()) {} FrozenDataSource() : DataSource(std::make_unique<FeatureSourceFactory>()) {}
}; };
/// Guard for loading features from particular MWM by demand. /**
/// @note If you need to work with FeatureType from different threads you need to use * @brief Guard for loading features from particular MWM by demand.
/// a unique FeaturesLoaderGuard instance for every thread. *
/// For an example of concurrent extracting feature details please see ConcurrentFeatureParsingTest. * @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 class FeaturesLoaderGuard
{ {
public: public: