Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-06-23 12:22:28


What's the matter with my propose solution below of using the archive type
as the "flag"?

If necessary you could define a special type of archive -
confguration_data_archive
and a simulation_data_archive. These would be "boiler plate" code modeled on
the code from text_oarchive.hpp (or binary or) which would have the effect
of
creating a special archive types. These types can be used to dispatch the
appropriate
serializer.

class Foo {
    void serialize(confguration_data_iarchive & ar, const unsigned int
version);
    void serialize(confguration_data_oarchive & ar, const unsigned int
version);
    void serialize(simulation_data_iarchive & ar, const unsigned int
version);
    void serialize(simulation_data_oarchive & ar, const unsigned int
version);
};

or if you want to get fancier you can use MPL type techiniques to make it
slicker.

Robert Ramey


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