Re: [Boost-users] [Serialization, XML] - how to get info "where am i?" in serialization helper (encoding is not recursive)?
Hi Gary, you made my day - many thanks! Seems we have done similar things :-) Just a final question: Could you tell me, what these defines are about? I didn't adopt them and the modules seems to be ok without.
#define BOOST_ARCHIVE_CUSTOM_IARCHIVE_TYPES datastore::ConfigIArchive #define BOOST_ARCHIVE_CUSTOM_OARCHIVE_TYPES datastore::ConfigOArchive
Cheers! \Frank _______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
Hi Frank, You're very welcome, I'm glad it helps. The defines are for exports of polymorphic derived types through base pointers. Here are the docs on exporting: http://www.boost.org/libs/serialization/doc/serialization.html#registration The export defines in boost/serialization/export.hpp use a set of known archive types defined in boost/archive/detail/known_archive_types.hpp, so the defines I added are supposed to include my custom archive in that list of known archive types. I finally found the place in the boost documentation where I learned about the custom archive defines in the first place: http://www.boost.org/libs/serialization/doc/archive_reference.html#implement... My code does not build without the defines, as I use the export defines to register polymorphic types in lots of places, and so that I don't have to include the template implementations everywhere. Also, it seems more correct and complete to define them, so I'm trying to be safe and avoid any erratic or unexpected behavior. I have had some bad experiences with the serialization library and things like header order causing unexplainable errors. I don't yet understand all the magic behind it. :) Hope that helps, gary Frank Bergemann wrote:
Just a final question: Could you tell me, what these defines are about? I didn't adopt them and the modules seems to be ok without.
#define BOOST_ARCHIVE_CUSTOM_IARCHIVE_TYPES datastore::ConfigIArchive #define BOOST_ARCHIVE_CUSTOM_OARCHIVE_TYPES datastore::ConfigOArchive
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Gary Granger
I have had some bad experiences with the serialization library and things like header order causing unexplainable errors. I don't yet understand all the magic behind it. :)
Please correct me if I'm wrong, but the only header order that matters it the place where you include export.hpp. It must be included after all archives. If you write your own archives, there is some #define you need to set somewhere. I'm trying to get a firm handle on the serialization lib myself :-) Thanks, Sohail
Gary Granger wrote:
Hi Frank,
Note that starting with versions subsequent to 1.34, the following changes will be in effect.
My code does not build without the defines,
such defines will no longer be necessary.
Ihave had some bad experiences with the serialization library and things like header order causing unexplainable errors. I don't yet understand all the magic behind it. :)
Header order restrictions are eliminated Finally, the serialization trait "is_wrapper" can be assigned to any type so that the const traps are not applied to these types. Changes have been made to make archives thread safe. Robert Ramey
I had heard here on the list that such changes were coming, and I've been looking forward to them. Meanwhile, the serialization library has been quite useful, and like most boost libraries, very educational. Thank you, Robert.
Gary Granger wrote:
very educational.
I hate to tell you, but writing a libray like this is REALLY educational. I think I increased my knowledge of C++ by a factor of 10 doing this
Thank you, Robert.
participants (4)
-
Frank Bergemann
-
Gary Granger
-
Robert Ramey
-
Sohail Somani