2828namespace rclcpp
2929{
3030
31- // / Specialization for when MessageT is an actual ROS message type.
31+ #ifdef DOXYGEN_ONLY
32+
33+ // / Returns the message type support for the given `MessageT` type.
34+ /* *
35+ * \tparam MessageT an actual ROS message type or an adapted type using `rclcpp::TypeAdapter`
36+ */
37+ template <typename MessageT>
38+ constexpr const rosidl_message_type_support_t & get_message_type_support_handle ();
39+
40+ #else
41+
3242template <typename MessageT>
3343constexpr
3444typename std::enable_if_t <
@@ -44,7 +54,6 @@ get_message_type_support_handle()
4454 return *handle;
4555}
4656
47- // / Specialization for when MessageT is an adapted type using rclcpp::TypeAdapter.
4857template <typename AdaptedType>
4958constexpr
5059typename std::enable_if_t <
@@ -63,12 +72,9 @@ get_message_type_support_handle()
6372 return *handle;
6473}
6574
66- // / Specialization for when MessageT is not a ROS message nor an adapted type.
67- /* *
68- * This specialization is a pass through runtime check, which allows a better
69- * static_assert to catch this issue further down the line.
70- * This should never get to be called in practice, and is purely defensive.
71- */
75+ // This specialization is a pass through runtime check, which allows a better
76+ // static_assert to catch this issue further down the line.
77+ // This should never get to be called in practice, and is purely defensive.
7278template <
7379 typename AdaptedType
7480>
@@ -85,6 +91,8 @@ get_message_type_support_handle()
8591 " should never be called" );
8692}
8793
94+ #endif
95+
8896} // namespace rclcpp
8997
9098#endif // RCLCPP__GET_MESSAGE_TYPE_SUPPORT_HANDLE_HPP_
0 commit comments