Quantlib, Java: shortcoming

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

Quantlib, Java: shortcoming

Arif Shoshi
Dear quantlib-users,

has probably someone faced the following problem:

I have generated the Java interface (.dll and .jar files) of quantlib from QuantLib-SWIG-1.0 files. The Java interface is working fine, except one thing: when debugging the java code using the eclipse environment, the functionality of "Inspect" and "Watch" of Eclipse works only partially: I can "inspect" (watch) the variables of some quantlib types, like Date, but not those relates to a shared_ptr on the C++ side!

For example, suppose we have

Date dateX = ...
and
Ratehelper helper = ...  
or
Yiedtermstructure ytstr = ...

When I use "inspect" (or watch) in eclipse in the debugging mode to investigate "dateX", I would see the date, like "22 Apr. 2010", contained in dateX which is what I want. However, "inspect" (or watch) in the case of "helper" (ytstr) would not show the content of "helper" (ytstr). What I get is: "quantlib@........" . It looks to me like the "shared_ptr" functionality of quantlib is not allowing the debugging. In the case of dateX there is no shared_ptr involved.


Does anyone have an idea of how to overcome this shortcoming? I would appreciate any help.

Best regards,
Arif



--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Quantlib, Java: shortcoming

Luigi Ballabio
On Mon, 2010-05-10 at 22:50 +0200, Arif Shoshi wrote:
> When I use "inspect" (or watch) in eclipse in the debugging mode to
> investigate "dateX", I would see the date, like "22 Apr. 2010",
> contained in dateX which is what I want. However, "inspect" (or watch)
> in the case of "helper" (ytstr) would not show the content of
> "helper" (ytstr). What I get is: "quantlib@........" .

Arif,
        I guess that it works with Date only because it provides a toString()
method that Eclipse can call.  The Date class is just as opaque as
RateHelper; it just contains a textual representation of a pointer to
the wrapped object (which is what you're seeing.) Sorry, but I'm afraid
it's a limitation of the SWIG-generated wrappers.

Luigi


--

When all else fails, pour a pint of Guinness in the gas tank,
advance the spark 20 degrees, cry "God Save the Queen!", and pull
the starter knob.
-- MG "Series MGA" Workshop Manual



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users