internal profile_hook_info(delegate_profile func, object v) { _func = func; _user_data = v; _h = GCHandle.Alloc(this); }
void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v) { if (_profile_hook != null) { // TODO maybe turn off the hook here, for now _profile_hook.free(); _profile_hook = null; } if (func != null) { _profile_hook = new profile_hook_info(func, v); SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_profile(profile_hook_bridge)).ToInt64(), _profile_hook.ptr.ToInt64()); } else { SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64()); } }
internal void free() { _func = null; _user_data = null; _h.Free(); }
void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v) { throw new Exception(GRIPE); }
public profile_hook_info(delegate_profile func, object v) { _func = func; _user_data = v; }
static public void sqlite3_profile(sqlite3 db, delegate_profile f, object v) { _imp.sqlite3_profile(db.ptr, f, v); }
void ISQLite3Provider.sqlite3_profile (IntPtr db, delegate_profile func, object v) { var info = hooks.getOrCreateFor (db); if (info.profile != null) { // TODO maybe turn off the hook here, for now info.profile.free (); info.profile = null; } if (func != null) { info.profile = new profile_hook_info (func, v); NativeMethods.sqlite3_profile (db, profile_hook_bridge, info.profile.ptr); } else { NativeMethods.sqlite3_profile (db, null, IntPtr.Zero); } }
public static void profile(this sqlite3 db, delegate_profile f, object v) { raw.sqlite3_profile(db, f, v); }
public void sqlite3_profile(IntPtr db, delegate_profile func, object v) => throw new NotImplementedException();
void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v) { if (_profile_hook != null) { // TODO maybe turn off the hook here, for now _profile_hook.free(); _profile_hook = null; } if (func != null) { _profile_hook = new profile_hook_info(func, v); NativeMethods.sqlite3_profile(db, profile_hook_bridge, _profile_hook.ptr); } else { NativeMethods.sqlite3_profile(db, null, IntPtr.Zero); } }
void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v) { var info = hooks.getOrCreateFor(db); if (info.profile != null) { // TODO maybe turn off the hook here, for now info.profile.free(); info.profile = null; } if (func != null) { info.profile = new profile_hook_info(func, v); SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(profile_hook_bridge).ToInt64(), info.profile.ptr.ToInt64()); } else { SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64()); } }