From 9f7139f3764afc671fd5991b42edef3f85ba7d54 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Fri, 21 May 2021 11:40:12 +0200 Subject: [PATCH] Fix names of trampoline classes Using template names T is not a good idea, because this name is used verbatim for some error reporting, resulting e.g. in: Tried to call pure virtual function "T::canCompute" --- core/python/bindings/src/core.h | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/core/python/bindings/src/core.h b/core/python/bindings/src/core.h index 559ef02d..17352854 100644 --- a/core/python/bindings/src/core.h +++ b/core/python/bindings/src/core.h @@ -49,35 +49,35 @@ namespace solvers { class PlannerInterface; } -template -class PyStage : public T, public pybind11::trampoline_self_life_support +template +class PyStage : public Stage, public pybind11::trampoline_self_life_support { public: - using T::T; + using Stage::Stage; void init(const moveit::core::RobotModelConstPtr& robot_model) override { - PYBIND11_OVERRIDE(void, T, init, robot_model); + PYBIND11_OVERRIDE(void, Stage, init, robot_model); } - void reset() override { PYBIND11_OVERRIDE(void, T, reset, ); } + void reset() override { PYBIND11_OVERRIDE(void, Stage, reset, ); } }; -template -class PyGenerator : public PyStage +template +class PyGenerator : public PyStage { public: - using PyStage::PyStage; - bool canCompute() const override { PYBIND11_OVERRIDE_PURE(bool, T, canCompute, ); } - void compute() override { PYBIND11_OVERRIDE_PURE(void, T, compute, ); } + using PyStage::PyStage; + bool canCompute() const override { PYBIND11_OVERRIDE_PURE(bool, Generator, canCompute, ); } + void compute() override { PYBIND11_OVERRIDE_PURE(void, Generator, compute, ); } }; -template -class PyMonitoringGenerator : public PyGenerator +template +class PyMonitoringGenerator : public PyGenerator { public: - using PyGenerator::PyGenerator; + using PyGenerator::PyGenerator; void onNewSolution(const SolutionBase& s) override { // pass solution as pointer to trigger passing by reference - PYBIND11_OVERRIDE_PURE(void, T, onNewSolution, &s); + PYBIND11_OVERRIDE_PURE(void, MonitoringGenerator, onNewSolution, &s); } }; @@ -87,18 +87,18 @@ public: using MonitoringGenerator::onNewSolution; }; -template -class PyPropagatingEitherWay : public PyStage +template +class PyPropagatingEitherWay : public PyStage { public: - using PyStage::PyStage; + using PyStage::PyStage; void computeForward(const InterfaceState& from_state) override { // pass InterfaceState as pointer to trigger passing by reference - PYBIND11_OVERRIDE_PURE(void, T, computeForward, &from_state); + PYBIND11_OVERRIDE_PURE(void, PropagatingEitherWay, computeForward, &from_state); } void computeBackward(const InterfaceState& to_state) override { // pass InterfaceState as pointer to trigger passing by reference - PYBIND11_OVERRIDE_PURE(void, T, computeBackward, &to_state); + PYBIND11_OVERRIDE_PURE(void, PropagatingEitherWay, computeBackward, &to_state); } };