start implementation of routeCache

This commit is contained in:
2024-07-03 09:22:16 +02:00
parent dd304cf787
commit dbb646b5a5
3 changed files with 12 additions and 1 deletions
+7 -1
View File
@@ -11,6 +11,8 @@
#include "route.h"
Route Route::routeCache = Route();
void Route::addPointToRoute(Point point)
{
this->points.push_back(point);
@@ -88,7 +90,7 @@ Point Route::getPreviousPoint()
this->currentPoint--;
return *this->it;
}
return point;
}
@@ -99,3 +101,7 @@ RouteInfo Route::getRouteInfo()
info.currentPoint = this->currentPoint;
return info;
}
Route& Route::getRouteCache() {
return Route::routeCache;
}
+4
View File
@@ -100,12 +100,16 @@ public:
*/
bool getStarted() const { return this->started; }
static Route& getRouteCache();
private:
uint16_t currentPoint = 0;
bool started = false;
std::list<Point> points;
std::list<Point>::iterator it;
static Route routeCache;
};
#endif // ROUTE_H