Skip to content

Commit

Permalink
use overload instead
Browse files Browse the repository at this point in the history
Signed-off-by: kminoda <koji.minoda@tier4.jp>
  • Loading branch information
kminoda committed Dec 25, 2024
1 parent 82fafa7 commit c981570
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class DiagnosticInterface
void add_key_value(const diagnostic_msgs::msg::KeyValue & key_value_msg);
template <typename T>
void add_key_value(const std::string & key, const T & value);
void add_key_value(const std::string & key, const std::string & value);
void add_key_value(const std::string & key, bool value);
void update_level_and_message(const int8_t level, const std::string & message);
void publish(const rclcpp::Time & publish_time_stamp);

Expand All @@ -54,11 +56,6 @@ void DiagnosticInterface::add_key_value(const std::string & key, const T & value
add_key_value(key_value);
}

template <>
void DiagnosticInterface::add_key_value(const std::string & key, const std::string & value);
template <>
void DiagnosticInterface::add_key_value(const std::string & key, const bool & value);

} // namespace autoware::universe_utils

#endif // AUTOWARE__UNIVERSE_UTILS__ROS__DIAGNOSTICS_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ void DiagnosticInterface::add_key_value(const diagnostic_msgs::msg::KeyValue & k
}
}

template <>
void DiagnosticInterface::add_key_value(const std::string & key, const std::string & value)
{
diagnostic_msgs::msg::KeyValue key_value;
Expand All @@ -65,8 +64,7 @@ void DiagnosticInterface::add_key_value(const std::string & key, const std::stri
add_key_value(key_value);
}

template <>
void DiagnosticInterface::add_key_value(const std::string & key, const bool & value)
void DiagnosticInterface::add_key_value(const std::string & key, bool value)
{
diagnostic_msgs::msg::KeyValue key_value;
key_value.key = key;
Expand Down

0 comments on commit c981570

Please sign in to comment.