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

using System;
public class DbTxn : IDisposable {
  private IntPtr swigCPtr;
  protected bool swigCMemOwn;

  internal DbTxn(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected DbTxn() : this(IntPtr.Zero, false) {
  }

  public virtual void Dispose() {
    delete();
  }

  private virtual void delete() {
    if(swigCPtr != IntPtr.Zero && swigCMemOwn) {
      swigCMemOwn = false;
    }
    swigCPtr = IntPtr.Zero;
  }

  internal static IntPtr getCPtr(DbTxn obj) {
    return (obj == null) ? IntPtr.Zero : obj.swigCPtr;
  }

  public int abort() {
    return dbxml_dotnetPINVOKE.DbTxn_abort(swigCPtr);
  }

  public int commit(uint flags) {
    return dbxml_dotnetPINVOKE.DbTxn_commit(swigCPtr, flags);
  }

  public int discard(uint flags) {
    return dbxml_dotnetPINVOKE.DbTxn_discard(swigCPtr, flags);
  }

  public uint id() {
    return dbxml_dotnetPINVOKE.DbTxn_id(swigCPtr);
  }

  public int set_timeout(long timeout, uint flags) {
    return dbxml_dotnetPINVOKE.DbTxn_set_timeout(swigCPtr, timeout, flags);
  }

}
