Skip to content

Commit

Permalink
Improve wide string (de)serialization in rwm_dynamic_fastrtps_cpp (#740)
Browse files Browse the repository at this point in the history
* Move type support headers to src

Signed-off-by: Miguel Company <[email protected]>

* Fix references to moved headers

Signed-off-by: Miguel Company <[email protected]>

* move macros.hpp to src/serialization_helpers.hpp

Signed-off-by: Miguel Company <[email protected]>

* Move other non-api headers

Signed-off-by: Miguel Company <[email protected]>

* Move common code into serialize_wide_string.

Signed-off-by: Miguel Company <[email protected]>

* Move common code into deserialize_wide_string.

Signed-off-by: Miguel Company <[email protected]>

* Move serialization into serialization_helpers.hpp

Signed-off-by: Miguel Company <[email protected]>

* Move deserialization into serialization_helpers.hpp

Signed-off-by: Miguel Company <[email protected]>

* Fix header guards

Signed-off-by: Miguel Company <[email protected]>

* Linters

Signed-off-by: Miguel Company <[email protected]>

* Do not account for extra character on serialized size calculation

Signed-off-by: Miguel Company <[email protected]>

* Remove dependency on rosidl_typesupport_fastrtps_c(pp)

Signed-off-by: Miguel Company <[email protected]>

---------

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany committed Feb 20, 2024
1 parent 117c648 commit e21254c
Show file tree
Hide file tree
Showing 24 changed files with 171 additions and 130 deletions.
6 changes: 0 additions & 6 deletions rmw_fastrtps_dynamic_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ find_package(FastRTPS 2.10 REQUIRED MODULE)

find_package(rmw REQUIRED)
find_package(rosidl_runtime_c REQUIRED)
find_package(rosidl_typesupport_fastrtps_c REQUIRED)
find_package(rosidl_typesupport_fastrtps_cpp REQUIRED)
find_package(rosidl_typesupport_introspection_c REQUIRED)
find_package(rosidl_typesupport_introspection_cpp REQUIRED)

Expand Down Expand Up @@ -108,8 +106,6 @@ target_link_libraries(rmw_fastrtps_dynamic_cpp PUBLIC
rmw::rmw
rmw_fastrtps_shared_cpp::rmw_fastrtps_shared_cpp
rosidl_runtime_c::rosidl_runtime_c
rosidl_typesupport_fastrtps_c::rosidl_typesupport_fastrtps_c
rosidl_typesupport_fastrtps_cpp::rosidl_typesupport_fastrtps_cpp
rosidl_typesupport_introspection_c::rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp::rosidl_typesupport_introspection_cpp
)
Expand All @@ -135,8 +131,6 @@ ament_export_dependencies(
rmw
rmw_fastrtps_shared_cpp
rosidl_runtime_c
rosidl_typesupport_fastrtps_c
rosidl_typesupport_fastrtps_cpp
rosidl_typesupport_introspection_c
rosidl_typesupport_introspection_cpp
)
Expand Down
2 changes: 0 additions & 2 deletions rmw_fastrtps_dynamic_cpp/QUALITY_DECLARATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ Results of the nightly linter tests can be found [here](https://ci.ros2.org/view
* `rmw_dds_common`: [QUALITY DECLARATION](https://github.com/ros2/rmw_dds_common/blob/master/rmw_dds_common/QUALITY_DECLARATION.md)
* `rmw_fastrtps_shared_cpp`: [QUALITY DECLARATION](https://github.com/ros2/rmw_fastrtps/blob/master/rmw_fastrtps_shared_cpp/QUALITY_DECLARATION.md)
* `rosidl_runtime_c`: [QUALITY DECLARATION](https://github.com/ros2/rosidl/blob/master/rosidl_runtime_c/QUALITY_DECLARATION.md)
* `rosidl_typesupport_fastrtps_c`: [QUALITY DECLARATION](https://github.com/ros2/rosidl_typesupport_fastrtps/blob/master/rosidl_typesupport_fastrtps_c/QUALITY_DECLARATION.md)
* `rosidl_typesupport_fastrtps_cpp`: [QUALITY DECLARATION](https://github.com/ros2/rosidl_typesupport_fastrtps/blob/master/rosidl_typesupport_fastrtps_cpp/QUALITY_DECLARATION.md)
* `rosidl_typesupport_introspection_c`
* `rosidl_typesupport_introspection_cpp`

Expand Down

This file was deleted.

4 changes: 0 additions & 4 deletions rmw_fastrtps_dynamic_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<build_depend>rmw_dds_common</build_depend>
<build_depend>rmw_fastrtps_shared_cpp</build_depend>
<build_depend>rosidl_runtime_c</build_depend>
<build_depend>rosidl_typesupport_fastrtps_c</build_depend>
<build_depend>rosidl_typesupport_fastrtps_cpp</build_depend>
<build_depend>rosidl_typesupport_introspection_c</build_depend>
<build_depend>rosidl_typesupport_introspection_cpp</build_depend>

Expand All @@ -43,8 +41,6 @@
<build_export_depend>rmw_dds_common</build_export_depend>
<build_export_depend>rmw_fastrtps_shared_cpp</build_export_depend>
<build_export_depend>rosidl_runtime_c</build_export_depend>
<build_export_depend>rosidl_typesupport_fastrtps_c</build_export_depend>
<build_export_depend>rosidl_typesupport_fastrtps_cpp</build_export_depend>
<build_export_depend>rosidl_typesupport_introspection_c</build_export_depend>
<build_export_depend>rosidl_typesupport_introspection_cpp</build_export_depend>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW_FASTRTPS_DYNAMIC_CPP__MESSAGETYPESUPPORT_HPP_
#define RMW_FASTRTPS_DYNAMIC_CPP__MESSAGETYPESUPPORT_HPP_
#ifndef MESSAGETYPESUPPORT_HPP_
#define MESSAGETYPESUPPORT_HPP_

#include <cassert>
#include <memory>
Expand All @@ -39,4 +39,4 @@ class MessageTypeSupport : public TypeSupport<MembersType>

#include "MessageTypeSupport_impl.hpp"

#endif // RMW_FASTRTPS_DYNAMIC_CPP__MESSAGETYPESUPPORT_HPP_
#endif // MESSAGETYPESUPPORT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW_FASTRTPS_DYNAMIC_CPP__MESSAGETYPESUPPORT_IMPL_HPP_
#define RMW_FASTRTPS_DYNAMIC_CPP__MESSAGETYPESUPPORT_IMPL_HPP_
#ifndef MESSAGETYPESUPPORT_IMPL_HPP_
#define MESSAGETYPESUPPORT_IMPL_HPP_

#include <cassert>
#include <memory>
Expand All @@ -25,7 +25,7 @@

#include "rcpputils/find_and_replace.hpp"

#include "rmw_fastrtps_dynamic_cpp/MessageTypeSupport.hpp"
#include "MessageTypeSupport.hpp"
#include "rosidl_typesupport_introspection_cpp/field_types.hpp"

namespace rmw_fastrtps_dynamic_cpp
Expand Down Expand Up @@ -66,4 +66,4 @@ MessageTypeSupport<MembersType>::MessageTypeSupport(

} // namespace rmw_fastrtps_dynamic_cpp

#endif // RMW_FASTRTPS_DYNAMIC_CPP__MESSAGETYPESUPPORT_IMPL_HPP_
#endif // MESSAGETYPESUPPORT_IMPL_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW_FASTRTPS_DYNAMIC_CPP__SERVICETYPESUPPORT_HPP_
#define RMW_FASTRTPS_DYNAMIC_CPP__SERVICETYPESUPPORT_HPP_
#ifndef SERVICETYPESUPPORT_HPP_
#define SERVICETYPESUPPORT_HPP_

#include <cassert>

Expand Down Expand Up @@ -44,4 +44,4 @@ class ResponseTypeSupport : public TypeSupport<MessageMembersType>

#include "ServiceTypeSupport_impl.hpp"

#endif // RMW_FASTRTPS_DYNAMIC_CPP__SERVICETYPESUPPORT_HPP_
#endif // SERVICETYPESUPPORT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW_FASTRTPS_DYNAMIC_CPP__SERVICETYPESUPPORT_IMPL_HPP_
#define RMW_FASTRTPS_DYNAMIC_CPP__SERVICETYPESUPPORT_IMPL_HPP_
#ifndef SERVICETYPESUPPORT_IMPL_HPP_
#define SERVICETYPESUPPORT_IMPL_HPP_

#include <cassert>
#include <sstream>
Expand All @@ -24,7 +24,7 @@

#include "rcpputils/find_and_replace.hpp"

#include "rmw_fastrtps_dynamic_cpp/ServiceTypeSupport.hpp"
#include "ServiceTypeSupport.hpp"
#include "rosidl_typesupport_introspection_cpp/field_types.hpp"

namespace rmw_fastrtps_dynamic_cpp
Expand Down Expand Up @@ -98,4 +98,4 @@ ResponseTypeSupport<ServiceMembersType, MessageMembersType>::ResponseTypeSupport

} // namespace rmw_fastrtps_dynamic_cpp

#endif // RMW_FASTRTPS_DYNAMIC_CPP__SERVICETYPESUPPORT_IMPL_HPP_
#endif // SERVICETYPESUPPORT_IMPL_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RMW_FASTRTPS_DYNAMIC_CPP__TYPESUPPORT_HPP_
#define RMW_FASTRTPS_DYNAMIC_CPP__TYPESUPPORT_HPP_
#ifndef TYPESUPPORT_HPP_
#define TYPESUPPORT_HPP_

#include <cassert>
#include <string>
Expand Down Expand Up @@ -198,4 +198,4 @@ class TypeSupport : public BaseTypeSupport

#include "TypeSupport_impl.hpp"

#endif // RMW_FASTRTPS_DYNAMIC_CPP__TYPESUPPORT_HPP_
#endif // TYPESUPPORT_HPP_
Loading

0 comments on commit e21254c

Please sign in to comment.