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

Adapt new interface #21

Merged
merged 14 commits into from
Aug 21, 2018
Prev Previous commit
Next Next commit
Move const to better location
  • Loading branch information
Martin-Idel-SI committed Aug 21, 2018
commit 723a45554bb6635929f1e6cbe1f05ebff8d9bf27
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ROSBAG2_STORAGE_PUBLIC BaseWriteInterface
public:
virtual ~BaseWriteInterface() = default;

virtual void write(const std::shared_ptr<SerializedBagMessage> msg) = 0;
virtual void write(std::shared_ptr<const SerializedBagMessage> msg) = 0;

virtual void create_topic() = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_storage/test/test_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void TestPlugin::create_topic()
std::cout << "\ncreating topic\n";
}

void TestPlugin::write(const std::shared_ptr<rosbag2_storage::SerializedBagMessage> msg)
void TestPlugin::write(const std::shared_ptr<const rosbag2_storage::SerializedBagMessage> msg)
{
(void) msg;
std::cout << "\nwriting\n";
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_storage/test/test_plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestPlugin : public rosbag2_storage::storage_interfaces::ReadWriteInterfac

void create_topic() override;

void write(std::shared_ptr<rosbag2_storage::SerializedBagMessage> msg) override;
void write(std::shared_ptr<const rosbag2_storage::SerializedBagMessage> msg) override;
};

#endif // TEST_PLUGIN_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void SqliteStorage::open(
RCUTILS_LOG_INFO_NAMED(ROS_PACKAGE_NAME, "Opened database '%s'.", uri.c_str());
}

void SqliteStorage::write(std::shared_ptr<rosbag2_storage::SerializedBagMessage> message)
void SqliteStorage::write(std::shared_ptr<const rosbag2_storage::SerializedBagMessage> message)
{
// TODO(Martin-Idel-SI) The real serialized string message has 8 leading chars in CDR
std::string msg(&message->serialized_data->buffer[8]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SqliteStorage : public rosbag2_storage::storage_interfaces::ReadWriteInter

void create_topic() override;

void write(std::shared_ptr<rosbag2_storage::SerializedBagMessage> message) override;
void write(std::shared_ptr<const rosbag2_storage::SerializedBagMessage> message) override;

bool has_next() const override;

Expand Down