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

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

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

  public NonstandardSwap(VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, bool intermediateCapitalExchange, bool finalCapitalExchange, BusinessDayConvention paymentConvention) : this(NQuantLibcPINVOKE.new_NonstandardSwap__SWIG_0((int)type, DoubleVector.getCPtr(fixedNominal), DoubleVector.getCPtr(floatingNominal), Schedule.getCPtr(fixedSchedule), DoubleVector.getCPtr(fixedRate), DayCounter.getCPtr(fixedDayCount), Schedule.getCPtr(floatSchedule), IborIndex.getCPtr(index), DoubleVector.getCPtr(gearing), DoubleVector.getCPtr(spread), DayCounter.getCPtr(floatDayCount), intermediateCapitalExchange, finalCapitalExchange, (int)paymentConvention), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public NonstandardSwap(VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, bool intermediateCapitalExchange, bool finalCapitalExchange) : this(NQuantLibcPINVOKE.new_NonstandardSwap__SWIG_1((int)type, DoubleVector.getCPtr(fixedNominal), DoubleVector.getCPtr(floatingNominal), Schedule.getCPtr(fixedSchedule), DoubleVector.getCPtr(fixedRate), DayCounter.getCPtr(fixedDayCount), Schedule.getCPtr(floatSchedule), IborIndex.getCPtr(index), DoubleVector.getCPtr(gearing), DoubleVector.getCPtr(spread), DayCounter.getCPtr(floatDayCount), intermediateCapitalExchange, finalCapitalExchange), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public NonstandardSwap(VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, bool intermediateCapitalExchange) : this(NQuantLibcPINVOKE.new_NonstandardSwap__SWIG_2((int)type, DoubleVector.getCPtr(fixedNominal), DoubleVector.getCPtr(floatingNominal), Schedule.getCPtr(fixedSchedule), DoubleVector.getCPtr(fixedRate), DayCounter.getCPtr(fixedDayCount), Schedule.getCPtr(floatSchedule), IborIndex.getCPtr(index), DoubleVector.getCPtr(gearing), DoubleVector.getCPtr(spread), DayCounter.getCPtr(floatDayCount), intermediateCapitalExchange), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public NonstandardSwap(VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount) : this(NQuantLibcPINVOKE.new_NonstandardSwap__SWIG_3((int)type, DoubleVector.getCPtr(fixedNominal), DoubleVector.getCPtr(floatingNominal), Schedule.getCPtr(fixedSchedule), DoubleVector.getCPtr(fixedRate), DayCounter.getCPtr(fixedDayCount), Schedule.getCPtr(floatSchedule), IborIndex.getCPtr(index), DoubleVector.getCPtr(gearing), DoubleVector.getCPtr(spread), DayCounter.getCPtr(floatDayCount)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public VanillaSwap.Type type() {
    VanillaSwap.Type ret = (VanillaSwap.Type)NQuantLibcPINVOKE.NonstandardSwap_type(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DoubleVector fixedNominal() {
    DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.NonstandardSwap_fixedNominal(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DoubleVector floatingNominal() {
    DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.NonstandardSwap_floatingNominal(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Schedule fixedSchedule() {
    Schedule ret = new Schedule(NQuantLibcPINVOKE.NonstandardSwap_fixedSchedule(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DoubleVector fixedRate() {
    DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.NonstandardSwap_fixedRate(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DayCounter fixedDayCount() {
    DayCounter ret = new DayCounter(NQuantLibcPINVOKE.NonstandardSwap_fixedDayCount(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Schedule floatingSchedule() {
    Schedule ret = new Schedule(NQuantLibcPINVOKE.NonstandardSwap_floatingSchedule(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

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

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

  public DoubleVector spreads() {
    DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.NonstandardSwap_spreads(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DoubleVector gearings() {
    DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.NonstandardSwap_gearings(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public DayCounter floatingDayCount() {
    DayCounter ret = new DayCounter(NQuantLibcPINVOKE.NonstandardSwap_floatingDayCount(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public BusinessDayConvention paymentConvention() {
    BusinessDayConvention ret = (BusinessDayConvention)NQuantLibcPINVOKE.NonstandardSwap_paymentConvention(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Leg fixedLeg() {
    Leg ret = new Leg(NQuantLibcPINVOKE.NonstandardSwap_fixedLeg(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Leg floatingLeg() {
    Leg ret = new Leg(NQuantLibcPINVOKE.NonstandardSwap_floatingLeg(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
