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

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

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

  public EquityIndex(string name, Calendar fixingCalendar, YieldTermStructureHandle interest, YieldTermStructureHandle dividend, QuoteHandle spot) : this(NQuantLibcPINVOKE.new_EquityIndex__SWIG_0(name, Calendar.getCPtr(fixingCalendar), YieldTermStructureHandle.getCPtr(interest), YieldTermStructureHandle.getCPtr(dividend), QuoteHandle.getCPtr(spot)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public EquityIndex(string name, Calendar fixingCalendar, YieldTermStructureHandle interest, YieldTermStructureHandle dividend) : this(NQuantLibcPINVOKE.new_EquityIndex__SWIG_1(name, Calendar.getCPtr(fixingCalendar), YieldTermStructureHandle.getCPtr(interest), YieldTermStructureHandle.getCPtr(dividend)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public EquityIndex(string name, Calendar fixingCalendar, YieldTermStructureHandle interest) : this(NQuantLibcPINVOKE.new_EquityIndex__SWIG_2(name, Calendar.getCPtr(fixingCalendar), YieldTermStructureHandle.getCPtr(interest)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public EquityIndex(string name, Calendar fixingCalendar) : this(NQuantLibcPINVOKE.new_EquityIndex__SWIG_3(name, Calendar.getCPtr(fixingCalendar)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public YieldTermStructureHandle equityInterestRateCurve() {
    YieldTermStructureHandle ret = new YieldTermStructureHandle(NQuantLibcPINVOKE.EquityIndex_equityInterestRateCurve(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public YieldTermStructureHandle equityDividendCurve() {
    YieldTermStructureHandle ret = new YieldTermStructureHandle(NQuantLibcPINVOKE.EquityIndex_equityDividendCurve(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public QuoteHandle spot() {
    QuoteHandle ret = new QuoteHandle(NQuantLibcPINVOKE.EquityIndex_spot(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public EquityIndex clone(YieldTermStructureHandle interest, YieldTermStructureHandle dividend, QuoteHandle spot) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.EquityIndex_clone(swigCPtr, YieldTermStructureHandle.getCPtr(interest), YieldTermStructureHandle.getCPtr(dividend), QuoteHandle.getCPtr(spot));
    EquityIndex ret = (cPtr == global::System.IntPtr.Zero) ? null : new EquityIndex(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
