Problem with SWIG interface to Java : enumarations not wrapped

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

Problem with SWIG interface to Java : enumarations not wrapped

Ignace MARTIN
I have wrapped the quantlib library in java using swig and skwash (following the Skwash Tutorial).
I am trying to rewrite the SwapValuation example but I am blocked with enumeration classes such as TimeUnit or BusinessDayConvention which are not wrapped. The swig wrapper has created SWIGTYPE_p_*.java classes which give no help...
Hereafter is the example of SWIGTYPE_p_TimeUnit class. The problem is : I cannot create and affect a new TimeUnit object for use with for example Calendar.Advance function.
In date.i interface file I can find a timeunitFromString function which could be the solution if it was wrapped... but nothing equivalent in java classes.
Has someone an idea?
 
Ignace Martin
 
 
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.24
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */
 
package org.quantlib;
 
public class SWIGTYPE_p_TimeUnit {
  private long swigCPtr;
 
  protected SWIGTYPE_p_TimeUnit(long cPtr, boolean bFutureUse) {
    swigCPtr = cPtr;
  }
 
  protected SWIGTYPE_p_TimeUnit() {
    swigCPtr = 0;
  }
 
  protected static long getCPtr(SWIGTYPE_p_TimeUnit obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }
}
 
Reply | Threaded
Open this post in threaded view
|

Re: Problem with SWIG interface to Java : enumarations not wrapped

Luigi Ballabio
On 07/20/2005 03:06:10 PM, Ignace MARTIN wrote:
> I have wrapped the quantlib library in java using swig and skwash
> (following the Skwash Tutorial).
> I am trying to rewrite the SwapValuation example but I am blocked  
> with enumeration classes such as TimeUnit or BusinessDayConvention  
> which are not wrapped.

Ignace,
        you're probably using the .i files from the latest release.  
Wrapping to Java requires some modifications which I'm only now merging  
into the repository. I don't remember whether Johan made his modified  
interfaces available on his site; if not, you can ask him to post the  
ones for QuantLib 0.3.10.

Later,
        Luigi

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

Humphrey's Requirements Uncertainty Principle:
        For a new software system, the requirements will not be
        completely known until after the users have used it.