Boost logo

Boost Users :

From: Jabe (tahoma_at_[hidden])
Date: 2006-06-23 14:19:57


Thank you very much for your answers.

>> All classes i use are exported by BOOST_CLASS_EXPORT_GUID. Is there a
>> chance to fetch the classname for a given class_id,
>> class_id_reference or class_id_optional on the level of archive
>> derivation?
>
> There is no function to do this. This would have to be aded to
> basic_[i/o]archive.hpp.
> It's never been needed - but perhaps its worthy of consideration.

Maybe...in my case, yes it is.

>> And more general: How can i create objects from the registered
>> information about classes using the extended type info? When using
>> the boost::archive is not practical for my xml format i would like to
>> use as much as possible from boost to port the already implemented
>> solution by myself without boost. Therefore i need to replace my own
>> classfactory if possible with boost's one.
>
> The class factory used by boost serialization is coded into iserializer.hpp.
> This is sort of "ad hoc". It relies upon facilities of extended_type_info.
> I would like to see it "factored out" and move to extended_type_info
> which would be a natural place for it. I don't know for a fact that
> that wouldn't create some other difficulties but it would be a better
> conceptual fit. I would also like to see this used to create a
> "C++ / poor persons COM" which would have the facility of
> Microsoft COM and CORBA but only address the needs of
> of C++ programmers which would make it very simple to use -
> unlike the language independent methods.
>
> So we're on the same page here as far as what we would like to
> see done - of course - getting it done is another thing entirely.

Yes we are. After some investigation into the source i was able to
retrieve classnames from object pointers and to get an
extended_type_info from a classname. But it only works when using
archives. Without them, no chance in my opinion. I would really like to
see the complete extended_type_info part factored out.

>> I found the struct "save_array_type" in detail/oserializer.hpp. If i
>> could replace the invoke method with my own (and so for all other
>> savers) i could remove e.g. the "item" xml tags used with array
>> elements. Any chance?
>
> Boost serialization as implemented in the HEAD is being enhanced by Mathias
> Troyer to permit extension and customization of serialization of
> arrays/collections
> according to the type of archive. His motivation is to maximize performance
> of
> serialization of arrays on for cluster computing. The method that his been
> chosen is to create an "array_wrapper" whose serialization can be varied
> according to the type of archive. This will be useful in your case.
> However, It
> won't be part of boost serialization until 1.35. It is not under going
> "finishing
> touches".

I got it working by providing an overloaded member to save named
std::vector's.

> Note there are other improvements comming in the serialization library which
> are none of my doing. Aside from Mathias work on making serialization
> of arrays more customizable, David Abrahams has improved the export
> code to eliminate header ordering requirements and refined tricky code
> in [i/o]serializer so that its simpler, neater, and most importantly, allows
> for more compilers to pass more tests.
>
> It would be my hope to make a generalized GUI editor which can be
> used to edit any serialization files. For me - this is much easier and more
> useful than trying to make XML for this purpose.

I need to read and write a XML format that is defined by a standard.
I've got no chance to change it in any way. Furthermore i have to read
XML files that were exported by other applications. Parsing the file
should be done by an xml library that supports validation and so on. All
  I need from the archive is an interface providing all available
information.

Before investigating more work into this, I think it cannot be done in
the next couple of hours. All the "tracking_id", "object_id" and so on
attributes cannot be read from the XML file (they aren't there). So I
really don't know if the XML input ever will work even when the xml
output is working.

Nevertheless, boost is a great library that earns much of my respect. I
think everytime I read a new line of boost's sourcecode I learn more
about templates.

Regards,
Jabe


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