From 613a72ae6f5cfe176dd8f5d0102f2d66487136a5 Mon Sep 17 00:00:00 2001 From: Peter Soetens Date: Thu, 2 Sep 2010 23:46:42 +0200 Subject: [PATCH 1/2] typekit: move boost::serialization function into Types.hpp header. Needed such that other cpp files / transports can use it too, MQueue for example. Signed-off-by: Peter Soetens --- lib/orogen/templates/typekit/Types.hpp | 17 +++++++++++++++++ lib/orogen/templates/typekit/type_info/Info.cpp | 15 --------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp index 848d59d..2aa4f2f 100644 --- a/lib/orogen/templates/typekit/Types.hpp +++ b/lib/orogen/templates/typekit/Types.hpp @@ -21,6 +21,7 @@ // some of the types need std::vector. #include #include +#include <% registered_types.each do |type| %> #ifdef CORELIB_DATASOURCE_HPP @@ -44,6 +45,22 @@ #ifdef ORO_CORELIB_ATTRIBUTE_HPP extern template class RTT::Attribute< <%= type.cxx_name %> >; #endif + +<% if type.respond_to?(:to_boost_serialization) %> +namespace boost +{ + namespace serialization + { + template + void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version) + { + using boost::serialization::make_nvp; + <%= type.to_boost_serialization %> + } + } +} +<% end %> + <% end %> <%= diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp index c8be9f0..d579a00 100644 --- a/lib/orogen/templates/typekit/type_info/Info.cpp +++ b/lib/orogen/templates/typekit/type_info/Info.cpp @@ -3,21 +3,6 @@ #include <<%= typekit.name %>/Types.hpp> #include <<%= type.info_type_header %>> -<% if type.respond_to?(:to_boost_serialization) %> -namespace boost -{ - namespace serialization - { - template - void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version) - { - using boost::serialization::make_nvp; - <%= type.to_boost_serialization %> - } - } -} -<% end %> - namespace orogen_typekits { struct <%= type.method_name(true) %>TypeInfo : public <%= type.info_type %>< <%= type.cxx_name %> > -- 1.6.3.3