-
Notifications
You must be signed in to change notification settings - Fork 37
Support topic instances #178
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
Changes from all commits
9d0f1ee
9cfa355
5e9b37b
2b61978
828841a
579e33e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| #ifndef RMW_CONNEXTDDS__TYPE_SUPPORT_HPP_ | ||
| #define RMW_CONNEXTDDS__TYPE_SUPPORT_HPP_ | ||
|
|
||
| #include <cstdint> | ||
| #include <string> | ||
| #include <stdexcept> | ||
|
|
||
|
|
@@ -56,10 +57,16 @@ struct RMW_Connext_RequestReplyMessage | |
|
|
||
| class RMW_Connext_MessageTypeSupport | ||
| { | ||
| const rosidl_message_type_support_t * _message_type_support; | ||
| const rosidl_message_type_support_t * _type_support_fastrtps; | ||
| message_type_support_key_callbacks_t _key_callbacks; | ||
| bool _unbounded; | ||
| bool _empty; | ||
| bool _keyed; | ||
| bool _unbounded_key; | ||
| bool _is_cpp; | ||
| uint32_t _serialized_size_max; | ||
| uint32_t _key_serialized_size_max; | ||
| std::string _type_name; | ||
| RMW_Connext_MessageType _message_type; | ||
| rmw_context_impl_t * const _ctx; | ||
|
|
@@ -79,6 +86,11 @@ class RMW_Connext_MessageTypeSupport | |
| this->_type_support_fastrtps->data); | ||
| } | ||
|
|
||
| const rosidl_message_type_support_t * message_type_support() const | ||
| { | ||
| return this->_message_type_support; | ||
| } | ||
|
|
||
| rmw_context_impl_t * ctx() const | ||
| { | ||
| return this->_ctx; | ||
|
|
@@ -99,6 +111,14 @@ class RMW_Connext_MessageTypeSupport | |
| return this->_serialized_size_max; | ||
| } | ||
|
|
||
| uint32_t type_key_serialized_size_max() const | ||
| { | ||
| if (!this->_keyed) { | ||
| return 0; | ||
| } | ||
| return this->_key_serialized_size_max; | ||
| } | ||
|
|
||
| bool unbounded() const | ||
| { | ||
| return this->_unbounded; | ||
|
|
@@ -109,6 +129,21 @@ class RMW_Connext_MessageTypeSupport | |
| return this->_empty; | ||
| } | ||
|
|
||
| bool keyed() const | ||
| { | ||
| return this->_keyed; | ||
| } | ||
|
|
||
| bool unbounded_key() const | ||
| { | ||
| return this->_unbounded_key; | ||
| } | ||
|
|
||
| bool is_cpp() const | ||
| { | ||
| return this->_is_cpp; | ||
| } | ||
|
|
||
| RMW_Connext_MessageType message_type() const | ||
| { | ||
| return this->_message_type; | ||
|
|
@@ -139,14 +174,32 @@ class RMW_Connext_MessageTypeSupport | |
|
|
||
| rmw_ret_t serialize( | ||
| const void * const ros_msg, | ||
| rcutils_uint8_array_t * const to_buffer); | ||
| rcutils_uint8_array_t * const to_buffer, | ||
| const bool include_encapsulation = true); | ||
|
|
||
| rmw_ret_t deserialize( | ||
| void * const ros_msg, | ||
| const rcutils_uint8_array_t * const from_buffer, | ||
| size_t & size_out, | ||
| const bool header_only = false); | ||
|
|
||
| rmw_ret_t serialize_key( | ||
| const void * const ros_msg, | ||
| rcutils_uint8_array_t * const to_buffer, | ||
| RTIEncapsulationId encapsulation_id, | ||
| const bool include_encapsulation = true); | ||
|
|
||
| // Not available in message_type_support_key_callbacks_t yet | ||
| // | ||
| // Because deserialize_key is not supported yet there will be errors receiving dispose samples | ||
| // that have the serialized key as payload and the sample will be reported as lost. | ||
| // | ||
| // By default, dispose samples do not contain the serialized key, so this should only be a | ||
| // problem if the DataWriterQos.protocol.serialize_key_with_dispose is set to true. | ||
|
Comment on lines
+196
to
+197
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if the user configure
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think many ROS 2 users will use this or find themselves in this codepath. However, we are planning to polish the Keyed Topics implementation later on to cover all these corner cases |
||
| // | ||
| // rmw_ret_t deserialize_key( | ||
| // void * const ros_msg, | ||
| // const rcutils_uint8_array_t * const from_buffer); | ||
|
|
||
| static | ||
| RMW_Connext_MessageTypeSupport * | ||
| register_type_support( | ||
|
|
@@ -174,7 +227,11 @@ class RMW_Connext_MessageTypeSupport | |
| const rosidl_message_type_support_t * const type_support, | ||
| uint32_t & serialized_size_max, | ||
| bool & unbounded, | ||
| bool & empty); | ||
| bool & empty, | ||
| bool & keyed, | ||
| bool & unbounded_key, | ||
| message_type_support_key_callbacks_t & key_callbacks, | ||
| uint32_t & key_serialized_size_max); | ||
| }; | ||
|
|
||
| struct RMW_Connext_Message | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.