|
From: Luigi B. <lui...@gm...> - 2009-10-29 16:04:52
|
On Wed, 2009-10-21 at 17:58 +0100, Andrea wrote: > On 21/10/09 15:55, Luigi Ballabio wrote: > > unfortunately, polymorphism doesn't currently work across > languages. > > > Indeed. > I've tried to use directors and it seems to work well if there are no > shared_ptr involved. > > My problem now is [...] I don't seem to be able to create a shared_ptr > in the target language. 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; - modify the exported payoff classes so that they no longer hide the shared_ptr (e.g., export the actual PlainVanillaPayoff, not PlainVanillaPayoffPtr) and enable directors; - export the shared_ptr<Payoff> as a separate class; - fix the other interfaces so that they work with the new classes. Let me know if you get stuck in any of the steps. Luigi -- Green's Law of Debate: Anything is possible if you don't know what you're talking about. |