[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)

[PATCH] typekit: move serialization code in separate header

There's no reason to pollute Types.hpp with boost::serialization code.
We generate that code in a boost_serialization.hpp header which can be
included by code requiring that function.

Signed-off-by: Peter Soetens <peter [..] ...>
---
lib/orogen/templates/typekit/Types.hpp | 18 ----------
.../templates/typekit/boost_serialization.hpp | 36 ++++++++++++++++++++
lib/orogen/templates/typekit/mqueue/Type.cpp | 1 +
lib/orogen/templates/typekit/type_info/Info.cpp | 1 +
.../templates/typekit/type_info/OpaqueInfo.cpp | 1 +
lib/orogen/typekit.rb | 2 +
6 files changed, 41 insertions(+), 18 deletions(-)
create mode 100644 lib/orogen/templates/typekit/boost_serialization.hpp

diff --git a/lib/orogen/templates/typekit/Types.hpp b/lib/orogen/templates/typekit/Types.hpp
index cf64a63..d1483e3 100644
--- a/lib/orogen/templates/typekit/Types.hpp
+++ b/lib/orogen/templates/typekit/Types.hpp
@@ -21,9 +21,6 @@
// some of the types need std::vector.
#include <vector>
#include <boost/cstdint.hp

-#include <boost/serialization/serialization.hp

-#include <boost/serialization/array.hp

-#include <boost/serialization/vector.hp

<% registered_types.each do |type| %>
#ifdef CORELIB_DATASOURCE_HPP
@@ -48,21 +45,6 @@
extern template class RTT::Attribute< <%= type.cxx_name %> >;
#endif

-<% if type.respond_to?(:to_boost_serialization) %>
-namespace boost
-{
- namespace serialization
- {
- template<typename Archive>
- 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/boost_serialization.hpp b/lib/orogen/templates/typekit/boost_serialization.hpp
new file mode 100644
index 0000000..a18e8c2
--- /dev/null
+++ b/lib/orogen/templates/typekit/boost_serialization.hpp
@@ -0,0 +1,36 @@
+/*
+ * Generated from orogen/lib/templates/typekit/boost_serialization.hpp
+ *
+ */
+
+#ifndef OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+#define OROGEN_<%= typekit.name.upcase %>_BOOST_SERIALIZATION_HPP_
+
+#include <boost/serialization/serialization.hp

+#include <boost/serialization/array.hp

+#include <boost/serialization/vector.hp

+#include <boost/serialization/string.hp

+
+#include "Types.hpp"
+
+<% registered_types.each do |type| %>
+<% if type.respond_to?(:to_boost_serialization) %>
+namespace boost
+{
+ namespace serialization
+ {
+ /**
+ * boost::serialization function for <%= type.cxx_name %>
+ */
+ template<typename Archive>
+ void serialize(Archive& a, <%= type.cxx_name %>& b, unsigned int version)
+ {
+ using boost::serialization::make_nvp;
+ <%= type.to_boost_serialization %>
+ }
+ }
+}
+<% end %>
+<% end %>
+
+#endif /* OROGEN_BOOST_SERIALIZATION_HPP_ */
diff --git a/lib/orogen/templates/typekit/mqueue/Type.cpp b/lib/orogen/templates/typekit/mqueue/Type.cpp
index 8f59dbd..1ba3c18 100644
--- a/lib/orogen/templates/typekit/mqueue/Type.cpp
+++ b/lib/orogen/templates/typekit/mqueue/Type.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/mqueue/Type.cpp */

#include "Types.hpp"
+#include "boost_serialization.hpp"
#include "transports/mqueue/Registration.hpp"
#include <rtt/transports/mqueue/MQSerializationProtocol.hp

diff --git a/lib/orogen/templates/typekit/type_info/Info.cpp b/lib/orogen/templates/typekit/type_info/Info.cpp
index d579a00..3dea2b8 100644
--- a/lib/orogen/templates/typekit/type_info/Info.cpp
+++ b/lib/orogen/templates/typekit/type_info/Info.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/templates/typekit/type_info/Info.cpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <<%= type.info_type_header %>>

namespace orogen_typekits {
diff --git a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
index fe1c25e..8890e2e 100644
--- a/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
+++ b/lib/orogen/templates/typekit/type_info/OpaqueInfo.cpp
@@ -1,6 +1,7 @@
/* Generated from orogen/lib/orogen/templates/typekit/type_info/OpaqueInfo.hpp */

#include <<%= typekit.name %>/Types.hpp>
+#include <<%= typekit.name %>/boost_serialization.hpp>
#include <rtt/types/StructTypeInfo.hp

#include <rtt/types/TypeInfoRepository.hp

#include <<%= typekit.name %>/OpaqueConvertions.hpp>
diff --git a/lib/orogen/typekit.rb b/lib/orogen/typekit.rb
index 7b1a021..3fe31dd 100644
--- a/lib/orogen/typekit.rb
+++ b/lib/orogen/typekit.rb
@@ -1340,6 +1340,8 @@ module Orocos
public_header_files << save_automatic("Plugin.hpp", tk_hpp)
tk_cpp = Generation.render_template "typekit/Plugin.cpp", binding
implementation_files << save_automatic("Plugin.cpp", tk_cpp)
+ tk_ser = Generation.render_template "typekit/boost_serialization.hpp", binding
+ public_header_files << save_automatic("boost_serialization.hpp", tk_ser)

#tk_impl_hpp = Generation.render_template "typekit/TypekitImpl.hpp", binding
#Generation.save_automatic("typekit", "#{component.name}TypekitImpl.hpp", tk_impl_hpp)