[serialization] Creating new archives derived from polymorphic archive

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

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

Hi Robert,
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]On Behalf Of Robert Ramey Sent: Friday, March 10, 2006 11:04 AM To: boost-users@lists.boost.org 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
I assumed that would be the case!
But I can help maybe a tiny bit. Thanks!
a) make your own archive - from scratch or by derivation from an existing one - be sure to test it.
This is the key step I was looking for!
Good Luck
Thanks!
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

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@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]On Behalf Of Robert Ramey Sent: Friday, March 10, 2006 11:04 AM To: boost-users@lists.boost.org 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

The standard init function is called from the constructors. I don't think you want to replace this - but you could suppress it with the no_header option when the archive is open. On your derived archives, just add header and footer into the constructor and desctructor. Robert Ramey Robert S. Grimes wrote:
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@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]On Behalf Of Robert Ramey Sent: Friday, March 10, 2006 11:04 AM To: boost-users@lists.boost.org 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Robert Ramey
-
Robert S. Grimes