Skip to content

Commit c23ca1b

Browse files
committed
Add documentation-only SFINAE functions' declarations
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
1 parent a75a468 commit c23ca1b

3 files changed

Lines changed: 31 additions & 8 deletions

File tree

rclcpp/Doxyfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ GENERATE_LATEX = NO
2121
ENABLE_PREPROCESSING = YES
2222
MACRO_EXPANSION = YES
2323
EXPAND_ONLY_PREDEF = YES
24+
PREDEFINED += DOXYGEN_ONLY
2425
PREDEFINED += RCLCPP_LOCAL=
2526
PREDEFINED += RCLCPP_PUBLIC=
2627
PREDEFINED += RCLCPP_PUBLIC_TYPE=

rclcpp/include/rclcpp/detail/qos_parameters.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ declare_parameter_or_get(
104104
}
105105
}
106106

107+
#ifdef DOXYGEN_ONLY
107108
/// \internal Declare QoS parameters for the given entity.
108109
/**
109110
* \tparam NodeT Node pointer or reference type.
@@ -116,6 +117,17 @@ declare_parameter_or_get(
116117
* \param default_qos User provided qos. It will be used as a default for the parameters declared.
117118
* \return qos profile based on the user provided parameter overrides.
118119
*/
120+
template<typename NodeT, typename EntityQosParametersTraits>
121+
rclcpp::QoS
122+
declare_qos_parameters(
123+
const ::rclcpp::QosOverridingOptions & options,
124+
NodeT & node,
125+
const std::string & topic_name,
126+
const ::rclcpp::QoS & default_qos,
127+
EntityQosParametersTraits);
128+
129+
#else
130+
119131
template<typename NodeT, typename EntityQosParametersTraits>
120132
std::enable_if_t<
121133
(rclcpp::node_interfaces::has_node_parameters_interface<
@@ -204,6 +216,8 @@ declare_qos_parameters(
204216
return default_qos;
205217
}
206218

219+
#endif
220+
207221
/// \internal Helper function to get a rmw qos policy value from a string.
208222
#define RCLCPP_DETAIL_APPLY_QOS_OVERRIDE_FROM_PARAMETER_STRING( \
209223
kind_lower, kind_upper, parameter_value, rclcpp_qos) \

rclcpp/include/rclcpp/get_message_type_support_handle.hpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@
2828
namespace 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+
3242
template<typename MessageT>
3343
constexpr
3444
typename 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.
4857
template<typename AdaptedType>
4958
constexpr
5059
typename 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.
7278
template<
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

Comments
 (0)