|
From: Luigi B. <lui...@gm...> - 2009-11-03 11:07:20
|
On Thu, 2009-10-29 at 17:59 +0000, Andrea wrote: > > There would be quite a bit of work to do. You would have to: > > - add a constructor to boost::shared_ptr in common.i so that it takes a > > pointer; > > I've got a big doubt here. > Is it safe to stick the raw pointer into a shared_ptr? Is it already owned by some other swig mechanism? You're right, the shared_ptr would take ownership against SWIG. I don't see any easy solution to this one... Another possibility would be to write a C++ payoff that adapts a Java payoff. Its constructor would take a Java instance and store it, and its operator() would use the foreign interface to call the corresponding method in the Java instance. Kind of a home-made director. I don't know if it would be possible to hide the mechanism so that it seems that the Java class inherits from Payoff, though... Luigi -- There's no sense in being precise when you don't even know what you're talking about. -- John von Neumann |