Revert "[tracks] Safe GpsTrackCollection requests during recording."

This reverts commit b7b87f5530.
This commit is contained in:
Konstantin Pastbin
2025-08-31 15:58:40 +07:00
parent f3c30cbf85
commit de305e1a87
4 changed files with 8 additions and 13 deletions

View File

@@ -50,20 +50,15 @@ void GpsTrack::AddPoints(vector<location::GpsInfo> const & points)
ScheduleTask();
}
/// @note These functions are called during recording, so should be synchronized with Collection writer thread.
/// @{
TrackStatistics GpsTrack::GetTrackStatistics()
TrackStatistics GpsTrack::GetTrackStatistics() const
{
lock_guard<mutex> lg(m_threadGuard);
return m_collection ? m_collection->GetTrackStatistics() : TrackStatistics();
}
ElevationInfo const & GpsTrack::GetElevationInfo()
ElevationInfo const & GpsTrack::GetElevationInfo() const
{
lock_guard<mutex> lg(m_threadGuard);
return m_collection->UpdateAndGetElevationInfo();
}
/// @}
void GpsTrack::Clear()
{

View File

@@ -31,8 +31,8 @@ public:
void AddPoints(std::vector<location::GpsInfo> const & points);
/// Returns track statistics
TrackStatistics GetTrackStatistics();
ElevationInfo const & GetElevationInfo();
TrackStatistics GetTrackStatistics() const;
ElevationInfo const & GetElevationInfo() const;
/// Clears any previous tracking info
/// @note Callback is called with 'toRemove' points, if some points were removed.

View File

@@ -68,12 +68,12 @@ bool GpsTracker::IsEmpty() const
return m_track.IsEmpty();
}
TrackStatistics GpsTracker::GetTrackStatistics()
TrackStatistics GpsTracker::GetTrackStatistics() const
{
return m_track.GetTrackStatistics();
}
ElevationInfo const & GpsTracker::GetElevationInfo()
ElevationInfo const & GpsTracker::GetElevationInfo() const
{
return m_track.GetElevationInfo();
}

View File

@@ -17,8 +17,8 @@ public:
bool IsEmpty() const;
TrackStatistics GetTrackStatistics();
ElevationInfo const & GetElevationInfo();
TrackStatistics GetTrackStatistics() const;
ElevationInfo const & GetElevationInfo() const;
using TGpsTrackDiffCallback =
std::function<void(std::vector<std::pair<size_t, location::GpsInfo>> && toAdd,