Boost logo

Boost :

From: Stephan Diederich (stephan.diederich_at_[hidden])
Date: 2007-06-29 10:56:01


Hi Jeremy and Mariano,

On 5/29/07, Jeremy Pack <rostovpack_at_[hidden]> wrote:
> Versioning can be done very simply using the Boost.Extension library. This
> will be described in greater detail in the documentation soon, but you can
> get a hint as to how it's done from the examples.

Thanks. That helped. I'm doing exactly what you suggested, plus
something additional I'd like to share. (The idea is actually taken
from CrystalSpace).
In the interface class I'm defining an method to retrieve the current
version of the interface. This method gets an "always inline"
attribute.
When exporting the class through boost.extension, I'm calling that
method to store the current Interface version in the Info-struct of
boost.extension. Now I've a wrapper around the factory map, which
compares the stored version in the plugin with the current version of
the interface. That way, I can change the interface class and increase
the version number without getting bad surprises.

> For part 2, this can actually be done using RTTI - just dynamic_cast it.

Works, thanks! I thought it wouldn't be possible to dynamic_cast a
type from another library, but it seems to work... Any ideas if this
can cause problems?

Another thing I recently discovered is some kind of class -> library
mapping. This is especially useful for debugging purposes... Did you
think about that?

Thanks for your help!

Cheers,
Stephan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk