Re: Registries

David Abrahams <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
Daniel Wallin <[email protected]> writes:

> One thing; the converter-registries aren't really bound to modules
> though are they?  

That's the intention.

> They are really just bound to the shared library. 

That's not the intention.  Converter registrations would occur within
the context of some current module scope, which would stick them into
a particular...

> So if you have multiple modules in the same shared library you would
> automatically share registries as well.

Agh, I think there may be a serious problem for registry scoping
here.  At least on most Unices, all extension modules linked to the
same langbinding .so are prone to share a single copy of
registration<T> for any T.  

This is going to require some rethinking.  

One possibility is to have each registration<T> contain an array of
what's currently stored in a registration, and encode an index in each
wrapped function object corresponding to the scope in which it's
wrapped.  Very ugly though - I'd rather come up with something better.

Ralf, what was the compelling use case for registry scoping anyway?
It had something to do with to-python converters and the fact that
there is only one per type.  Can you lay it out in detail?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.