summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-30 12:39:11 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-10-30 12:43:17 +0100
commit99067bb7eb87558dc08a7bfc81c7f498b5113bf3 (patch)
treea8e7a999212d2232ada2d5320d63911f1b5be5bc /src/bindings/mono/eo_mono
parentf4019d3303f678b9f040d50cc98c8ba36fd4d1a9 (diff)
csharp: FunctionWrapper doc fixes
Reviewers: felipealmeida, brunobelo, segfaultxavi, woohyun Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10430
Diffstat (limited to 'src/bindings/mono/eo_mono')
-rw-r--r--src/bindings/mono/eo_mono/FunctionWrapper.cs91
-rw-r--r--src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs10
2 files changed, 64 insertions, 37 deletions
diff --git a/src/bindings/mono/eo_mono/FunctionWrapper.cs b/src/bindings/mono/eo_mono/FunctionWrapper.cs
index 04f1561..d37fba9 100644
--- a/src/bindings/mono/eo_mono/FunctionWrapper.cs
+++ b/src/bindings/mono/eo_mono/FunctionWrapper.cs
@@ -19,17 +19,21 @@ using System.Runtime.InteropServices;
19namespace Efl.Eo 19namespace Efl.Eo
20{ 20{
21 21
22///<summary>Class to load functions pointers from a native module. 22/// <summary>Class to load functions pointers from a native module.
23/// 23///
24///This class has a platform-dependent implementation on whether it 24/// <para>This class has a platform-dependent implementation on whether it
25///is compiled for Windows (using LoadLibrary/GetProcAddress) or Unix 25/// is compiled for Windows (using LoadLibrary/GetProcAddress) or Unix
26///(dlopen/dlsym).</summary> 26/// (dlopen/dlsym).</para>
27/// <para>Since EFL 1.23.</para>
28/// </summary>
27internal static partial class FunctionInterop 29internal static partial class FunctionInterop
28{ 30{
29 ///<summary>Loads a function pointer from the given module.</summary> 31 /// <summary>Loads a function pointer from the given module.
30 ///<param name="moduleName">The name of the module containing the function.</param> 32 /// <para>Since EFL 1.23.</para>
31 ///<param name="functionName">The name of the function to search for.</param> 33 /// </summary>
32 ///<returns>A function pointer that can be used with delegates.</returns> 34 /// <param name="moduleName">The name of the module containing the function.</param>
35 /// <param name="functionName">The name of the function to search for.</param>
36 /// <returns>A function pointer that can be used with delegates.</returns>
33 internal static IntPtr LoadFunctionPointer(string moduleName, string functionName) 37 internal static IntPtr LoadFunctionPointer(string moduleName, string functionName)
34 { 38 {
35 IntPtr module = NativeModule.LoadLibrary(moduleName); 39 IntPtr module = NativeModule.LoadLibrary(moduleName);
@@ -39,9 +43,11 @@ internal static partial class FunctionInterop
39 return s; 43 return s;
40 } 44 }
41 45
42 ///<summary>Loads a function pointer from the default module.</summary> 46 /// <summary>Loads a function pointer from the default module.
43 ///<param name="functionName">The name of the function to search for.</param> 47 /// <para>Since EFL 1.23.</para>
44 ///<returns>A function pointer that can be used with delegates.</returns> 48 /// </summary>
49 /// <param name="functionName">The name of the function to search for.</param>
50 /// <returns>A function pointer that can be used with delegates.</returns>
45 internal static IntPtr LoadFunctionPointer(string functionName) 51 internal static IntPtr LoadFunctionPointer(string functionName)
46 { 52 {
47 Eina.Log.Debug($"searching {null} for {functionName}"); 53 Eina.Log.Debug($"searching {null} for {functionName}");
@@ -51,12 +57,12 @@ internal static partial class FunctionInterop
51 } 57 }
52} 58}
53 59
54///<summary>Wraps a native function in a portable manner. 60/// <summary>Wraps a native function in a portable manner.
55/// 61///
56///This is intended as a workaround DllImport limitations when switching between mono and dotnet. 62/// <para>This is intended as a workaround DllImport limitations when switching between mono and dotnet.</para>
57/// 63/// <para>The parameter T must be a delegate.</para>
58///The parameter T must be a delegate. 64/// <para>Since EFL 1.23.</para>
59///</summary> 65/// </summary>
60class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T: System.Delegate? 66class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T: System.Delegate?
61{ 67{
62 private Lazy<FunctionLoadResult<T>> loadResult; 68 private Lazy<FunctionLoadResult<T>> loadResult;
@@ -84,17 +90,21 @@ class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T: Syste
84 } 90 }
85 } 91 }
86 92
87 ///<summary>Creates a wrapper for the given function of the given module.</summary> 93 /// <summary>Creates a wrapper for the given function of the given module.
88 ///<param name="moduleName">The name of the module containing the function.</param> 94 /// <para>Since EFL 1.23.</para>
89 ///<param name="functionName">The name of the function to search for.</param> 95 /// </summary>
96 /// <param name="moduleName">The name of the module containing the function.</param>
97 /// <param name="functionName">The name of the function to search for.</param>
90 internal FunctionWrapper(string moduleName, string functionName) 98 internal FunctionWrapper(string moduleName, string functionName)
91 : this(new NativeModule(moduleName), functionName) 99 : this(new NativeModule(moduleName), functionName)
92 { 100 {
93 } 101 }
94 102
95 ///<summary>Creates a wrapper for the given function of the given module.</summary> 103 /// <summary>Creates a wrapper for the given function of the given module.
96 ///<param name="module">The module wrapper containing the function.</param> 104 /// <para>Since EFL 1.23.</para>
97 ///<param name="functionName">The name of the function to search for.</param> 105 /// </summary>
106 /// <param name="module">The module wrapper containing the function.</param>
107 /// <param name="functionName">The name of the function to search for.</param>
98 internal FunctionWrapper(NativeModule module, string functionName) 108 internal FunctionWrapper(NativeModule module, string functionName)
99 { 109 {
100 this.module = module; 110 this.module = module;
@@ -105,8 +115,10 @@ class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T: Syste
105 }); 115 });
106 } 116 }
107 117
108 ///<summary>Retrieves the result of function load.</summary> 118 /// <summary>Retrieves the result of function load.
109 ///<returns>The load result.</returns> 119 /// <para>Since EFL 1.23.</para>
120 /// </summary>
121 /// <returns>The load result.</returns>
110 internal FunctionLoadResult<T> Value 122 internal FunctionLoadResult<T> Value
111 { 123 {
112 get 124 get
@@ -116,7 +128,9 @@ class FunctionWrapper<T> // NOTE: When supporting C# >=7.3, add a where T: Syste
116 } 128 }
117} 129}
118 130
119///<summary>The outcome of the function load process.</summary> 131/// <summary>The outcome of the function load process.
132/// <para>Since EFL 1.23.</para>
133/// </summary>
120enum FunctionLoadResultKind 134enum FunctionLoadResultKind
121{ 135{
122 ///<summary>Function was loaded successfully.</summary> 136 ///<summary>Function was loaded successfully.</summary>
@@ -127,16 +141,23 @@ enum FunctionLoadResultKind
127 FunctionNotFound 141 FunctionNotFound
128} 142}
129 143
130///<summary>Represents the result of loading a function pointer.</summary> 144/// <summary>Represents the result of loading a function pointer.
145/// <para>Since EFL 1.23.</para>
146/// </summary>
131class FunctionLoadResult<T> 147class FunctionLoadResult<T>
132{ 148{
133 ///<summary>The status of the load.</summary> 149 /// <summary>The status of the load.
150 /// <para>Since EFL 1.23.</para>
151 /// </summary>
134 FunctionLoadResultKind Kind; 152 FunctionLoadResultKind Kind;
135 private T _Delegate; 153 private T _Delegate;
136 154
137 ///<summary>The delegate wrapping the loaded function pointer. 155 /// <summary>The delegate wrapping the loaded function pointer.
138 /// 156 ///
139 ///Throws InvalidOperationException if trying to access while not loaded.</summary> 157 /// <para>Throws InvalidOperationException if trying to access while not loaded.</para>
158 /// <para>Since EFL 1.23.</para>
159 /// </summary>
160 /// <value>The <c>delegate</c> wrapping the native function.</value>
140 internal T Delegate 161 internal T Delegate
141 { 162 {
142 get 163 get
@@ -150,15 +171,19 @@ class FunctionLoadResult<T>
150 } 171 }
151 } 172 }
152 173
153 ///<summary>Creates a new load result of the given kind.</summary> 174 /// <summary>Creates a new load result of the given kind.
154 ///<param name="kind">The outcome of the load process.</param> 175 /// <para>Since EFL 1.23.</para>
176 /// </summary>
177 /// <param name="kind">The outcome of the load process.</param>
155 internal FunctionLoadResult(FunctionLoadResultKind kind) 178 internal FunctionLoadResult(FunctionLoadResultKind kind)
156 { 179 {
157 this.Kind = kind; 180 this.Kind = kind;
158 } 181 }
159 182
160 ///<summary>Creates a new load result with the given delegate.</summary> 183 /// <summary>Creates a new load result with the given delegate.
161 ///<param name="Delegate">The delegate wrapping the native function.</param> 184 /// <para>Since EFL 1.23.</para>
185 /// </summary>
186 /// <param name="Delegate">The delegate wrapping the native function.</param>
162 internal FunctionLoadResult(T Delegate) 187 internal FunctionLoadResult(T Delegate)
163 { 188 {
164 this._Delegate = Delegate; 189 this._Delegate = Delegate;
diff --git a/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs b/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs
index 641f954..636f83e 100644
--- a/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs
+++ b/src/bindings/mono/eo_mono/FunctionWrapper_Unix.cs
@@ -24,10 +24,12 @@ internal static partial class FunctionInterop
24 [DllImport(efl.Libs.Libdl)] 24 [DllImport(efl.Libs.Libdl)]
25 private static extern IntPtr dlsym(IntPtr handle, string symbol); 25 private static extern IntPtr dlsym(IntPtr handle, string symbol);
26 26
27 ///<summary>Loads a function pointer from the given module.</summary> 27 /// <summary>Loads a function pointer from the given module.
28 ///<param name="nativeLibraryHandle">The module containing the function.</param> 28 /// <para>Since EFL 1.23.</para>
29 ///<param name="functionName">The name of the function to search for.</param> 29 /// </summary>
30 ///<returns>A function pointer that can be used with delegates.</returns> 30 /// <param name="nativeLibraryHandle">The module containing the function.</param>
31 /// <param name="functionName">The name of the function to search for.</param>
32 /// <returns>A function pointer that can be used with delegates.</returns>
31 internal static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName) 33 internal static IntPtr LoadFunctionPointer(IntPtr nativeLibraryHandle, string functionName)
32 { 34 {
33 Eina.Log.Debug($"searching {nativeLibraryHandle} for {functionName}"); 35 Eina.Log.Debug($"searching {nativeLibraryHandle} for {functionName}");