Boost logo

Boost Users :

From: Victor Whiskey Yankee (victor.whiskey.yankee_at_[hidden])
Date: 2008-05-12 12:41:10


Robert Ramey wrote:
Hmmm - consider using variant which lists your classes and serializing the 
variant.
I assume you mean the boost variant. It looks promising but I wonder how that affects the size of the
archive, given that different objects in the "union"  will have drastically different sizes themselves?


Q: Are there any archive methods to tell you what's in the archive, like some sort of list? And then it wold
be cool to be able to tell the archive to restore a certain random object from the list (random access).


As an alternative to variant,  would the following strategy work?
    create 2 archives per object: one archive is the "header" with a key that tells me which type of object it is,
    and another archive that is the serialized object itself.
This strategy seems very inefficient.

Do you think using a more efficent method would be to use derived classes? Create one archive. Then, when
restoring the object, first restore it as a simple base class (with almost nothing in it but the key type), then
restore it again using that type info?

Thanks,
Vic


Robert Ramey

Victor Whiskey Yankee wrote:
  
Hello List,

I have several classes, each put into it's own binary archive.

How can I cheaply and efficiently determine the class type of a binary
archive so that I know how
to restore it?

Thanks,
Vic 
    



_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

  


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net