On Thursday, October 18, 2007 at 09:01:06 (-0700) Robert Ramey writes:
This would be something that would be better to do yourself. Here is a suggestion:
Suppose you've got
class A { B b; C c; D d; };
I think something simpler would be to have a single callback, say progress(), and pass it the number of bytes read so far from the stream in question. This would allow a percentage complete calculation to be done based on the number of bytes in the incoming file (assuming it is not compressed). Thus, something like this: template<class Archive> void serialize(Archive & ar, E & e, const unsigned int version){ ar & e; progress(ar.stream().tellg()); } template<class Archive> void serialize(Archive & ar, B & b, const unsigned int version){ ar & b; progress(ar.stream().tellg()); } or whatever. If compressed, then you'll have to fudge things, dividing the bytes by some heuristic factor... Bill