summaryrefslogtreecommitdiffhomepage
path: root/src/search-result.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/search-result.hpp')
-rw-r--r--src/search-result.hpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/search-result.hpp b/src/search-result.hpp
index 257d25a3..fc5397a0 100644
--- a/src/search-result.hpp
+++ b/src/search-result.hpp
@@ -8,10 +8,20 @@ namespace floormat {
struct point;
-struct path_search_result final
+class path_search_result final
{
friend struct test_app;
+ struct pair;
+ struct node;
+ Pointer<node> _node;
+ float _time = 0;
+ uint32_t _cost = 0, _distance = (uint32_t)-1;
+ bool _found : 1 = false;
+
+ static Pointer<node> _pool; // NOLINT(*-avoid-non-const-global-variables)
+
+public:
const point* data() const;
const point& operator[](size_t index) const;
size_t size() const;
@@ -23,8 +33,11 @@ struct path_search_result final
void set_found(bool value);
uint32_t distance() const;
void set_distance(uint32_t dist);
+ bool is_simplified() const;
+ const pair& simplified();
vector_wrapper<point, vector_wrapper_repr::ref> raw_path();
+ vector_wrapper<point, vector_wrapper_repr::ref> raw_simplified_path();
ArrayView<const point> path() const;
explicit operator ArrayView<const point>() const;
explicit operator bool() const;
@@ -35,16 +48,6 @@ struct path_search_result final
path_search_result(path_search_result&&) noexcept;
path_search_result& operator=(path_search_result&&) noexcept;
~path_search_result() noexcept;
-
-private:
- struct node;
-
- static Pointer<node> _pool; // NOLINT(*-avoid-non-const-global-variables)
-
- Pointer<node> _node;
- float _time = 0;
- uint32_t _cost = 0, _distance = (uint32_t)-1;
- bool _found : 1 = false;
};
} // namespace floormat