Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-09-09 13:43:58


if that's what you want to do - don't look too deeply into export.hpp.

The key macro is BOOST_CLASS_EXPORT_GUID(class, "name) and

BOOST_CLASS_EXPORT(T) is just

#define BOOST_CLASS_EXPORT(T) BOOST_CLASS_EXPORT_GUID(T, "T") // sort of

So the best would be for you to make something like:

template<class T>
const char * name_from_type<T>()

so one could say BOOST_CLASS_EXPORT_GUID(T, name_from_type<T>)

That is, the idea of an automatically generated unique string which
identifies a class would be useful in lots of areas besides serialization.
If you could generate a portable one - you'd be famous. If it were easy I
would have done it. In anycase its an orthogonal question to the
serialization library.

Good luck.

Robert Ramey
.
>
>> In the shorter term you could
>> probably craft a solution that would not be a general solution but
>> might work in some cases. If you don't care about archive
>> portability - that is
>> if your only loading archives with the same compiler (and probably
>> standard
>> library), you could craft something which would generate a uniquename
>> from
>> type_id.
>
> This is the route that I'm going to take. I'll try to understand how
> the underlyings of BOOST_CLASS_EXPORT work.
>
> Regards,
> Bruno Martínez


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