From a82b88355eaa77f793ac8e07895695b697d43f64 Mon Sep 17 00:00:00 2001 From: v4hn Date: Wed, 17 Mar 2021 00:03:55 +0100 Subject: [PATCH] streamline trait parameters state asked for a reference, but trajectories for a pointer. --- core/include/moveit/task_constructor/storage.h | 10 +++++----- core/src/container.cpp | 2 +- core/src/stage.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/include/moveit/task_constructor/storage.h b/core/include/moveit/task_constructor/storage.h index a9f07dff..fb561649 100644 --- a/core/include/moveit/task_constructor/storage.h +++ b/core/include/moveit/task_constructor/storage.h @@ -391,14 +391,14 @@ inline const InterfaceState* state(const SolutionBase& solu /// Trait to retrieve outgoing (FORWARD) or incoming (BACKWARD) solution segments of a given state template -const InterfaceState::Solutions& trajectories(const InterfaceState* state); +const InterfaceState::Solutions& trajectories(const InterfaceState& state); template <> -inline const InterfaceState::Solutions& trajectories(const InterfaceState* state) { - return state->outgoingTrajectories(); +inline const InterfaceState::Solutions& trajectories(const InterfaceState& state) { + return state.outgoingTrajectories(); } template <> -inline const InterfaceState::Solutions& trajectories(const InterfaceState* state) { - return state->incomingTrajectories(); +inline const InterfaceState::Solutions& trajectories(const InterfaceState& state) { + return state.incomingTrajectories(); } /// Trait to retrieve opposite direction (FORWARD <-> BACKWARD) diff --git a/core/src/container.cpp b/core/src/container.cpp index c0adf36b..a1130106 100644 --- a/core/src/container.cpp +++ b/core/src/container.cpp @@ -317,7 +317,7 @@ struct SolutionCollector } void traverse(const SolutionBase& start, const InterfaceState::Priority& prio) { - const InterfaceState::Solutions& next = trajectories(state(start)); + const InterfaceState::Solutions& next = trajectories(*state(start)); if (next.empty()) { // when reaching the end, add the trace to solutions assert(prio.depth() == trace.size()); assert(prio.depth() <= max_depth); diff --git a/core/src/stage.cpp b/core/src/stage.cpp index 7d73cbad..c0d3e15a 100644 --- a/core/src/stage.cpp +++ b/core/src/stage.cpp @@ -166,7 +166,7 @@ void StagePrivate::setStatus(const InterfaceState* s, InterfaceState::Status sta status = InterfaceState::DISABLED; // only the first state is marked as FAILED // traverse solution tree - for (const SolutionBase* successor : trajectories(s)) + for (const SolutionBase* successor : trajectories(*s)) setStatus(state(*successor), status); } template void StagePrivate::setStatus(const InterfaceState* s, InterfaceState::Status status);