/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * 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 FeatureDefn : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  public virtual void Dispose() {
    if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
      swigCMemOwn = false;
      throw new MethodAccessException("C++ destructor does not have public access");
    }
    swigCPtr = new HandleRef(null, IntPtr.Zero);
    GC.SuppressFinalize(this);
  }

  public FeatureDefn(string name) : this(ogrPINVOKE.new_FeatureDefn(name), true) {
  }

  public void Destroy() {
    ogrPINVOKE.FeatureDefn_Destroy(swigCPtr);
  }

  public string GetName() {
    string ret = ogrPINVOKE.FeatureDefn_GetName(swigCPtr);
    return ret;
  }

  public int GetFieldCount() {
    int ret = ogrPINVOKE.FeatureDefn_GetFieldCount(swigCPtr);
    return ret;
  }

  public FieldDefn GetFieldDefn(int i) {
    IntPtr cPtr = ogrPINVOKE.FeatureDefn_GetFieldDefn(swigCPtr, i);
    FieldDefn ret = (cPtr == IntPtr.Zero) ? null : new FieldDefn(cPtr, true);
    return ret;
  }

  public int GetFieldIndex(string name) {
    int ret = ogrPINVOKE.FeatureDefn_GetFieldIndex(swigCPtr, name);
    return ret;
  }

  public void AddFieldDefn(FieldDefn defn) {
    ogrPINVOKE.FeatureDefn_AddFieldDefn(swigCPtr, FieldDefn.getCPtr(defn));
  }

  public int GetGeomType() {
    int ret = ogrPINVOKE.FeatureDefn_GetGeomType(swigCPtr);
    return ret;
  }

  public void SetGeomType(int geom_type) {
    ogrPINVOKE.FeatureDefn_SetGeomType(swigCPtr, geom_type);
  }

  public int Reference() {
    int ret = ogrPINVOKE.FeatureDefn_Reference(swigCPtr);
    return ret;
  }

  public int Dereference() {
    int ret = ogrPINVOKE.FeatureDefn_Dereference(swigCPtr);
    return ret;
  }

  public int GetReferenceCount() {
    int ret = ogrPINVOKE.FeatureDefn_GetReferenceCount(swigCPtr);
    return ret;
  }

}
