Boost Serialization Library
Boost.Org is an organization
dedicated to providing C++ libraries that provide advanced
features for C++ programmers. These libraries are distinguished by:
- High quality - before being accepted as a boost library, candidates
are subjected to an extremely rigorous peer review system to assure
utility, correctness, and elegance of design.
- Portability - all boost libraries are subject to testing
on a variety of compilers and operating systems.
- Correctness - exhaustive test cases for each library
- Power - many boost libraries use advanced C++ features such as
template meta-programming to make libraries more flexible and powerful.
- Breadth - the code base in the boost libraries is extremely large
and varied.
After a formal review, my submission has been accepted in to the boost library.
It is part of the standard boost distribution starting at version 1.32 released 17 November 2004.
If you are new to boost and want to use the serialization library,
I recommend you install the latest boost distribution. This is available at
Boost.Org. You can view the documentation of the
latest boost serialization library
here.
For those curious about what construction of a library like this entails,
I've written a paper
"Making A Boost Library"
which I presented at the OOPSLA '05 conference.
Current Status of Release of the Serialzation
My current version of the serialization library can be downloaded
here. It has been tested against
the latest boost release as of this writing (Boost 1.34). The results
of tests on my own machine can be seen here.
I expect this version to be included in Boost 1.36.
Here is an excerpt from the release notes in the documentation.
Differences from Boost 1.35
- The library is now thread safe. That is, multiple archives can be open
in different threads. This has been implmented with a lock-free algorithm
to avoid any performance bottlenecks.
- Serialization of types defined in shared libraries is now supported.
shared libraries (DLLS) can be loaded/unloaded dynamically at runtime.
This includes the serialization of types of abstract base classes so that
a program can be written so as to be compatible with as yet undefined
and un-implemented code.
- The extended type info system has been enhanced to in order to implement
the above. It is now a general purpose system for creating and casting of
types about which is only known a string ID and an abstract base class.
- All bug reports filed as TRAK tickets have been addressed.
- As of this writing, the library will fail build on older compilers such
as MSVC before version 7.1 and older versions of Borland compilers. This
may or maynot change in the future.
- In previous versions, all types serialized through a pointer were
automatically "registered" as a side-effect. This made it unnecessary to
explicitly register or export these types if they were subsequently
serialized through a pointer to a base class. On rare occasions this
created some difficulties by instantiating undesired code and made
the requirement for registration and/or export dependent on the sequence
of operations. So any type that is to be serialized through a base
class pointer must be either explicitly registered or exported. This
might break some code and result in the throwing of "unregistered type"
exception.
Differences from Boost 1.34
- Enhanced support for fast serialization for native binary archives. By Mattias Troyer.
- Improved implementation of "export" functionality. Removes header ordering
requirement and eliminates the maintenance of a pre-determined list of "known archives"
By David Abrahams.
- Improved support for STLPort.
Interested parties can check the current status of my tests
here
Help me out!
For testing the library, I use the library_test script included in boost 1.35. I can only test
with compilers shown on my local machine. If you want to help me test this package you can do
the following:
- Update your own copy of the latest boost release.
- Download this package.
- Move the contents of this package to the corresponding places in the
directory structure of your boost installation.
- Set your current directory to libs/serialization/test
- Invoke ../../../tools/library_test.sh (or .BAT)
This (or some minor variation thereof) should produce a library status table similar
to the one displayed here. In interested in getting feed back from any compilers not
not listed here.
Late breaking news
I will be giving a class at
Software Development '08
Back to Home Page