Re: [Boost-users] Developing a new boost archive

Actually I cannot really answer because I haven't had yet a deeper look at the suggest "export" method details.
Neverthelss, what I need is an explicit string because certain format might require such information used to instantiate objects of the given class while deserializing in other languages (java or python for example). But also pure text formats optionally provide this information with the purpose of helping the user to understand/verify the content of the result of the serialization.
My library, which is written in pure C code for compatibility reasons, does solves easily the problem by stringify the given type via pretty straight macro inside the serialization function itself. Something like opening a type, serialize all the fields and close the type. The use of the macro obviously doesn't work at all when using it under any template declaration because the preprocessor is called earlier in compilation process.
I also tried the parsing of the __PRETTY__FUNCTION__ which works perfectly under template function, but this approach is even more un-portable then the demangler, so not really praticable.
Sent from my ASUS Eee Pad
Larry Evans

On 02/15/2012 10:13 PM, Roberto Fichera wrote:
By the way, I forgot to say that the demangling approach even if make easy to understand the real type behind a field, it will complicate a _lot_ the deserialization process when "regenerating" the given type into another language. Especially the type translation process into the given relative type, will not be really easy. As you know the type will be totally "unrolled" and all the nested typedef are solved till their relative basic type which in case of C++ with its templates, this process end up on generating very long demangled types. So, the best would be really to a have the type that the user can see in his code ... but I guess that it's not really easy to do without doing any changes. Finally, I would say that the boost serialization does handle really nicely all the C++ goodies, minimizing all the constraints into an acceptable solution, really a good job!
participants (1)
-
Roberto Fichera