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

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

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

  public CPICashFlow(double notional, ZeroInflationIndex index, Date baseDate, double baseFixing, Date fixingDate, Date paymentDate, bool growthOnly, CPI.InterpolationType interpolation, Frequency frequency) : this(NQuantLibcPINVOKE.new_CPICashFlow__SWIG_0(notional, ZeroInflationIndex.getCPtr(index), Date.getCPtr(baseDate), baseFixing, Date.getCPtr(fixingDate), Date.getCPtr(paymentDate), growthOnly, (int)interpolation, (int)frequency), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public CPICashFlow(double notional, ZeroInflationIndex index, Date baseDate, double baseFixing, Date fixingDate, Date paymentDate, bool growthOnly, CPI.InterpolationType interpolation) : this(NQuantLibcPINVOKE.new_CPICashFlow__SWIG_1(notional, ZeroInflationIndex.getCPtr(index), Date.getCPtr(baseDate), baseFixing, Date.getCPtr(fixingDate), Date.getCPtr(paymentDate), growthOnly, (int)interpolation), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public CPICashFlow(double notional, ZeroInflationIndex index, Date baseDate, double baseFixing, Date fixingDate, Date paymentDate, bool growthOnly) : this(NQuantLibcPINVOKE.new_CPICashFlow__SWIG_2(notional, ZeroInflationIndex.getCPtr(index), Date.getCPtr(baseDate), baseFixing, Date.getCPtr(fixingDate), Date.getCPtr(paymentDate), growthOnly), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public CPICashFlow(double notional, ZeroInflationIndex index, Date baseDate, double baseFixing, Date fixingDate, Date paymentDate) : this(NQuantLibcPINVOKE.new_CPICashFlow__SWIG_3(notional, ZeroInflationIndex.getCPtr(index), Date.getCPtr(baseDate), baseFixing, Date.getCPtr(fixingDate), Date.getCPtr(paymentDate)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

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

  public CPI.InterpolationType interpolation() {
    CPI.InterpolationType ret = (CPI.InterpolationType)NQuantLibcPINVOKE.CPICashFlow_interpolation(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Frequency frequency() {
    Frequency ret = (Frequency)NQuantLibcPINVOKE.CPICashFlow_frequency(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
