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

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

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

  public FdmStepConditionComposite(DoubleVector stoppingTimes, FdmStepConditionVector conditions) : this(NQuantLibcPINVOKE.new_FdmStepConditionComposite(DoubleVector.getCPtr(stoppingTimes), FdmStepConditionVector.getCPtr(conditions)), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

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

  public FdmStepConditionVector conditions() {
    FdmStepConditionVector ret = new FdmStepConditionVector(NQuantLibcPINVOKE.FdmStepConditionComposite_conditions(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static FdmStepConditionComposite joinConditions(FdmSnapshotCondition c1, FdmStepConditionComposite c2) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.FdmStepConditionComposite_joinConditions(FdmSnapshotCondition.getCPtr(c1), FdmStepConditionComposite.getCPtr(c2));
    FdmStepConditionComposite ret = (cPtr == global::System.IntPtr.Zero) ? null : new FdmStepConditionComposite(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static FdmStepConditionComposite vanillaComposite(DividendSchedule schedule, Exercise exercise, FdmMesher mesher, FdmInnerValueCalculator calculator, Date refDate, DayCounter dayCounter) {
    global::System.IntPtr cPtr = NQuantLibcPINVOKE.FdmStepConditionComposite_vanillaComposite(DividendSchedule.getCPtr(schedule), Exercise.getCPtr(exercise), FdmMesher.getCPtr(mesher), FdmInnerValueCalculator.getCPtr(calculator), Date.getCPtr(refDate), DayCounter.getCPtr(dayCounter));
    FdmStepConditionComposite ret = (cPtr == global::System.IntPtr.Zero) ? null : new FdmStepConditionComposite(cPtr, true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
