internal ListHandle TableLinkList(IntPtr propertyIndex) { var listHandle = new ListHandle(Root ?? this); listHandle.SetHandle(GetLinklist(propertyIndex)); return(listHandle); }
public RealmList <T> GetList <T>(Realm realm, IntPtr propertyIndex, string objectType) { var listHandle = new ListHandle(Root ?? this, GetLinklist(propertyIndex)); var metadata = objectType == null ? null : realm.Metadata[objectType]; return(new RealmList <T>(realm, listHandle, metadata)); }
/// <summary> /// Returns the same collection as the one referenced when the <see cref="ThreadSafeReference.List{T}"/> was first created, /// but resolved for the current Realm for this thread. /// </summary> /// <param name="reference">The thread-safe reference to the thread-confined <see cref="IList{T}"/> to resolve in this <see cref="Realm"/>.</param> /// <typeparam name="T">The type of the objects, contained in the collection.</typeparam> /// <returns> /// A thread-confined instance of the original <see cref="IList{T}"/> resolved for the current thread or <c>null</c> /// if the list's parent object has been deleted after the reference was created. /// </returns> public IList <T> ResolveReference <T>(ThreadSafeReference.List <T> reference) { var listPtr = SharedRealmHandle.ResolveReference(reference); var listHandle = new ListHandle(SharedRealmHandle, listPtr); if (!listHandle.IsValid) { return(null); } return(new RealmList <T>(this, listHandle, reference.Metadata)); }
/// <summary> /// Returns the same collection as the one referenced when the <see cref="ThreadSafeReference.List{T}"/> was first created, /// but resolved for the current Realm for this thread. /// </summary> /// <param name="reference">The thread-safe reference to the thread-confined <see cref="IList{T}"/> to resolve in this <see cref="Realm"/>.</param> /// <typeparam name="T">The type of the object, contained in the collection.</typeparam> /// <returns> /// A thread-confined instance of the original <see cref="IList{T}"/> resolved for the current thread or <c>null</c> /// if the list's parent object has been deleted after the reference was created. /// </returns> public IList<T> ResolveReference<T>(ThreadSafeReference.List<T> reference) where T : RealmObject { var listPtr = SharedRealmHandle.ResolveReference(reference); var listHandle = new ListHandle(SharedRealmHandle); listHandle.SetHandle(listPtr); if (!listHandle.IsValid) { return null; } return new RealmList<T>(this, listHandle, reference.Metadata); }
internal ListHandle TableLinkList(IntPtr propertyIndex) { var listHandle = new ListHandle(Root ?? this); // At this point sh is invalid due to its handle being uninitialized, but the root is set correctly // a finalize at this point will not leak anything and the handle will not do anything // now, set the TableView handle... RuntimeHelpers.PrepareConstrainedRegions(); // the following finally will run with no out-of-band exceptions try { } finally { listHandle.SetHandle(this.GetLinklist(propertyIndex)); } // at this point we have atomically acquired a handle and also set the root correctly so it can be unbound correctly return(listHandle); }
public static extern bool get_is_frozen(ListHandle list, out NativeException ex);
public static extern IntPtr get_thread_safe_reference(ListHandle listHandle, out NativeException ex);
public static extern IntPtr move(ListHandle listHandle, IntPtr sourceIndex, IntPtr targetIndex, out NativeException ex);
public static extern void insert(ListHandle listHandle, IntPtr targetIndex, ObjectHandle objectHandle, out NativeException ex);
public static extern void insert_value(ListHandle listHandle, IntPtr targetIndex, PrimitiveValue value, out NativeException ex);
public static extern void add_value(ListHandle listHandle, PrimitiveValue value, out NativeException ex);
public static extern IntPtr get_object(ListHandle listHandle, IntPtr link_ndx, out NativeException ex);
public static extern IntPtr move(ListHandle listHandle, ObjectHandle objectHandle, IntPtr targetIndex, out NativeException ex);
public static extern IntPtr add_notification_callback(ListHandle listHandle, IntPtr managedListHandle, NotificationCallbackDelegate callback, out NativeException ex);
public static extern IntPtr size(ListHandle listHandle, out NativeException ex);
public static extern IntPtr find(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
public static extern IntPtr get(ListHandle listHandle, IntPtr link_ndx, out NativeException ex);
public static extern void clear(ListHandle listHandle, out NativeException ex);
public static extern void erase(ListHandle listHandle, IntPtr rowIndex, out NativeException ex);
public static extern void insert_binary(ListHandle listHandle, IntPtr targetIndex, IntPtr buffer, IntPtr bufferLength, [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
public static extern void get_value(ListHandle listHandle, IntPtr link_ndx, out PrimitiveValue value, out NativeException ex);
public static extern IntPtr get_string(ListHandle listHandle, IntPtr link_ndx, IntPtr buffer, IntPtr bufsize, [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
public static extern IntPtr add_embedded(ListHandle listHandle, out NativeException ex);
public static extern IntPtr insert_embedded(ListHandle listHandle, IntPtr targetIndex, out NativeException ex);
public static extern void add(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
public static extern IntPtr find_value(ListHandle listHandle, PrimitiveValue value, out NativeException ex);
public static extern void add_object(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
public static extern void add_primitive(ListHandle listHandle, IntPtr value, out NativeException ex);
public static extern void add_string(ListHandle listHandle, [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLength, [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
public static extern bool get_is_valid(ListHandle listHandle, out NativeException ex);
public static extern void set_primitive(ListHandle listHandle, IntPtr targetIndex, IntPtr value, out NativeException ex);
public static extern IntPtr snapshot(ListHandle list, out NativeException ex);
public static extern void insert_object(ListHandle listHandle, IntPtr targetIndex, ObjectHandle objectHandle, out NativeException ex);
public static extern IntPtr freeze(ListHandle handle, SharedRealmHandle frozen_realm, out NativeException ex);
public static extern void insert_string(ListHandle listHandle, IntPtr targetIndex, [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);