Skip to content

Commit 2c5a100

Browse files
author
Freek Stulp
committed
boost serialization issue (but only for clang, debugging with Travis ;-)
1 parent 3f68ba3 commit 2c5a100

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

src/dmp_bbo/Rollout.hpp

+13-22
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ class Rollout {
110110
/** Give boost serialization access to private members. */
111111
friend class boost::serialization::access;
112112

113+
/** Serialize class data members to boost archive.
114+
* \param[in] ar Boost archive
115+
* \param[in] version Version of the class
116+
* See http://www.boost.org/doc/libs/1_55_0/libs/serialization/doc/tutorial.html#simplecase
117+
*/
118+
template<class Archive>
119+
void serialize(Archive & ar, DmpBbo::Rollout& rollout, const unsigned int version)
120+
{
121+
ar & BOOST_SERIALIZATION_NVP(policy_parameters_);
122+
ar & BOOST_SERIALIZATION_NVP(cost_vars_);
123+
ar & BOOST_SERIALIZATION_NVP(cost_);
124+
}
125+
113126
};
114127

115128

@@ -118,28 +131,6 @@ class Rollout {
118131
}
119132

120133

121-
/** Serialization function for boost::serialization. */
122-
namespace boost {
123-
namespace serialization {
124-
125-
/** Serialize class data members to boost archive.
126-
* \param[in] ar Boost archive
127-
* \param[in] rollout Rollout object to serialize.
128-
* \param[in] version Version of the class
129-
* See http://www.boost.org/doc/libs/1_55_0/libs/serialization/doc/tutorial.html#simplecase
130-
*/
131-
template<class Archive>
132-
void serialize(Archive & ar, DmpBbo::Rollout& rollout, const unsigned int version)
133-
{
134-
ar & BOOST_SERIALIZATION_NVP(rollout.policy_parameters_);
135-
ar & BOOST_SERIALIZATION_NVP(rollout.cost_vars_);
136-
ar & BOOST_SERIALIZATION_NVP(rollout.cost_);
137-
}
138-
139-
} // namespace serialization
140-
} // namespace boost
141-
142-
143134
/** Don't add version information to archives. */
144135
BOOST_CLASS_IMPLEMENTATION(DmpBbo::Rollout,boost::serialization::object_serializable);
145136

0 commit comments

Comments
 (0)