Skip to content

Instantly share code, notes, and snippets.

@youtalk
Last active June 16, 2017 06:19
Show Gist options
  • Save youtalk/e0c3eb847e4e5cb22a61959aa097eff4 to your computer and use it in GitHub Desktop.
Save youtalk/e0c3eb847e4e5cb22a61959aa097eff4 to your computer and use it in GitHub Desktop.
rclcpp::parameter::ParameterVariant
explicit ParameterVariant(const std::string & name, const bool bool_value);
explicit ParameterVariant(const std::string & name, const int int_value);
explicit ParameterVariant(const std::string & name, const int64_t int_value);
explicit ParameterVariant(const std::string & name, const float double_value);
explicit ParameterVariant(const std::string & name, const double double_value);
explicit ParameterVariant(const std::string & name, const std::string & string_value);
explicit ParameterVariant(const std::string & name, const char * string_value);
explicit ParameterVariant(const std::string & name, const std::vector<uint8_t> & bytes_value);
template<ParameterType type>
typename std::enable_if<type == ParameterType::PARAMETER_INTEGER, int64_t>::type
get_value() const;
template<ParameterType type>
typename std::enable_if<type == ParameterType::PARAMETER_DOUBLE, double>::type
get_value() const;
template<ParameterType type>
typename std::enable_if<type == ParameterType::PARAMETER_STRING, const std::string &>::type
get_value() const;
template<ParameterType type>
typename std::enable_if<type == ParameterType::PARAMETER_BOOL, bool>::type
get_value() const;
template<ParameterType type>
typename std::enable_if<
type == ParameterType::PARAMETER_BYTES, const std::vector<uint8_t> &>::type
get_value() const;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment