forked from ros2/rclcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ros2GH-134 Split converter interface into Serializer and Deserializer - Allow plugins which can only read or write - Most important example: plugin for old rosbags * ros2GH-134 Switch to using serializer and deserializer in factory * ros2GH-134 Add test for serializer plugin * ros2GH-134 Try to load Serializer and Deserializer - When loading a serializer, try to load both serializer and converter - Similar for deserializers * ros2GH-134 Fix e2e test after improving error message for missing converters * ros2GH-134 Remove duplicate code in converter factory * ros2GH-134 Change namespace of converter interfaces - adapt namespaces to folder structure - folder structure similar to rosbag2_storage * ros2GH-134 Hide pluginlib import via pimpl - We want to use template functions that require the pluginlib import - The pluginlib import should not be exported (this creates issues with downstream packages) - Similar to the storage factory, use a pimpl * ros2GH-134 Adapt documentation * Minor documentation updates Co-Authored-By: Martin-Idel-SI <external.Martin.Idel@bosch-si.com> * ros2GH-134 Rename converter interface to drop "interface" - already visible from namespace
- Loading branch information
1 parent
366d750
commit ffbca3e
Showing
28 changed files
with
424 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
rosbag2/include/rosbag2/converter_interfaces/serialization_format_converter.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2018, Bosch Software Innovations GmbH. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSBAG2__CONVERTER_INTERFACES__SERIALIZATION_FORMAT_CONVERTER_HPP_ | ||
#define ROSBAG2__CONVERTER_INTERFACES__SERIALIZATION_FORMAT_CONVERTER_HPP_ | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "rosbag2/types/introspection_message.hpp" | ||
#include "rosbag2/types.hpp" | ||
#include "rcutils/types.h" | ||
#include "rosbag2_storage/serialized_bag_message.hpp" | ||
#include "rosidl_typesupport_cpp/message_type_support.hpp" | ||
#include "rosbag2/converter_interfaces/serialization_format_serializer.hpp" | ||
#include "rosbag2/converter_interfaces/serialization_format_deserializer.hpp" | ||
|
||
/** | ||
* This is a convenience class for plugin developers. When developing a plugin to both write and | ||
* read a specified serialization format, inherit from this class | ||
*/ | ||
namespace rosbag2 | ||
{ | ||
|
||
namespace converter_interfaces | ||
{ | ||
|
||
class SerializationFormatConverter | ||
: public SerializationFormatSerializer, public SerializationFormatDeserializer | ||
{}; | ||
|
||
} // namespace converter_interfaces | ||
} // namespace rosbag2 | ||
|
||
#endif // ROSBAG2__CONVERTER_INTERFACES__SERIALIZATION_FORMAT_CONVERTER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
rosbag2/include/rosbag2/converter_interfaces/serialization_format_serializer.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2018, Bosch Software Innovations GmbH. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSBAG2__CONVERTER_INTERFACES__SERIALIZATION_FORMAT_SERIALIZER_HPP_ | ||
#define ROSBAG2__CONVERTER_INTERFACES__SERIALIZATION_FORMAT_SERIALIZER_HPP_ | ||
|
||
#include <memory> | ||
|
||
#include "rosbag2/types/introspection_message.hpp" | ||
#include "rosbag2/types.hpp" | ||
|
||
namespace rosbag2 | ||
{ | ||
|
||
namespace converter_interfaces | ||
{ | ||
|
||
class SerializationFormatSerializer | ||
{ | ||
public: | ||
virtual ~SerializationFormatSerializer() = default; | ||
|
||
virtual void serialize( | ||
std::shared_ptr<const rosbag2_introspection_message_t> ros_message, | ||
const rosidl_message_type_support_t * type_support, | ||
std::shared_ptr<rosbag2::SerializedBagMessage> serialized_message) = 0; | ||
}; | ||
|
||
} // namespace converter_interfaces | ||
} // namespace rosbag2 | ||
|
||
#endif // ROSBAG2__CONVERTER_INTERFACES__SERIALIZATION_FORMAT_SERIALIZER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.