From f76ae53bf197fb298a77fcfdc54cb3c30ce90fe2 Mon Sep 17 00:00:00 2001 From: Colin MacKenzie Date: Sat, 10 Oct 2020 23:49:25 -0400 Subject: [PATCH] #191 added operator-bool to Handle<> template class for testing if handle has a reference set. uncrustify fixes on joint limits macros --- hardware_interface/include/hardware_interface/handle.hpp | 3 +++ .../joint_limits_interface/joint_limits_interface.hpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hardware_interface/include/hardware_interface/handle.hpp b/hardware_interface/include/hardware_interface/handle.hpp index 2b2372176f..a73b28b4c0 100644 --- a/hardware_interface/include/hardware_interface/handle.hpp +++ b/hardware_interface/include/hardware_interface/handle.hpp @@ -35,6 +35,9 @@ class Handle { } + /// \brief returns true if handle references a value + inline operator bool() const {return value_ptr_ != nullptr;} + HARDWARE_INTERFACE_PUBLIC HandleType with_value_ptr(double * value_ptr) { diff --git a/joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp b/joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp index a4f893bc11..aeed166bef 100644 --- a/joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp +++ b/joint_limits_interface/include/joint_limits_interface/joint_limits_interface.hpp @@ -54,9 +54,9 @@ #include "joint_limits_interface/joint_limits_interface_exception.hpp" -#define DEFAULT_POSITION_HANDLE { std::string(), "position" } -#define DEFAULT_VELOCITY_HANDLE { std::string(), "velocity" } -#define DEFAULT_COMMAND_HANDLE { std::string(), "position_command" } +#define DEFAULT_POSITION_HANDLE {std::string(), "position"} +#define DEFAULT_VELOCITY_HANDLE {std::string(), "velocity"} +#define DEFAULT_COMMAND_HANDLE {std::string(), "position_command"} namespace joint_limits_interface {