internal RealmHandle(RealmHandle root) : base(true) { if (root == null) // if we are a root object, we need a list for our children and Root is already null { _unbindList = GetUnbindList(); } else { Root = root; root.LockAndUndbindList(); } }
/// <summary> /// Called by children to this root, when they would like to /// be unbound, but are (possibly) running in a finalizer thread /// so it is (possibly) not safe to unbind then directly. /// </summary> /// <param name="handleToUnbind">The core handle that is not needed anymore and should be unbound.</param> private void RequestUnbind(RealmHandle handleToUnbind) { lock (_unbindListLock) // You can lock a lock several times inside the same thread. The top-level-lock is the one that counts { // first let's see if we should go to the list or not if (_noMoreUserThread) { UnbindLockedList(); handleToUnbind.Unbind(); } else { _unbindList.Add(handleToUnbind); // resurrects handleToUnbind - but it is never a root object bc RequestUnbind is always called above with root. } } }
public QueryHandle(RealmHandle root) : base(root) { }
public ResultsHandle(RealmHandle root, IntPtr handle) : base(root, handle) { SnapshotCore = (out NativeException ex) => NativeMethods.snapshot(this, out ex); }
private TableHandle(RealmHandle root) : base(root) { }
public static extern void remove(ObjectHandle handle, RealmHandle realmHandle, out NativeException ex);
protected CollectionHandleBase(RealmHandle root, IntPtr handle) : base(root, handle) { }
public ResultsHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
public QueryHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
public SortDescriptorHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
// if root is null the this tablehandle is responsible for cleaning up the tableView and its children // if root is something else, it is the this tablehandles root, and that root should also manage the tableview and its children // note that IgnoreUnbind is set to false, the tableview should be unbound /* * private TableViewHandle RootedTableViewHandle() * { * return (Root == null) ? * new TableViewHandle(this): * new TableViewHandle(Root); * } */ // call with a parent, will set the correct root (parent if parent.root=null, or parent.root otherwise) // if You want a RootedTableHandle with is self-rooted, call with no parameter internal static TableHandle RootedTableHandle(RealmHandle parent) { return(new TableHandle(parent.Root ?? parent)); }
protected CollectionHandleBase(RealmHandle root) : base(root) { }
public TableHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
public DictionaryHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
public ListHandle(RealmHandle root) : base(root) { }
// call with a parent, will set the correct root (parent if parent.root=null, or parent.root otherwise) // if You want a RootedTableHandle with is self-rooted, call with no parameter internal static TableHandle RootedTableHandle(RealmHandle parent) { return new TableHandle(parent.Root ?? parent); }
public ObjectHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
public ListHandle(RealmHandle root, IntPtr handle) : base(root, handle) { }
internal ListHandle(RealmHandle root) : base(root) { }
protected NotifiableObjectHandleBase(RealmHandle root, IntPtr handle) : base(root, handle) { }