Skip to content

Commit bdbc054

Browse files
committed
Cleanup documentation for doxygen.
In particular: 1. Add in @file on all of the files we want indexed (otherwise Doxygen just ignores them). 2. Make sure to document all things that are missing (as pointed out by Doxygen). 3. Switch to #ENUM to reference enums (this makes Doxygen put links in properly). 4. Switch from `my_func` or `my_func()` to my_func() everywhere (Doxygen supports all 3 for making links, but for consistency we just stick with one style). 5. Hide a few things from Doxygen. 6. Switch all \returns to \return (Doxygen supports both, but we should be consistent). Signed-off-by: Chris Lalancette <[email protected]>
1 parent 4740c82 commit bdbc054

31 files changed

+955
-712
lines changed

rcl/include/rcl/allocator.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/// @file
16+
1517
#ifndef RCL__ALLOCATOR_H_
1618
#define RCL__ALLOCATOR_H_
1719

@@ -22,15 +24,35 @@ extern "C"
2224

2325
#include "rcutils/allocator.h"
2426

27+
/// Encapsulation of an allocator.
28+
/**
29+
* \sa rcutils_allocator_t
30+
*/
2531
typedef rcutils_allocator_t rcl_allocator_t;
2632

33+
/// Return a properly initialized rcutils_allocator_t with default values.
34+
/**
35+
* \sa rcutils_get_default_allocator()
36+
*/
2737
#define rcl_get_default_allocator rcutils_get_default_allocator
2838

39+
/// Emulate the behavior of [reallocf](https://linux.die.net/man/3/reallocf).
40+
/**
41+
* \sa rcutils_reallocf()
42+
*/
2943
#define rcl_reallocf rcutils_reallocf
3044

45+
/// Check that the given allocator is initialized.
46+
/**
47+
* If the allocator is not initialized, run the fail_statement.
48+
*/
3149
#define RCL_CHECK_ALLOCATOR(allocator, fail_statement) \
3250
RCUTILS_CHECK_ALLOCATOR(allocator, fail_statement)
3351

52+
/// Check that the given allocator is initialized, or fail with a message.
53+
/**
54+
* If the allocator is not initialized, set the error to msg, and run the fail_statement.
55+
*/
3456
#define RCL_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement) \
3557
RCUTILS_CHECK_ALLOCATOR_WITH_MSG(allocator, msg, fail_statement)
3658

rcl/include/rcl/arguments.h

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/// @file
16+
1517
#ifndef RCL__ARGUMENTS_H_
1618
#define RCL__ARGUMENTS_H_
1719

@@ -36,20 +38,49 @@ typedef struct rcl_arguments_t
3638
struct rcl_arguments_impl_t * impl;
3739
} rcl_arguments_t;
3840

41+
/// The command-line flag that delineates the start of ROS arguments.
3942
#define RCL_ROS_ARGS_FLAG "--ros-args"
43+
44+
/// The token that delineates the explicit end of ROS arguments.
4045
#define RCL_ROS_ARGS_EXPLICIT_END_TOKEN "--"
46+
47+
/// The ROS flag that precedes the setting of a ROS parameter.
4148
#define RCL_PARAM_FLAG "--param"
49+
50+
/// The short version of the ROS flag that precedes the setting of a ROS parameter.
4251
#define RCL_SHORT_PARAM_FLAG "-p"
52+
53+
/// The ROS flag that precedes a path to a file containing ROS parameters.
4354
#define RCL_PARAM_FILE_FLAG "--params-file"
55+
56+
/// The ROS flag that precedes a ROS remapping rule.
4457
#define RCL_REMAP_FLAG "--remap"
58+
59+
/// The short version of the ROS flag that precedes a ROS remapping rule.
4560
#define RCL_SHORT_REMAP_FLAG "-r"
61+
62+
/// The ROS flag that precedes the name of a ROS security enclave.
4663
#define RCL_ENCLAVE_FLAG "--enclave"
64+
65+
/// The short version of the ROS flag that precedes the name of a ROS security enclave.
4766
#define RCL_SHORT_ENCLAVE_FLAG "-e"
67+
68+
/// The ROS flag that precedes the ROS logging level to set.
4869
#define RCL_LOG_LEVEL_FLAG "--log-level"
70+
71+
/// The ROS flag that precedes the name of a configuration file to configure logging.
4972
#define RCL_EXTERNAL_LOG_CONFIG_FLAG "--log-config-file"
50-
// To be prefixed with --enable- or --disable-
73+
74+
/// The suffix of the ROS flag to enable or disable stdout
75+
/// logging (must be preceded with --enable- or --disable-).
5176
#define RCL_LOG_STDOUT_FLAG_SUFFIX "stdout-logs"
77+
78+
/// The suffix of the ROS flag to enable or disable rosout
79+
/// logging (must be preceded with --enable- or --disable-).
5280
#define RCL_LOG_ROSOUT_FLAG_SUFFIX "rosout-logs"
81+
82+
/// The suffix of the ROS flag to enable or disable external library
83+
/// logging (must be preceded with --enable- or --disable-).
5384
#define RCL_LOG_EXT_LIB_FLAG_SUFFIX "external-lib-logs"
5485

5586
/// Return a rcl_arguments_t struct with members initialized to `NULL`.
@@ -109,11 +140,11 @@ rcl_get_zero_initialized_arguments(void);
109140
* \param[in] allocator A valid allocator.
110141
* \param[out] args_output A structure that will contain the result of parsing.
111142
* Must be zero initialized before use.
112-
* \return `RCL_RET_OK` if the arguments were parsed successfully, or
113-
* \return `RCL_RET_INVALID_ROS_ARGS` if an invalid ROS argument is found, or
114-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
115-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
116-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
143+
* \return #RCL_RET_OK if the arguments were parsed successfully, or
144+
* \return #RCL_RET_INVALID_ROS_ARGS if an invalid ROS argument is found, or
145+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
146+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
147+
* \return #RCL_RET_ERROR if an unspecified error occurs.
117148
*/
118149
RCL_PUBLIC
119150
RCL_WARN_UNUSED
@@ -164,10 +195,10 @@ rcl_arguments_get_count_unparsed(
164195
* \param[out] output_unparsed_indices An allocated array of indices into the original argv array.
165196
* This array must be deallocated by the caller using the given allocator.
166197
* If there are no unparsed args then the output will be set to NULL.
167-
* \return `RCL_RET_OK` if everything goes correctly, or
168-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
169-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
170-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
198+
* \return #RCL_RET_OK if everything goes correctly, or
199+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
200+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
201+
* \return #RCL_RET_ERROR if an unspecified error occurs.
171202
*/
172203
RCL_PUBLIC
173204
RCL_WARN_UNUSED
@@ -216,10 +247,10 @@ rcl_arguments_get_count_unparsed_ros(
216247
* \param[out] output_unparsed_ros_indices An allocated array of indices into the original argv array.
217248
* This array must be deallocated by the caller using the given allocator.
218249
* If there are no unparsed ROS specific arguments then the output will be set to NULL.
219-
* \return `RCL_RET_OK` if everything goes correctly, or
220-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
221-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
222-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
250+
* \return #RCL_RET_OK if everything goes correctly, or
251+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
252+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
253+
* \return #RCL_RET_ERROR if an unspecified error occurs.
223254
*/
224255
RCL_PUBLIC
225256
RCL_WARN_UNUSED
@@ -265,10 +296,10 @@ rcl_arguments_get_param_files_count(
265296
* \param[out] parameter_files An allocated array of paramter file names.
266297
* This array must be deallocated by the caller using the given allocator.
267298
* The output is NULL if there were no paramter files.
268-
* \return `RCL_RET_OK` if everything goes correctly, or
269-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
270-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
271-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
299+
* \return #RCL_RET_OK if everything goes correctly, or
300+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
301+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
302+
* \return #RCL_RET_ERROR if an unspecified error occurs.
272303
*/
273304
RCL_PUBLIC
274305
RCL_WARN_UNUSED
@@ -295,10 +326,10 @@ rcl_arguments_get_param_files(
295326
* \param[out] parameter_overrides Parameter overrides as parsed from command line arguments.
296327
* This structure must be finalized by the caller.
297328
* The output is NULL if no parameter overrides were parsed.
298-
* \return `RCL_RET_OK` if everything goes correctly, or
299-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
300-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
301-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
329+
* \return #RCL_RET_OK if everything goes correctly, or
330+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
331+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
332+
* \return #RCL_RET_ERROR if an unspecified error occurs.
302333
*/
303334
RCL_PUBLIC
304335
RCL_WARN_UNUSED
@@ -329,10 +360,10 @@ rcl_arguments_get_param_overrides(
329360
* \param[out] nonros_argv An allocated array of arguments that aren't ROS-specific
330361
* This array must be deallocated by the caller using the given allocator.
331362
* If there are no non-ROS args, then the output will be set to NULL.
332-
* \return `RCL_RET_OK` if everything goes correctly, or
333-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
334-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
335-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
363+
* \return #RCL_RET_OK if everything goes correctly, or
364+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
365+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
366+
* \return #RCL_RET_ERROR if an unspecified error occurs.
336367
*/
337368
RCL_PUBLIC
338369
RCL_WARN_UNUSED
@@ -359,9 +390,9 @@ rcl_remove_ros_arguments(
359390
* \param[in] arguments An arguments structure that has been parsed.
360391
* \param[out] log_levels Log levels as parsed from command line arguments.
361392
* The output must be finished by the caller if the function successes.
362-
* \return `RCL_RET_OK` if everything goes correctly, or
363-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
364-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed.
393+
* \return #RCL_RET_OK if everything goes correctly, or
394+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
395+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed.
365396
*/
366397
RCL_PUBLIC
367398
RCL_WARN_UNUSED
@@ -383,10 +414,10 @@ rcl_arguments_get_log_levels(
383414
* \param[in] args The structure to be copied.
384415
* Its allocator is used to copy memory into the new structure.
385416
* \param[out] args_out A zero-initialized arguments structure to be copied into.
386-
* \return `RCL_RET_OK` if the structure was copied successfully, or
387-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
388-
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
389-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
417+
* \return #RCL_RET_OK if the structure was copied successfully, or
418+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
419+
* \return #RCL_RET_BAD_ALLOC if allocating memory failed, or
420+
* \return #RCL_RET_ERROR if an unspecified error occurs.
390421
*/
391422
RCL_PUBLIC
392423
RCL_WARN_UNUSED
@@ -406,9 +437,9 @@ rcl_arguments_copy(
406437
* Lock-Free | Yes
407438
*
408439
* \param[in] args The structure to be deallocated.
409-
* \return `RCL_RET_OK` if the memory was successfully freed, or
410-
* \return `RCL_RET_INVALID_ARGUMENT` if any function arguments are invalid, or
411-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
440+
* \return #RCL_RET_OK if the memory was successfully freed, or
441+
* \return #RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
442+
* \return #RCL_RET_ERROR if an unspecified error occurs.
412443
*/
413444
RCL_PUBLIC
414445
RCL_WARN_UNUSED

rcl/include/rcl/client.h

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/// @file
16+
1517
#ifndef RCL__CLIENT_H_
1618
#define RCL__CLIENT_H_
1719

@@ -142,13 +144,13 @@ rcl_get_zero_initialized_client(void);
142144
* \param[in] type_support type support object for the service's type
143145
* \param[in] service_name the name of the service to request
144146
* \param[in] options client options, including quality of service settings
145-
* \return `RCL_RET_OK` if the client was initialized successfully, or
146-
* \return `RCL_RET_NODE_INVALID` if the node is invalid, or
147-
* \return `RCL_RET_ALREADY_INIT` if the client is already initialized, or
148-
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
149-
* \return `RCL_RET_BAD_ALLOC` if allocating memory fails, or
150-
* \return `RCL_RET_SERVICE_NAME_INVALID` if the given service name is invalid, or
151-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
147+
* \return #RCL_RET_OK if the client was initialized successfully, or
148+
* \return #RCL_RET_NODE_INVALID if the node is invalid, or
149+
* \return #RCL_RET_ALREADY_INIT if the client is already initialized, or
150+
* \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
151+
* \return #RCL_RET_BAD_ALLOC if allocating memory fails, or
152+
* \return #RCL_RET_SERVICE_NAME_INVALID if the given service name is invalid, or
153+
* \return #RCL_RET_ERROR if an unspecified error occurs.
152154
*/
153155
RCL_PUBLIC
154156
RCL_WARN_UNUSED
@@ -176,10 +178,10 @@ rcl_client_init(
176178
*
177179
* \param[inout] client handle to the client to be finalized
178180
* \param[in] node a valid (not finalized) handle to the node used to create the client
179-
* \return `RCL_RET_OK` if client was finalized successfully, or
180-
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
181-
* \return `RCL_RET_NODE_INVALID` if the node is invalid, or
182-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
181+
* \return #RCL_RET_OK if client was finalized successfully, or
182+
* \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
183+
* \return #RCL_RET_NODE_INVALID if the node is invalid, or
184+
* \return #RCL_RET_ERROR if an unspecified error occurs.
183185
*/
184186
RCL_PUBLIC
185187
RCL_WARN_UNUSED
@@ -237,10 +239,10 @@ rcl_client_get_default_options(void);
237239
* \param[in] client handle to the client which will make the response
238240
* \param[in] ros_request type-erased pointer to the ROS request message
239241
* \param[out] sequence_number the sequence number
240-
* \return `RCL_RET_OK` if the request was sent successfully, or
241-
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
242-
* \return `RCL_RET_CLIENT_INVALID` if the client is invalid, or
243-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
242+
* \return #RCL_RET_OK if the request was sent successfully, or
243+
* \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
244+
* \return #RCL_RET_CLIENT_INVALID if the client is invalid, or
245+
* \return #RCL_RET_ERROR if an unspecified error occurs.
244246
*/
245247
RCL_PUBLIC
246248
RCL_WARN_UNUSED
@@ -276,12 +278,12 @@ rcl_send_request(const rcl_client_t * client, const void * ros_request, int64_t
276278
* \param[in] client handle to the client which will take the response
277279
* \param[inout] request_header pointer to the request header
278280
* \param[inout] ros_response type-erased pointer to the ROS response message
279-
* \return `RCL_RET_OK` if the response was taken successfully, or
280-
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
281-
* \return `RCL_RET_CLIENT_INVALID` if the client is invalid, or
282-
* \return `RCL_RET_CLIENT_TAKE_FAILED` if take failed but no error occurred
281+
* \return #RCL_RET_OK if the response was taken successfully, or
282+
* \return #RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
283+
* \return #RCL_RET_CLIENT_INVALID if the client is invalid, or
284+
* \return #RCL_RET_CLIENT_TAKE_FAILED if take failed but no error occurred
283285
* in the middleware, or
284-
* \return `RCL_RET_ERROR` if an unspecified error occurs.
286+
* \return #RCL_RET_ERROR if an unspecified error occurs.
285287
*/
286288
RCL_PUBLIC
287289
RCL_WARN_UNUSED

0 commit comments

Comments
 (0)