diff options
Diffstat (limited to 'routing/router_delegate.hpp')
-rw-r--r-- | routing/router_delegate.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/routing/router_delegate.hpp b/routing/router_delegate.hpp index 42c892ad95..be87acbec4 100644 --- a/routing/router_delegate.hpp +++ b/routing/router_delegate.hpp @@ -6,6 +6,7 @@ #include "base/timer.hpp" #include "std/function.hpp" +#include "std/mutex.hpp" namespace routing { @@ -35,13 +36,16 @@ public: RouterDelegate(); /// Set routing progress. Waits current progress status from 0 to 100. - void OnProgress(float progress) const { if (!IsCancelled()) m_progressCallback(progress); } - void OnPointCheck(m2::PointD const & point) const { if (!IsCancelled()) m_pointCallback(point); } + void OnProgress(float progress) const; + void OnPointCheck(m2::PointD const & point) const; void SetProgressCallback(TProgressCallback const & progressCallback); void SetPointCheckCallback(TPointCheckCallback const & pointCallback); + void Reset() override {lock_guard<mutex> l(m_guard); TimeoutCancellable::Reset();} + private: + mutable mutex m_guard; TProgressCallback m_progressCallback; TPointCheckCallback m_pointCallback; }; |