mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
Revert "[tracks] Safe GpsTrackCollection requests during recording."
This reverts commit b7b87f5530.
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user