//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------

namespace QuantLib {

public class FloatFloatSwaption : Instrument {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

  internal FloatFloatSwaption(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NQuantLibcPINVOKE.FloatFloatSwaption_SWIGSmartPtrUpcast(cPtr), true) {
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FloatFloatSwaption obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwnDerived) {
          swigCMemOwnDerived = false;
          NQuantLibcPINVOKE.delete_FloatFloatSwaption(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public FloatFloatSwaption(FloatFloatSwap swap, Exercise exercise, Settlement.Type delivery, Settlement.Method settlementMethod) : this(NQuantLibcPINVOKE.new_FloatFloatSwaption__SWIG_0(FloatFloatSwap.getCPtr(swap), Exercise.getCPtr(exercise), (int)delivery, (int)settlementMethod), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public FloatFloatSwaption(FloatFloatSwap swap, Exercise exercise, Settlement.Type delivery) : this(NQuantLibcPINVOKE.new_FloatFloatSwaption__SWIG_1(FloatFloatSwap.getCPtr(swap), Exercise.getCPtr(exercise), (int)delivery), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public FloatFloatSwaption(FloatFloatSwap swap, Exercise exercise) : this(NQuantLibcPINVOKE.new_FloatFloatSwaption__SWIG_2(FloatFloatSwap.getCPtr(swap), Exercise.getCPtr(exercise)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public FloatFloatSwap underlyingSwap() {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.FloatFloatSwaption_underlyingSwap(swigCPtr);
    FloatFloatSwap ret = (cPtr == global::System.IntPtr.Zero) ? null : new FloatFloatSwap(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public BlackCalibrationHelperVector calibrationBasket(SwapIndex swapIndex, SwaptionVolatilityStructure swaptionVolatility, string typeStr) {
    BlackCalibrationHelperVector ret = new BlackCalibrationHelperVector(NQuantLibcPINVOKE.FloatFloatSwaption_calibrationBasket(swigCPtr, SwapIndex.getCPtr(swapIndex), SwaptionVolatilityStructure.getCPtr(swaptionVolatility), typeStr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double underlyingValue() {
    double ret = NQuantLibcPINVOKE.FloatFloatSwaption_underlyingValue(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DoubleVector probabilities() {
    DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.FloatFloatSwaption_probabilities(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
