1/* ---------------------------------------------------------------------------- 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3.38 4 * 5 * Do not make changes to this file unless you know what you are doing--modify 6 * the SWIG interface file instead. 7 * ----------------------------------------------------------------------------- */ 8 9namespace BerkeleyDB.Internal { 10 11using System; 12using System.Runtime.InteropServices; 13 14internal class DBT : IDisposable { 15 private HandleRef swigCPtr; 16 protected bool swigCMemOwn; 17 18 internal DBT(IntPtr cPtr, bool cMemoryOwn) { 19 swigCMemOwn = cMemoryOwn; 20 swigCPtr = new HandleRef(this, cPtr); 21 } 22 23 internal static HandleRef getCPtr(DBT obj) { 24 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 25 } 26 27 ~DBT() { 28 Dispose(); 29 } 30 31 public virtual void Dispose() { 32 lock(this) { 33 if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) { 34 swigCMemOwn = false; 35 libdb_csharpPINVOKE.delete_DBT(swigCPtr); 36 } 37 swigCPtr = new HandleRef(null, IntPtr.Zero); 38 GC.SuppressFinalize(this); 39 } 40 } 41 42 internal IntPtr dataPtr { 43 get { 44 return libdb_csharpPINVOKE.DBT_data_get(swigCPtr); 45 } 46 } 47 48 internal uint dlen { 49 set { 50 libdb_csharpPINVOKE.DBT_dlen_set(swigCPtr, value); 51 } 52 get { 53 uint ret = libdb_csharpPINVOKE.DBT_dlen_get(swigCPtr); 54 return ret; 55 } 56 } 57 58 internal uint doff { 59 set { 60 libdb_csharpPINVOKE.DBT_doff_set(swigCPtr, value); 61 } 62 get { 63 uint ret = libdb_csharpPINVOKE.DBT_doff_get(swigCPtr); 64 return ret; 65 } 66 } 67 68 internal uint flags { 69 set { 70 libdb_csharpPINVOKE.DBT_flags_set(swigCPtr, value); 71 } 72 get { 73 uint ret = libdb_csharpPINVOKE.DBT_flags_get(swigCPtr); 74 return ret; 75 } 76 } 77 78 internal uint size { 79 set { 80 libdb_csharpPINVOKE.DBT_size_set(swigCPtr, value); 81 } 82 get { 83 uint ret = libdb_csharpPINVOKE.DBT_size_get(swigCPtr); 84 return ret; 85 } 86 } 87 88 internal uint ulen { 89 set { 90 libdb_csharpPINVOKE.DBT_ulen_set(swigCPtr, value); 91 } 92 get { 93 uint ret = libdb_csharpPINVOKE.DBT_ulen_get(swigCPtr); 94 return ret; 95 } 96 } 97 98 internal byte[] data { 99 set { 100 IntPtr _data = Marshal.AllocHGlobal(value.Length); 101 Marshal.Copy(value, 0, _data, value.Length); 102 libdb_csharpPINVOKE.DBT_data_set(swigCPtr, _data); 103 size = (uint)value.Length; 104 } 105 106 get { 107 IntPtr datap = libdb_csharpPINVOKE.DBT_data_get(swigCPtr); 108 int sz = (int)size; 109 byte[] ret = new byte[sz]; 110 Marshal.Copy(datap, ret, 0, sz); 111 return ret; 112 } 113 114 } 115 116 internal DatabaseEntry app_data { 117 set { 118 libdb_csharpPINVOKE.DBT_app_data_set(swigCPtr, value); 119 } 120 get { return libdb_csharpPINVOKE.DBT_app_data_get(swigCPtr); } 121 122 } 123 124 internal DBT() : this(libdb_csharpPINVOKE.new_DBT(), true) { 125 flags = DbConstants.DB_DBT_USERCOPY; 126 } 127} 128 129} 130