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


using System;
using System.Runtime.InteropServices;

public class OBExternalBond : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal OBExternalBond(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(OBExternalBond obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~OBExternalBond() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        openbabelPINVOKE.delete_OBExternalBond(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public OBExternalBond() : this(openbabelPINVOKE.new_OBExternalBond__SWIG_0(), true) {
  }

  public OBExternalBond(OBAtom arg0, OBBond arg1, int arg2) : this(openbabelPINVOKE.new_OBExternalBond__SWIG_1(OBAtom.getCPtr(arg0), OBBond.getCPtr(arg1), arg2), true) {
  }

  public OBExternalBond(OBExternalBond arg0) : this(openbabelPINVOKE.new_OBExternalBond__SWIG_2(OBExternalBond.getCPtr(arg0)), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public int GetIdx() {
    int ret = openbabelPINVOKE.OBExternalBond_GetIdx(swigCPtr);
    return ret;
  }

  public OBAtom GetAtom() {
    IntPtr cPtr = openbabelPINVOKE.OBExternalBond_GetAtom(swigCPtr);
    OBAtom ret = (cPtr == IntPtr.Zero) ? null : new OBAtom(cPtr, false);
    return ret;
  }

  public OBBond GetBond() {
    IntPtr cPtr = openbabelPINVOKE.OBExternalBond_GetBond(swigCPtr);
    OBBond ret = (cPtr == IntPtr.Zero) ? null : new OBBond(cPtr, false);
    return ret;
  }

  public void SetIdx(int idx) {
    openbabelPINVOKE.OBExternalBond_SetIdx(swigCPtr, idx);
  }

  public void SetAtom(OBAtom atom) {
    openbabelPINVOKE.OBExternalBond_SetAtom(swigCPtr, OBAtom.getCPtr(atom));
  }

  public void SetBond(OBBond bond) {
    openbabelPINVOKE.OBExternalBond_SetBond(swigCPtr, OBBond.getCPtr(bond));
  }

}
