//------------------------------------------------------------------------------
// <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 AssetSwap : Swap {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

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

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AssetSwap 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_AssetSwap(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public AssetSwap(bool payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t bond, double bondCleanPrice, IborIndex index, double spread, Schedule floatSchedule, DayCounter floatingDayCount, bool parAssetSwap) : this(NQuantLibcPINVOKE.new_AssetSwap__SWIG_0(payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t.getCPtr(bond), bondCleanPrice, IborIndex.getCPtr(index), spread, Schedule.getCPtr(floatSchedule), DayCounter.getCPtr(floatingDayCount), parAssetSwap), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public AssetSwap(bool payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t bond, double bondCleanPrice, IborIndex index, double spread, Schedule floatSchedule, DayCounter floatingDayCount) : this(NQuantLibcPINVOKE.new_AssetSwap__SWIG_1(payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t.getCPtr(bond), bondCleanPrice, IborIndex.getCPtr(index), spread, Schedule.getCPtr(floatSchedule), DayCounter.getCPtr(floatingDayCount)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public AssetSwap(bool payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t bond, double bondCleanPrice, IborIndex index, double spread, Schedule floatSchedule) : this(NQuantLibcPINVOKE.new_AssetSwap__SWIG_2(payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t.getCPtr(bond), bondCleanPrice, IborIndex.getCPtr(index), spread, Schedule.getCPtr(floatSchedule)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public AssetSwap(bool payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t bond, double bondCleanPrice, IborIndex index, double spread) : this(NQuantLibcPINVOKE.new_AssetSwap__SWIG_3(payFixedRate, SWIGTYPE_p_ext__shared_ptrT_Bond_t.getCPtr(bond), bondCleanPrice, IborIndex.getCPtr(index), spread), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

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

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

}

}
