From: Marcelo M. <mm...@ac...> - 2006-01-11 01:23:08
|
If you are not using SWIG from the CVS repository, you need to try it. There are several issues related to swig + perl + separate .i files + %import that are now resolved. Marcelo Wade Brainerd wrote: > Hello, > > I have a system of SWIG-generated Perl modules that work together to > process data. Each one comes from a separate C++ project with its own > .i file, but they operate on common C++ data types that are shared > between the modules. > > There is module Data, which wraps class CommonData and implements a > function Create() that returns a new CommonData. > > Then there is module Process, which has a function DoWork() which > takes a pointer CommonData and returns a new CommonData. The SWIG > wrapper for module Process only forward declares class CommonData, it > does not include wrappers for the entire class. > > The problem is that the CommonData object returned by > Process::DoWork() is a fundamentally different Perl type from the one > returned by Data::Create(), all its members are gone. I would like to > somehow bless the CommonData object returned by Process to force it to > actually be Data::CommonData (the real type) instead of > Process::CommonData (an empty type). Is there a way to do this in Perl? > > I tried bless $data, Data::CommonData; but it complains that $data is > a scalar, not a ref. Does SWIG consider empty class declarations to > be scalars instead of objects for some reason? > > Thanks for your help, > > Wade Brainerd > Activision Central Technology > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Swig-user mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swig-user |