/* ----------------------------------------------------------------------------
 * 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 OBGenericData : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~OBGenericData() {
    Dispose();
  }

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

  public OBGenericData(string attr, uint type, DataOrigin source) : this(openbabelPINVOKE.new_OBGenericData__SWIG_0(attr, type, (int)source), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public OBGenericData(string attr, uint type) : this(openbabelPINVOKE.new_OBGenericData__SWIG_1(attr, type), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public OBGenericData(string attr) : this(openbabelPINVOKE.new_OBGenericData__SWIG_2(attr), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public OBGenericData() : this(openbabelPINVOKE.new_OBGenericData__SWIG_3(), true) {
  }

  public virtual OBGenericData Clone(OBBase arg0) {
    IntPtr cPtr = openbabelPINVOKE.OBGenericData_Clone(swigCPtr, OBBase.getCPtr(arg0));
    OBGenericData ret = (cPtr == IntPtr.Zero) ? null : new OBGenericData(cPtr, false);
    return ret;
  }

  public void SetAttribute(string v) {
    openbabelPINVOKE.OBGenericData_SetAttribute(swigCPtr, v);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetOrigin(DataOrigin s) {
    openbabelPINVOKE.OBGenericData_SetOrigin(swigCPtr, (int)s);
  }

  public virtual string GetAttribute() {
    string ret = openbabelPINVOKE.OBGenericData_GetAttribute(swigCPtr);
    return ret;
  }

  public uint GetDataType() {
    uint ret = openbabelPINVOKE.OBGenericData_GetDataType(swigCPtr);
    return ret;
  }

  public virtual string GetValue() {
    string ret = openbabelPINVOKE.OBGenericData_GetValue(swigCPtr);
    return ret;
  }

  public virtual DataOrigin GetOrigin() {
    DataOrigin ret = (DataOrigin)openbabelPINVOKE.OBGenericData_GetOrigin(swigCPtr);
    return ret;
  }

}
