Login  Register

Re: Swig Wrapers for DeltaVolQuote

Posted by Luigi Ballabio on Nov 26, 2015; 8:14pm
URL: http://quantlib.414.s1.nabble.com/Swig-Wrapers-for-DeltaVolQuote-tp17124p17125.html

What's the error with your code?

On Thu, Nov 26, 2015 at 7:16 PM DPaulino <[hidden email]> wrote:
Could someone please help me with the Swig wrapers for the DeltaVolQuote
class?

I tried (and failed):

%{
using QuantLib::DeltaVolQuote;
%}

%ignore DeltaVolQuote;
class DeltaVolQuote : public Quote {};

%template(DeltaVolQuote) boost::shared_ptr<DeltaVolQuote>;
IsObservable(boost::shared_ptr<DeltaVolQuote>);

%{
using QuantLib::DeltaVolQuote;
typedef boost::shared_ptr<DeltaVolQuote> DeltaVolQuotePtr;
%}

%rename(DeltaVolQuote) DeltaVolQuotePtr;
class DeltaVolQuotePtr : public boost::shared_ptr {
        public:
                %extend {
                        DeltaVolQuotePtr(Real delta,
                                                 const Handle& vol,
                                                 Time maturity,
                                                 DeltaVolQuote::DeltaType deltatype) {
                                        return new  public boost::shared_ptr<DeltaVolQuote>(
                                                new DeltaVolQuote(delta,
                                                                            vol,
                                                                            maturity,
                                                                            deltatype));
                                                                                }

                        DeltaVolQuotePtr(const Handle& vol,
                                                         DeltaVolQuote::DeltaType deltatype,
                                                         Time maturity,
                                                         DeltaVolQuote::AtmType atmtype) {

                                        return new  public boost::shared_ptr<DeltaVolQuote>(
                                                new DeltaVolQuote(vol,
                                                                           deltatype,
                                                                           maturity,
                                                                           atmtype));
                                                                                                }
                }
};



--
View this message in context: http://quantlib.10058.n7.nabble.com/Swig-Wrapers-for-DeltaVolQuote-tp17124.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--

<http://leanpub.com/implementingquantlib>
<http://implementingquantlib.com>
<http://twitter.com/lballabio>


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users