[serialization] editor archive
Hi, I've been using serialization for a while and am extremely happy with it, now I would like to utilise it to automatically populate an editor with object data. Basically I intend to write a new archive type that will serialise to / from an editor interface using the type info of each serialised item to attach suitable editor components. Has anyone done anything like this or have any ideas of problems I may run up against? cheers martin
I can't see why this would require a new archive type Robert Ramey Martin Slater wrote:
Hi,
I've been using serialization for a while and am extremely happy with it, now I would like to utilise it to automatically populate an editor with object data. Basically I intend to write a new archive type that will serialise to / from an editor interface using the type info of each serialised item to attach suitable editor components. Has anyone done anything like this or have any ideas of problems I may run up against?
cheers
martin
Martin Slater wrote:
Robert Ramey wrote:
I can't see why this would require a new archive type
Now that would be perfect if I did not need a new archive type, I'm having trouble envisioning how it would work without one though. Any chance you could explain a bit more?
thanks
Martin
I presumed the following: a) That "document" is represented by a collection of other objects b) and that commands act upon this collection by 1) inserting elements 2) deleting elements 3 changing the properties of elements. c) and that the elements have some sort of commonality. They might all be one of the following 1) descendants of a common base class 2) instances of boost::variant (serialization now in main cvs) 3) instances of boost::any (serialization pending) Assuming this is the case, the serialization of this "document" is independent of any archive implementation. and serialization is straightforward. Indeed, if the collection is one of the STL collections, then its already done. Robert Ramey
The archive is, by design, insensitive of the application type. What you need to decide is whether one of the archive types is suitable for your application though. You have binary, text, and xml archive choices without creating a new archive type. I can imagine the necessity to create a new archive type if, for instance: o you wanted to save all versions of a document. o you needed to conform to some specific file format. o you needed to stick the document into a database The only small caviot that I've discovered with boost.serialization is its handling of pointers to primative data types. It is sometimes necessary to write a wrapper class around such data to make it non-primative. std::string is such a type. Martin Slater wrote:
Robert Ramey wrote:
I can't see why this would require a new archive type
Now that would be perfect if I did not need a new archive type, I'm having trouble envisioning how it would work without one though. Any chance you could explain a bit more?
thanks
Martin
participants (3)
-
Jeffrey Holle
-
Martin Slater
-
Robert Ramey