Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2003-10-24 12:01:06

Vladimir Prus worte

>Robert Ramey wrote:
>> Note that I personally have no plans to write such a
>> virtual_archive but I would be pleased to support
>> anyone who wants to. I believe the system would
>> currently support the construction of such a virtual
>> archive with not changes to the current code.

>I seems possible. The 'virtual_archive' will call virtual functions for
>saving built-in types and serialization::save for all the rest? Is the
>"vsave" family of method what you have in mind?

That wouldn't be the right spot. Those functions are to provide
a virtual interfarce for certain "built-in" types like object -id etc.

I'm reluctant to speculate on this but will do anyway as I love
to talk.

I'm guesssing that there would be:

class virtual_sarchive_interface {
        virtual void save(int t) = 0;
        virtual void save(float t) = 0;

then there would be

class virtual_text_iarchive :
        public common<virtual_text_iarchive>, virtual_iarchive_interface
        virtual void save(int t){
                is << t;

A plugin would be compiled against the first class - virtual_archive_interface.
so it would use

class plug-in {
        void serialize(virtual_iarchive_interface & ar, const unsigned int file_version){

The main program would include the plugin header but create
a virtual_text_archive. Then

ar << t

resolve to the the proper function through the vtable of the virtual_iarchive_interface.

This is basically the way Microsoft COM works for plug-ins. It would not
entail changing anything done to date.

There is no way I'm going to do this.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at