Is there a way to serialize an unknown number of items and then read them back? In essence, I'd like to do this:
Ignore the variables being serialized, these are pointers to base classes, they go in and out just fine.
try
{
ofstream ofs(fileName.c_str(),ios::binary);
portable_binary_oarchive oa(ofs);
//boost::archive::text_oarchive oa(ofs);
oa<>qdc2;
cout<<qdc2->GetElementDebugType()<>qdc2;
}
But there is no () operator on an portable_binary_iarchive . I tried to do the test on the input stream, but that didn't work either. I don't know how many elements there are because I'm writing them as I go, I don't want to catch that exception as the EOF marker, because it really isn't the correct exception for that. I tried walking through the serialization code to see where it actually reads a byte stream form the file... but I'm apparently not smart enough to unravel that much templated Macro awesomeness. :)
Larry E. Ramey