From 90249dd31f0e35b41d67e33a3a84434458652753 Mon Sep 17 00:00:00 2001 From: Bruno da Silva Belo Date: Tue, 8 Oct 2019 21:49:04 -0300 Subject: [PATCH] csharp: updating eina_accessor docs and hide api. Reviewers: felipealmeida, lauromoura, segfaultxavi, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8293 Differential Revision: https://phab.enlightenment.org/D10308 --- src/bindings/mono/eina_mono/eina_accessor.cs | 66 ++++++++++++++------ 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/src/bindings/mono/eina_mono/eina_accessor.cs b/src/bindings/mono/eina_mono/eina_accessor.cs index 5880503062..c848a2cf97 100644 --- a/src/bindings/mono/eina_mono/eina_accessor.cs +++ b/src/bindings/mono/eina_mono/eina_accessor.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.ComponentModel; using static Eina.TraitFunctions; @@ -20,19 +21,23 @@ internal class AccessorNativeFunctions /// Accessors provide an uniform way of accessing Eina containers, /// similar to C++ STL's and C# IEnumerable. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class Accessor : IEnumerable, IDisposable { /// Pointer to the native accessor. + [EditorBrowsable(EditorBrowsableState.Never)] public IntPtr Handle { get; private set; } = IntPtr.Zero; - /// Who is in charge of releasing the resources wrapped by this instance. + /// Who is in charge of releasing the resources wrapped by this instance. + /// Since EFL 1.23. + /// private Ownership Ownership { get; set; } // FIXME Part of the implicit EFL Container interface. Need to make it explicit. - ///Whether this wrapper owns the native accessor. + /// Whether this wrapper owns the native accessor. + /// Since EFL 1.23. + /// public bool Own { get @@ -45,31 +50,42 @@ public class Accessor : IEnumerable, IDisposable } } - /// Create a new accessor wrapping the given pointer. + /// Create a new accessor wrapping the given pointer. + /// Since EFL 1.23. + /// /// The native handle to be wrapped. /// Whether this wrapper owns the native accessor. + [EditorBrowsable(EditorBrowsableState.Never)] public Accessor(IntPtr handle, Ownership owner = Ownership.Managed) { Handle = handle; Ownership = owner; } - /// Create a new accessor wrapping the given pointer. + /// Create a new accessor wrapping the given pointer. + /// Since EFL 1.23. + /// /// The native handle to be wrapped. /// Whether this wrapper owns the native accessor. /// For compatibility with other EFL# containers. Ignored in acessors. + [EditorBrowsable(EditorBrowsableState.Never)] public Accessor(IntPtr handle, bool own, bool ownContent = false) : this(handle, own ? Ownership.Managed : Ownership.Unmanaged) { } - /// Release the native resources held by this instance. + /// Release the native resources held by this instance. + /// Since EFL 1.23. + /// public void Dispose() { Dispose(true); } - /// Disposes of this wrapper, releasing the native accessor if owned. + /// Disposes of this wrapper, releasing the native accessor if + /// owned. + /// Since EFL 1.23. + /// /// True if this was called from public method. False if /// called from the C# finalizer. protected virtual void Dispose(bool disposing) @@ -88,22 +104,28 @@ public class Accessor : IEnumerable, IDisposable } } - /// Finalizer to be called from the Garbage Collector. + /// Finalizer to be called from the Garbage Collector. + /// Since EFL 1.23. + /// ~Accessor() { Dispose(false); } /// Convert the native data into managed. This is used when returning the data through a - /// . + /// . + /// Since EFL 1.23. + /// /// The data to be converted /// The managed data representing data. - protected virtual T Convert(IntPtr data) + internal virtual T Convert(IntPtr data) { return NativeToManaged(data); } - /// Returns an enumerator that iterates throught this accessor. + /// Returns an enumerator that iterates throught this accessor. + /// Since EFL 1.23. + /// /// An enumerator to walk through the acessor items. public IEnumerator GetEnumerator() { @@ -137,14 +159,16 @@ public class Accessor : IEnumerable, IDisposable } /// Accessor for Inlists. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class AccessorInList : Accessor { - /// Create a new accessor wrapping the given pointer. + /// Create a new accessor wrapping the given pointer. + /// Since EFL 1.23. + /// /// The native handle to be wrapped. /// Whether this wrapper owns the native accessor. + [EditorBrowsable(EditorBrowsableState.Never)] public AccessorInList(IntPtr handle, Ownership own) : base(handle, own) { } @@ -153,21 +177,23 @@ public class AccessorInList : Accessor /// . /// The data to be converted /// The managed data representing data. - protected override T Convert(IntPtr data) + internal override T Convert(IntPtr data) { return NativeToManagedInlistNode(data); } } /// Accessor for Inarrays. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class AccessorInArray : Accessor { - /// Create a new accessor wrapping the given pointer. + /// Create a new accessor wrapping the given pointer. + /// Since EFL 1.23. + /// /// The native handle to be wrapped. /// Whether this wrapper owns the native accessor. + [EditorBrowsable(EditorBrowsableState.Never)] public AccessorInArray(IntPtr handle, Ownership own) : base(handle, own) { } @@ -176,7 +202,7 @@ public class AccessorInArray : Accessor /// . /// The data to be converted /// The managed data representing data. - protected override T Convert(IntPtr data) + internal override T Convert(IntPtr data) { return NativeToManagedInplace(data); }