Boost logo

Boost Users :

From: Robert S. Grimes (rsgrimes_at_[hidden])
Date: 2006-03-10 21:34:22


Oh, one last question - for now...

As I said in my original posting, I essentially want a custom "header" and a
"footer" to add to my archives. What I'm looking for is the best way to
hook into the archive creation process just before anything is written, and
just after. I want to support several different types of archives (e.g.
text, binary, XML) with various types of signatures at the end (e.g. CRC,
digital signature, etc.). My concept is to write a standard header that
identifies what was written, then use a factory function that reads the
header and returns the appropriate archive when reading.

It seems there are some init functions that are for headers, but I've not
yet figured out if that is the best spot, nor where the "footers" hook in.
I'm poking about and may well find them, but I thought other, more expert,
people might help me with the optimal approach.

Thanks again!
-Bob

> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]]On Behalf Of Robert Ramey
> Sent: Friday, March 10, 2006 11:04 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [serialization] Creating new archives
> derivedfrompolymorphic archive
>
>
> To do something like this, you'll have to invest some effort to understand
> the serialization library at more depth that is required for someone who
> just want's to use it. I can't offer any "cookbook" like approach.
>
> But I can help maybe a tiny bit.
>
> Note that the polymorphic versions of the archives classes are the result
> of application of a "polymorphic archive adaptor" to any other archive.
> This "polymorphic archive adaptor" is little more than a glorified
> typedef which uses the base archive type as a parameter.
>
> So, you want to do this in two stages:
>
> a) make your own archive - from scratch or by derivation from
> an existing one - be sure to test it.
>
> b) apply the "polymorphic archive adaptor" to make a polymorphic
> version.
>
> If you want to practice, you should be able to take the demo_fast_archive
> example - which makes a derivation from binary_?archive, apply
> the "polymorphic archive adaptor" and generate a
> polymorphic_fast_binary_archive (or what ever). This should take
> about an hour to do.
>
> Good Luck
>
> Robert Ramey
>
>
> Robert S. Grimes wrote:
> > Hi,
> >
> > How do I get started? I want to create a set of custom archives that
> > include such features as a small header, CRC, digital signatures,
> > etc. I want to put this into a DLL, so I want to go the polymorphic
> > route. There are directions for creating new archives from the
> > template versions, but not for the polymorphic versions. I'm not
> > sure the starting point is the same, so I thought I'd ask first, as
> > this is stretching my abilities a bit.
> >
> > Thanks,
> > -Bob
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> 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