From cf0bc5822e1b6f135ff5f434389eff59c02b9b03 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Mon, 4 May 2015 17:31:57 -0700 Subject: [PATCH] Added as_* methods --- rclcpp/include/rclcpp/parameter.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rclcpp/include/rclcpp/parameter.hpp b/rclcpp/include/rclcpp/parameter.hpp index afb7ce1..3da59bb 100644 --- a/rclcpp/include/rclcpp/parameter.hpp +++ b/rclcpp/include/rclcpp/parameter.hpp @@ -160,6 +160,16 @@ public: return value_.bytes_value; } + int64_t as_int() const {return get_value(); } + + double as_double() const {return get_value(); } + + const std::string & as_string() const {return get_value(); } + + bool as_bool() const {return get_value(); } + + std::vector as_bytes() const {return get_value(); } + private: std::string name_; rcl_interfaces::ParameterValue value_;