does not support the STL container std::valarray
does not support the STL string variant std::wstring (however, std::string is supported)
sanity checking (preflighting for saves, range checking for
loads) is not builtin - it is the client's responsibility to do any
checking. Clients are recommended to "throw
ccs::serialization::bad_data_exception();" if bad data is
detected, and then handle the problem appropriately.
does not have builtin support for versioning: as far as the library is concerned, versioning is (and should be) a problem that only the client can solve.
For example, for a class C1 that later changes to C2, your code would probably look like this:
// in my_product version 1:
void save_c1(DB& db) {
C1 c1;
// write out the version number of C1 before writing object c1:
db << 1 << c1;
}
// in my_product version 2:
void save_c1(DB& db) {
C2 c2;
// write out the version number of C2 before writing object c2:
db << 2 << c1;
}
// in my_product version 2:
void load_c(DB& db) {
int version;
db >> version;
if (1 == version) {
C1 c1;
db >> c1;
...
} else if (2 == version) {
C2 c2;
db >> c2;
...
} else ... {
}
}Of course, you could also write out the version as a string or even a struct/class if you have more complex versioning requirements.
serializing references, ie, "T&" or "const T&", is possible but requires non-intrusive split-serialization by the client's type that contains the reference. The technique is to save the reference's data as if it were a pointer, and on loading, read back the data into a pointer and then instantiate the client's type with the data in the pointer. Alternatively, if the reference's data can be saved as a pointer or directly as data, then it can be saved as such before the client type containing the reference. Then upon loading, set up the reference to refer to the already-loaded data (because data is always loaded in the same order as it is saved).
stdext::hash_multimap does not serialize correctly
under Visual C++
2005 because the elements are restored
in reverse order. This bug has been fixed in Visual
C++ 2008, so it is
recommended that you use Visual C++
2008 for
stdext::hash_multimap (or you can use a work-around as
seen in the serialization_unit_tests.cpp test
program).
out of the box, the Intel TBB library
does not build for Mac OS X / PowerPC
unless the makefiles are modified (you need to add -arch
switches), but once it is built for PowerPC, you can run the test
program's release configuration using the
Xcode project file.