[C++-sig] Do SWIP, SIP have a "cross-module" feature?

Niki Spahiev niki at vintech.bg
Thu Dec 12 10:11:09 CET 2002


Ralf W. Grosse-Kunstleve wrote:
> The recent discussion about a scoped type conversion registry for Boost.Python
> made me wonder if and how "cross-module" type conversions are handled by other
> packages.
> 
> By "cross-module" I mean that a module A defines a type conversion which can be
> used by, e.g. a wrapped function in another module B. For example in
> Boost.Python terms:
> 
> In module A:
> 
> class_<your_type>(...)
> 
> In module B:
> 
> your_type foo(your_type const& x);
> 
> def("foo", foo);
> 
> For this to work the only requirement in Boost.Python is that module A is
> somehow imported (either from Python or through the C-API from C++) before
> foo() is used. Is this also possible with SIP or SWIG?

AFAIK yes. SIP user SIP.DLL to hold global register. SWIG also can be 
configured to use global SWIG runtime. SWIG by default uses local. 
wxPython (SWIG) has similar (C-API import) solution for multiple modules 
and no extra global runtime.

Niki Spahiev





More information about the Cplusplus-sig mailing list