@@ -217,6 +217,7 @@ namespace cereal
217
217
unnecessary saves from taking place if multiple shared pointers
218
218
point to the same data.
219
219
220
+ @internal
220
221
@param addr The address (see shared_ptr get()) pointed to by the shared pointer
221
222
@return A key that uniquely identifies the pointer */
222
223
std::uint32_t registerSharedPointer ( void const * addr )
@@ -240,6 +241,7 @@ namespace cereal
240
241
unnecessary saves of identifying strings used by the polymorphic
241
242
support functionality.
242
243
244
+ @internal
243
245
@param name The name to associate with a polymorphic type
244
246
@return A key that uniquely identifies the polymorphic type name */
245
247
std::uint32_t registerPolymorphicType ( char const * name )
@@ -273,6 +275,25 @@ namespace cereal
273
275
self->process ( std::forward<Other>( tail )... );
274
276
}
275
277
278
+ /* ! @name Boost Transition Layer (private)
279
+ Specific private functionality and overrides for enabling the Boost Transition Layer */
280
+ // ! @{
281
+
282
+ // ! Registers a class version with the archive and serializes it if necessary
283
+ /* ! If this is the first time this class has been serialized, we will record its
284
+ version number and serialize that.
285
+
286
+ @tparam T The type of the class being serialized
287
+ @param version The version number associated with it */
288
+ template <class T > inline
289
+ void registerClassVersion ( const std::uint32_t version )
290
+ {
291
+ const auto insertResult = itsVersionedTypes.insert ( std::type_index (typeid (T)).hash_code () );
292
+ if ( insertResult.second ) // insertion took place, serialize the version number
293
+ process ( make_nvp<ArchiveType>(" cereal_class_version" , version) );
294
+ }
295
+
296
+
276
297
// ! Serialization of a virtual_base_class wrapper
277
298
/* ! \sa virtual_base_class */
278
299
template <class T > inline
@@ -307,6 +328,18 @@ namespace cereal
307
328
return *self;
308
329
}
309
330
331
+ // ! Member serialization
332
+ /* ! Boost Transition Layer version */
333
+ template <class T > inline
334
+ typename std::enable_if<traits::is_output_serializable<T, ArchiveType>::value && traits::has_member_versioned_serialize<T, ArchiveType>::value,
335
+ ArchiveType &>::type
336
+ processImpl (T const & t)
337
+ {
338
+ registerClassVersion<T>( detail::Version<T>::version );
339
+ access::member_serialize (*self, const_cast <T &>(t), detail::Version<T>::version);
340
+ return *self;
341
+ }
342
+
310
343
// ! Non member serialization
311
344
template <class T > inline
312
345
typename std::enable_if<traits::is_specialized_non_member_serialize<T, ArchiveType>::value ||
0 commit comments