Skip to content

Commit c212a0d

Browse files
authored
Improved rcl docblock (#659)
* Improved rcl docblock Signed-off-by: ahcorde <ahcorde@gmail.com> * Added feedback Signed-off-by: ahcorde <ahcorde@gmail.com>
1 parent 75e4758 commit c212a0d

16 files changed

Lines changed: 34 additions & 19 deletions

rcl/include/rcl/context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ rcl_get_zero_initialized_context(void);
168168
* Lock-Free | Yes [1]
169169
* <i>[1] if `atomic_is_lock_free()` returns true for `atomic_uint_least64_t`</i>
170170
*
171+
* \param[inout] context object to be finalized.
171172
* \return `RCL_RET_OK` if the shutdown was completed successfully, or
172173
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
173174
* \return `RCL_RET_ERROR` if an unspecified error occur.

rcl/include/rcl/event.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ rcl_get_zero_initialized_event(void);
7272
* \param[in] event_type to listen for
7373
* \return `RCL_RET_OK` if the rcl_event_t is filled, or
7474
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
75+
* \return `RCL_RET_BAD_ALLOC` if allocating memory fails, or
7576
* \return `RCL_RET_UNSUPPORTED` if event_type is not supported, or
7677
* \return `RCL_RET_ERROR` if an unspecified error occurs.
7778
*/
@@ -92,6 +93,7 @@ rcl_publisher_event_init(
9293
* \param[in] event_type to listen for
9394
* \return `RCL_RET_OK` if the rcl_event_t is filled, or
9495
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
96+
* \return `RCL_RET_BAD_ALLOC` if allocating memory fails, or
9597
* \return `RCL_RET_UNSUPPORTED` if event_type is not supported, or
9698
* \return `RCL_RET_ERROR` if an unspecified error occurs.
9799
*/
@@ -109,9 +111,10 @@ rcl_subscription_event_init(
109111
*
110112
* \param[in] event_handle event object to take from
111113
* \param[in, out] event_info event info object to write taken data into
112-
* \param[in, out] taken boolean flag indicating if an event was taken or not
113114
* \return `RCL_RET_OK` if successful, or
115+
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
114116
* \return `RCL_RET_BAD_ALLOC` if memory allocation failed, or
117+
* \return `RCL_RET_EVENT_TAKE_FAILED` if the take event failed, or
115118
* \return `RCL_RET_ERROR` if an unexpected error occurs.
116119
*/
117120
RCL_PUBLIC

rcl/include/rcl/graph.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ rcl_names_and_types_fini(rcl_names_and_types_t * names_and_types);
430430
* \param[out] node_namesspaces struct storing discovered node namespaces
431431
* \return `RCL_RET_OK` if the query was successful, or
432432
* \return `RCL_RET_BAD_ALLOC` if an error occurred while allocating memory, or
433+
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
433434
* \return `RCL_RET_ERROR` if an unspecified error occurs.
434435
*/
435436
RCL_PUBLIC
@@ -462,6 +463,7 @@ rcl_get_node_names(
462463
* \param[out] enclaves struct storing discovered node enclaves
463464
* \return `RCL_RET_OK` if the query was successful, or
464465
* \return `RCL_RET_BAD_ALLOC` if an error occurred while allocating memory, or
466+
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
465467
* \return `RCL_RET_ERROR` if an unspecified error occurs.
466468
*/
467469
RCL_PUBLIC

rcl/include/rcl/init.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ rcl_init(
100100
* Lock-Free | Yes [1]
101101
* <i>[1] if `atomic_is_lock_free()` returns true for `atomic_uint_least64_t`</i>
102102
*
103+
* \param[inout] context object to shutdown
103104
* \return `RCL_RET_OK` if the shutdown was completed successfully, or
104105
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
105106
* \return `RCL_RET_ALREADY_SHUTDOWN` if the context is not currently valid, or

rcl/include/rcl/logging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ typedef rcutils_logging_output_handler_t rcl_logging_output_handler_t;
4747
* \param allocator Used to allocate memory used by the logging system
4848
* \return `RCL_RET_OK` if successful, or
4949
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
50+
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
5051
* \return `RCL_RET_ERR` if a general error occurs
5152
*/
5253
RCL_PUBLIC

rcl/include/rcl/logging_rosout.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ rcl_logging_rosout_fini();
9393
* Lock-Free | Yes
9494
*
9595
* \param[in] node a valid rcl_node_t that the publisher will be created on
96-
* \return `RCL_RET_OK` if the publisher was created successfully, or
97-
* \return `RCL_RET_ALREADY_INIT` if the publisher has already exists, or
98-
* \return `RCL_RET_NODE_INVALID` if any arguments are invalid, or
96+
* \return `RCL_RET_OK` if the logging publisher was created successfully, or
97+
* \return `RCL_RET_NODE_INVALID` if the argument is invalid, or
9998
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
10099
* \return `RCL_RET_ERROR` if an unspecified error occurs.
101100
*/
@@ -120,7 +119,7 @@ rcl_logging_rosout_init_publisher_for_node(
120119
* Lock-Free | Yes
121120
*
122121
* \param[in] node a valid rcl_node_t that the publisher will be created on
123-
* \return `RCL_RET_OK` if the publisher was created successfully, or
122+
* \return `RCL_RET_OK` if the logging publisher was finalized successfully, or
124123
* \return `RCL_RET_NODE_INVALID` if any arguments are invalid, or
125124
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
126125
* \return `RCL_RET_ERROR` if an unspecified error occurs.

rcl/include/rcl/node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ rcl_get_zero_initialized_node(void);
132132
* pass in.
133133
* \return `RCL_RET_OK` if the node was initialized successfully, or
134134
* \return `RCL_RET_ALREADY_INIT` if the node has already be initialized, or
135+
* \return `RCL_RET_NOT_INIT` if the given context is invalid, or
135136
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
136137
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
137138
* \return `RCL_RET_NODE_INVALID_NAME` if the name is invalid, or

rcl/include/rcl/node_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ typedef struct rcl_node_options_t
7171
* - domain_id = RCL_NODE_OPTIONS_DEFAULT_DOMAIN_ID
7272
* - allocator = rcl_get_default_allocator()
7373
* - use_global_arguments = true
74+
* - enable_rosout = true
7475
* - arguments = rcl_get_zero_initialized_arguments()
7576
*/
7677
RCL_PUBLIC

rcl/include/rcl/publisher.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ rcl_publisher_init(
152152
const rcl_node_t * node,
153153
const rosidl_message_type_support_t * type_support,
154154
const char * topic_name,
155-
const rcl_publisher_options_t * options
156-
);
155+
const rcl_publisher_options_t * options);
157156

158157
/// Finalize a rcl_publisher_t.
159158
/**
@@ -190,6 +189,7 @@ rcl_publisher_fini(rcl_publisher_t * publisher, rcl_node_t * node);
190189
*
191190
* - qos = rmw_qos_profile_default
192191
* - allocator = rcl_get_default_allocator()
192+
* - rmw_publisher_options = rmw_get_default_publisher_options()
193193
*/
194194
RCL_PUBLIC
195195
RCL_WARN_UNUSED
@@ -247,6 +247,7 @@ rcl_borrow_loaned_message(
247247
* \return `RCL_RET_OK` if successful, or
248248
* \return `RCL_RET_INVALID_ARGUMENT` if an argument is null, or
249249
* \return `RCL_RET_UNIMPLEMENTED` if the middleware does not support that feature, or
250+
* \return `RCL_RET_PUBLISHER_INVALID` if the publisher is invalid, or
250251
* \return `RCL_RET_ERROR` if an unexpected error occurs and no message can be initialized.
251252
*/
252253
RCL_PUBLIC
@@ -319,8 +320,7 @@ rcl_ret_t
319320
rcl_publish(
320321
const rcl_publisher_t * publisher,
321322
const void * ros_message,
322-
rmw_publisher_allocation_t * allocation
323-
);
323+
rmw_publisher_allocation_t * allocation);
324324

325325
/// Publish a serialized message on a topic using a publisher.
326326
/**
@@ -349,6 +349,7 @@ rcl_publish(
349349
* \param[in] serialized_message pointer to the already serialized message in raw form
350350
* \param[in] allocation structure pointer, used for memory preallocation (may be NULL)
351351
* \return `RCL_RET_OK` if the message was published successfully, or
352+
* \return `RCL_RET_BAD_ALLOC` if allocating memory failed, or
352353
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
353354
* \return `RCL_RET_PUBLISHER_INVALID` if the publisher is invalid, or
354355
* \return `RCL_RET_ERROR` if an unspecified error occurs.
@@ -359,8 +360,7 @@ rcl_ret_t
359360
rcl_publish_serialized_message(
360361
const rcl_publisher_t * publisher,
361362
const rcl_serialized_message_t * serialized_message,
362-
rmw_publisher_allocation_t * allocation
363-
);
363+
rmw_publisher_allocation_t * allocation);
364364

365365
/// Publish a loaned message on a topic using a publisher.
366366
/**
@@ -401,8 +401,7 @@ rcl_ret_t
401401
rcl_publish_loaned_message(
402402
const rcl_publisher_t * publisher,
403403
void * ros_message,
404-
rmw_publisher_allocation_t * allocation
405-
);
404+
rmw_publisher_allocation_t * allocation);
406405

407406
/// Manually assert that this Publisher is alive (for RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC)
408407
/**

rcl/include/rcl/security.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ extern "C"
5555
* \param[in] allocator used to do allocations.
5656
* \param[out] security_options security options that will be configured according to
5757
* the environment.
58+
* \return `RCL_RET_OK` If the security options are returned properly, or
59+
* \returns RCL_RET_INVALID_ARGUMENT if an argument is not valid, or
60+
* \returns RCL_RET_ERROR if an unexpected error happened
5861
*/
5962
RCL_PUBLIC
6063
rcl_ret_t

0 commit comments

Comments
 (0)