[routing] Documentation

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-07-01 21:02:14 +03:00
parent 9eeac05fdf
commit 4324e329e5
2 changed files with 17 additions and 5 deletions

View File

@@ -14,8 +14,12 @@ namespace routing
{ {
using LocalFileCheckerFn = std::function<bool(std::string const &)>; using LocalFileCheckerFn = std::function<bool(std::string const &)>;
// Encapsulates generation of mwm names of absent regions needed for building the route between /**
// |checkpoints|. For this purpose the new thread is used. * @brief Generates a list of MWMs needed to build a route.
*
* The `AbsentRegionsFinder` class encapsulates generation of MWM names of absent regions needed
* for building the route between `checkpoints`. For this purpose a separate worker thread is used.
*/
class AbsentRegionsFinder class AbsentRegionsFinder
{ {
public: public:
@@ -23,7 +27,11 @@ public:
LocalFileCheckerFn const & localFileChecker, LocalFileCheckerFn const & localFileChecker,
std::shared_ptr<NumMwmIds> numMwmIds, DataSource & dataSource); std::shared_ptr<NumMwmIds> numMwmIds, DataSource & dataSource);
// Creates new thread |m_routerThread| and starts routing in it. /**
* @brief Creates new thread `m_routerThread` and starts routing in it.
* @param checkpoints The checkpoints of the route (start, optional intermediate points, destination)
* @param delegate
*/
void GenerateAbsentRegions(Checkpoints const & checkpoints, RouterDelegate const & delegate); void GenerateAbsentRegions(Checkpoints const & checkpoints, RouterDelegate const & delegate);
/** /**

View File

@@ -23,11 +23,15 @@
namespace routing namespace routing
{ {
/// Dispatches a route calculation on a worker thread /**
* @brief The AsyncRouter class is a wrapper class to run routing routines in a different thread.
*
* It encapsulates an `IRouter` (or subclass) instance, set with `SetRouter()`, and runs it in a
* separate worker thread to calculate the route.
*/
class AsyncRouter final class AsyncRouter final
{ {
public: public:
/// AsyncRouter is a wrapper class to run routing routines in the different thread
AsyncRouter(PointCheckCallback const & pointCheckCallback); AsyncRouter(PointCheckCallback const & pointCheckCallback);
~AsyncRouter(); ~AsyncRouter();