Adding Swig Capabilities for the Fixed Rate Bond Forward Class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Swig Capabilities for the Fixed Rate Bond Forward Class

John Orford
Hey Guys,

Can someone give me pointers on adding functionality for a completely new class?

I couldn't see any forward class available - I suspect this might be beyond me, but I'm willing to have a go.

Thanks,

John

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Adding Swig Capabilities for the Fixed Rate Bond Forward Class

Luigi Ballabio
In short (too short, probably, but of course you can follow up if you
get stuck):

- it's an instrument, so instead of just showing SWIG its declaration
you'll have to jump through a couple of hoops to export it as a
shared_ptr but still masquerade it as the instrument class. See, for
instance, how FixedRateBond is exported in SWIG/bonds.i (also mind the
%{ ... %} block at the beginning of the file where a few typedefs are
declared.

- its constructor takes a pointer to FixedRateBond, which is not
available directly (it's masqueraded as above). You'll have to declare
the parameter as a FixedRateBondPtr, and then cast it inside the
exported constructor. See, for instance, how BondHelper does it in
SWIG/ratehelpers.i.

Later,
    Luigi



On Mon, Aug 4, 2014 at 12:50 PM, John Orford <[hidden email]> wrote:

> Hey Guys,
>
> Can someone give me pointers on adding functionality for a completely new
> class?
>
> I couldn't see any forward class available - I suspect this might be beyond
> me, but I'm willing to have a go.
>
> Thanks,
>
> John
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users