Skip to content

Commit

Permalink
fix windows compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
  • Loading branch information
Karsten1987 committed Apr 21, 2020
1 parent 3591841 commit 1b87de0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions rclcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ if(BUILD_TESTING)
"rcl"
"test_msgs"
)
target_link_libraries(test_subscription_traits ${PROJECT_NAME})
endif()
ament_add_gtest(test_find_weak_nodes test/test_find_weak_nodes.cpp)
if(TARGET test_find_weak_nodes)
Expand Down
9 changes: 7 additions & 2 deletions rclcpp/include/rclcpp/serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@
#define RCLCPP__SERIALIZATION_HPP_

#include <memory>
#include <stdexcept>
#include <string>

#include "rosidl_typesupport_cpp/message_type_support.hpp"
#include "rclcpp/visibility_control.hpp"

#include "rcl/types.h"

#include "rosidl_runtime_c/message_type_support_struct.h"

#include "rosidl_typesupport_cpp/message_type_support.hpp"


namespace rclcpp
{

class SerializedMessage;

/// Interface to (de)serialize a message
class SerializationBase
class RCLCPP_PUBLIC_TYPE SerializationBase
{
protected:
explicit SerializationBase(const rosidl_message_type_support_t * type_support);
Expand Down
6 changes: 4 additions & 2 deletions rclcpp/include/rclcpp/serialized_message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
#include "rcl/allocator.h"
#include "rcl/types.h"

#include "rclcpp/visibility_control.hpp"

namespace rclcpp
{

/// Object oriented version of rcl_serialized_message_t with destructor to avoid memory leaks
class SerializedMessage : public rcl_serialized_message_t
class RCLCPP_PUBLIC_TYPE SerializedMessage : public rcl_serialized_message_t
{
public:
/// Default constructor for a SerializedMessage
Expand Down Expand Up @@ -68,7 +70,7 @@ class SerializedMessage : public rcl_serialized_message_t
SerializedMessage & operator=(rcl_serialized_message_t && other);

/// Destructor for a SerializedMessage
~SerializedMessage();
virtual ~SerializedMessage();
};

} // namespace rclcpp
Expand Down
1 change: 1 addition & 0 deletions rclcpp/test/test_subscription_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "rcl/types.h"

#include "rclcpp/allocator/allocator_common.hpp"
#include "rclcpp/serialized_message.hpp"
#include "rclcpp/subscription_traits.hpp"

#include "test_msgs/msg/empty.hpp"
Expand Down

0 comments on commit 1b87de0

Please sign in to comment.