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

namespace QuantLib {

public class ZeroInflationCashFlow : CashFlow {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  private bool swigCMemOwnDerived;

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

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

  public ZeroInflationCashFlow(double notional, ZeroInflationIndex index, CPI.InterpolationType observationInterpolation, Date startDate, Date endDate, Period observationLag, Date paymentDate, bool growthOnly) : this(NQuantLibcPINVOKE.new_ZeroInflationCashFlow__SWIG_0(notional, ZeroInflationIndex.getCPtr(index), (int)observationInterpolation, Date.getCPtr(startDate), Date.getCPtr(endDate), Period.getCPtr(observationLag), Date.getCPtr(paymentDate), growthOnly), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public ZeroInflationCashFlow(double notional, ZeroInflationIndex index, CPI.InterpolationType observationInterpolation, Date startDate, Date endDate, Period observationLag, Date paymentDate) : this(NQuantLibcPINVOKE.new_ZeroInflationCashFlow__SWIG_1(notional, ZeroInflationIndex.getCPtr(index), (int)observationInterpolation, Date.getCPtr(startDate), Date.getCPtr(endDate), Period.getCPtr(observationLag), Date.getCPtr(paymentDate)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

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

  public Date baseDate() {
    Date ret = new Date(NQuantLibcPINVOKE.ZeroInflationCashFlow_baseDate(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Date fixingDate() {
    Date ret = new Date(NQuantLibcPINVOKE.ZeroInflationCashFlow_fixingDate(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool growthOnly() {
    bool ret = NQuantLibcPINVOKE.ZeroInflationCashFlow_growthOnly(swigCPtr);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

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

}

}
