Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-09-28 06:54:44


Peter Dimov wrote:

> Vladimir Prus wrote:
>
>> But failing that, what about adding the following macros:
>>
>> I_WANT_TO_USE_TYPEID_WHEN_SERIALIZING_DERIVED_CLASSES_OF(any_base)
>>
>> or
>>
>> USE_THE_FOLLOWING_FUNCTOR_TO_GET_GUI_FOR_CLASSES_DERIVED_FROM(any_base,
>> serialization::typeid_guid_maker)
>>
>> ? At least that would make boost::any serializable.
>
> I don't think it will make it DEserializable, though. You still need to
> map the string to a type when loading, which requires that you have
> previously registered the type. A boost::any is equivalent to a pointer to
> an abstract class from serialization point of view.

Ah, yes, you're right. Guess we still need a way to register every new
instantiation with the serialization library. Maybe, something like this
will work:

   template<class T>
   class any_value_holder
   {
        static boost::proably_not_yet_written::serialization_register<
           any_value_holder<T> > register_it;
   };

I don't have any idea how to make this non-intrusively, though.
  
- Volodya


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