Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Subscription (BONUS: Allocators): rmw #353

Merged
merged 2 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions rmw/include/rmw/dynamic_message_type_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ extern "C"
{
#endif

#include <rcutils/allocator.h>

#include <rosidl_dynamic_typesupport/api/serialization_support.h>
#include <rosidl_dynamic_typesupport/dynamic_message_type_support_struct.h>
#include <rosidl_dynamic_typesupport/identifier.h>
Expand Down Expand Up @@ -57,9 +59,10 @@ rmw_take_dynamic_message_with_info(
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_get_serialization_support(
rmw_init_serialization_support(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: wouldn't this be rmw_serialization_support_init by other convention?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, yes, I can change it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change is rolled out across the stack!

const char * serialization_lib_name,
rosidl_dynamic_typesupport_serialization_support_t ** serialization_support); // OUT
rcutils_allocator_t * allocator,
rosidl_dynamic_typesupport_serialization_support_t * serialization_support); // OUT

// TODO(methylDragon): Nice to have only
// RMW_PUBLIC
Expand Down
23 changes: 23 additions & 0 deletions rmw/include/rmw/error_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,29 @@ typedef rcutils_error_state_t rmw_error_state_t;
/// Reset the error state by clearing any previously set error state.
#define rmw_reset_error rcutils_reset_error

/// Set the error message using RCUTILS_SET_ERROR_MSG and append the previous error.
/**
* If there is no previous error, has same behavior as RCUTILS_SET_ERROR_MSG.
* \param[in] msg The error message to be set.
*/
#define RMW_SET_ERROR_MSG_AND_APPEND_PREV_ERROR(msg) \
RCUTILS_SET_ERROR_MSG_AND_APPEND_PREV_ERROR(msg)

/// Set the error message with RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING and append the previous
/// error.
/**
* This function sets the error message using the given format string, and appends and resets the
* latest error string.
* The resulting formatted string is silently truncated at RCUTILS_ERROR_MESSAGE_MAX_LENGTH.
*
* If there is no previous error, has same behavior as RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING.
*
* \param[in] format_string The string to be used as the format of the error message.
* \param[in] ... Arguments for the format string.
*/
#define RMW_SET_ERROR_MSG_WITH_FORMAT_STRING_AND_APPEND_PREV_ERROR(format_string, ...) \
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING_AND_APPEND_PREV_ERROR(format_string, __VA_ARGS__)

#ifdef __cplusplus
}
#endif
Expand Down