[Bluetooth][Non-ACR] Fix no data exception issue (#787)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl_loop_consumer.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.ComponentModel;
7 namespace Efl { 
8 /// <summary>An <see cref="Efl.LoopConsumer"/> is a class which requires one of the parents to provide an <see cref="Efl.Loop"/> interface when performing <see cref="Efl.Object.FindProvider"/>. It will enforce this by only allowing parents which provide such an interface or <c>NULL</c>.</summary>
9 [LoopConsumerNativeInherit]
10 public class LoopConsumer : Efl.Object, Efl.Eo.IWrapper
11 {
12    public new static System.IntPtr klass = System.IntPtr.Zero;
13    public new static Efl.LoopConsumerNativeInherit nativeInherit = new Efl.LoopConsumerNativeInherit();
14    ///<summary>Pointer to the native class description.</summary>
15    public override System.IntPtr NativeClass {
16       get {
17          if (((object)this).GetType() == typeof (LoopConsumer))
18             return Efl.LoopConsumerNativeInherit.GetEflClassStatic();
19          else
20             return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
21       }
22    }
23    [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
24       efl_loop_consumer_class_get();
25    ///<summary>Creates a new instance.</summary>
26    ///<param name="parent">Parent instance.</param>
27    public LoopConsumer(Efl.Object parent= null
28          ) :
29       base(efl_loop_consumer_class_get(), typeof(LoopConsumer), parent)
30    {
31       FinishInstantiation();
32    }
33    ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
34    public LoopConsumer(System.IntPtr raw) : base(raw)
35    {
36             register_event_proxies();
37    }
38    ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
39    protected LoopConsumer(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
40    ///<summary>Casts obj into an instance of this type.</summary>
41    public new static LoopConsumer static_cast(Efl.Object obj)
42    {
43       if (obj == null)
44          throw new System.ArgumentNullException("obj");
45       return new LoopConsumer(obj.NativeHandle);
46    }
47    ///<summary>Verifies if the given object is equal to this one.</summary>
48    public override bool Equals(object obj)
49    {
50       var other = obj as Efl.Object;
51       if (other == null)
52          return false;
53       return this.NativeHandle == other.NativeHandle;
54    }
55    ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
56    public override int GetHashCode()
57    {
58       return this.NativeHandle.ToInt32();
59    }
60    ///<summary>Turns the native pointer into a string representation.</summary>
61    public override String ToString()
62    {
63       return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
64    }
65    protected override void register_event_proxies()
66    {
67       base.register_event_proxies();
68    }
69    /// <summary>Gets a handle to the loop.</summary>
70    /// <returns>Efl loop</returns>
71    virtual public Efl.Loop GetLoop() {
72        var _ret_var = Efl.LoopConsumerNativeInherit.efl_loop_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
73       Eina.Error.RaiseIfUnhandledException();
74       return _ret_var;
75  }
76    /// <summary>Creates a new future that is already resolved to a value.
77    /// This function creates a new future with an already known value, that will be resolved and dispatched by the loop scheduler as usual.
78    /// 
79    /// This is a helper that behaves the same as eina_future_resolved.</summary>
80    /// <param name="result">The value to be delivered.
81    /// Note that the value contents must survive this function scope, that is, do not use stack allocated blobs, arrays, structures or types that keep references to memory you give. Values will be automatically cleaned up using @ref eina_value_flush() once they are unused (no more future or futures returned a new value)</param>
82    /// <returns>The future or <c>NULL</c> on error.</returns>
83    virtual public  Eina.Future FutureResolved(  Eina.Value result) {
84        var _in_result = result.GetNative();
85                   var _ret_var = Efl.LoopConsumerNativeInherit.efl_loop_future_resolved_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), _in_result);
86       Eina.Error.RaiseIfUnhandledException();
87                   return _ret_var;
88  }
89    /// <summary>Creates a new future that is already rejected to a specified error using the <see cref="Efl.LoopConsumer.GetLoop"/>.
90    /// This function creates a new future with an already known error, that will be resolved and dispatched by the loop scheduler as usual.
91    /// 
92    /// This is a helper that behaves the same as @ref eina_future_rejected.</summary>
93    /// <param name="error">An Eina_Error value</param>
94    /// <returns>The future or <c>NULL</c> on error.</returns>
95    virtual public  Eina.Future FutureRejected(  Eina.Error error) {
96                          var _ret_var = Efl.LoopConsumerNativeInherit.efl_loop_future_rejected_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), error);
97       Eina.Error.RaiseIfUnhandledException();
98                   return _ret_var;
99  }
100    /// <summary>Create a new promise with the scheduler coming from the loop provided by this object.
101    /// Note: You should not use eina_promise_data_set as this function rely on controlling the promise data.</summary>
102    /// <returns>The new promise.</returns>
103    virtual public Eina.Promise NewPromise() {
104        var _ret_var = Efl.LoopConsumerNativeInherit.efl_loop_promise_new_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
105       Eina.Error.RaiseIfUnhandledException();
106       return _ret_var;
107  }
108    public System.Threading.Tasks.Task<Eina.Value> FutureResolvedAsync(  Eina.Value result, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
109    {
110       Eina.Future future = FutureResolved(  result);
111       return Efl.Eo.Globals.WrapAsync(future, token);
112    }
113    public System.Threading.Tasks.Task<Eina.Value> FutureRejectedAsync(  Eina.Error error, System.Threading.CancellationToken token=default(System.Threading.CancellationToken))
114    {
115       Eina.Future future = FutureRejected(  error);
116       return Efl.Eo.Globals.WrapAsync(future, token);
117    }
118    /// <summary>The loop to which this object belongs to.</summary>
119 /// <value>Efl loop</value>
120    public Efl.Loop Loop {
121       get { return GetLoop(); }
122    }
123    private static new  IntPtr GetEflClassStatic()
124    {
125       return Efl.LoopConsumer.efl_loop_consumer_class_get();
126    }
127 }
128 public class LoopConsumerNativeInherit : Efl.ObjectNativeInherit{
129    public new  static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Ecore);
130    public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
131    {
132       var descs = new System.Collections.Generic.List<Efl_Op_Description>();
133       if (efl_loop_get_static_delegate == null)
134       efl_loop_get_static_delegate = new efl_loop_get_delegate(loop_get);
135       descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_get"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_get_static_delegate)});
136       if (efl_loop_future_resolved_static_delegate == null)
137       efl_loop_future_resolved_static_delegate = new efl_loop_future_resolved_delegate(future_resolved);
138       descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_future_resolved"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_future_resolved_static_delegate)});
139       if (efl_loop_future_rejected_static_delegate == null)
140       efl_loop_future_rejected_static_delegate = new efl_loop_future_rejected_delegate(future_rejected);
141       descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_future_rejected"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_future_rejected_static_delegate)});
142       if (efl_loop_promise_new_static_delegate == null)
143       efl_loop_promise_new_static_delegate = new efl_loop_promise_new_delegate(promise_new);
144       descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_loop_promise_new"), func = Marshal.GetFunctionPointerForDelegate(efl_loop_promise_new_static_delegate)});
145       descs.AddRange(base.GetEoOps(type));
146       return descs;
147    }
148    public override IntPtr GetEflClass()
149    {
150       return Efl.LoopConsumer.efl_loop_consumer_class_get();
151    }
152    public static new  IntPtr GetEflClassStatic()
153    {
154       return Efl.LoopConsumer.efl_loop_consumer_class_get();
155    }
156
157
158    [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Loop, Efl.Eo.NonOwnTag>))] private delegate Efl.Loop efl_loop_get_delegate(System.IntPtr obj, System.IntPtr pd);
159
160
161    [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Loop, Efl.Eo.NonOwnTag>))] public delegate Efl.Loop efl_loop_get_api_delegate(System.IntPtr obj);
162     public static Efl.Eo.FunctionWrapper<efl_loop_get_api_delegate> efl_loop_get_ptr = new Efl.Eo.FunctionWrapper<efl_loop_get_api_delegate>(_Module, "efl_loop_get");
163     private static Efl.Loop loop_get(System.IntPtr obj, System.IntPtr pd)
164    {
165       Eina.Log.Debug("function efl_loop_get was called");
166       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
167       if(wrapper != null) {
168                   Efl.Loop _ret_var = default(Efl.Loop);
169          try {
170             _ret_var = ((LoopConsumer)wrapper).GetLoop();
171          } catch (Exception e) {
172             Eina.Log.Warning($"Callback error: {e.ToString()}");
173             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
174          }
175       return _ret_var;
176       } else {
177          return efl_loop_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
178       }
179    }
180    private static efl_loop_get_delegate efl_loop_get_static_delegate;
181
182
183    [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate  Eina.Future efl_loop_future_resolved_delegate(System.IntPtr obj, System.IntPtr pd,    Eina.ValueNative result);
184
185
186    [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate  Eina.Future efl_loop_future_resolved_api_delegate(System.IntPtr obj,    Eina.ValueNative result);
187     public static Efl.Eo.FunctionWrapper<efl_loop_future_resolved_api_delegate> efl_loop_future_resolved_ptr = new Efl.Eo.FunctionWrapper<efl_loop_future_resolved_api_delegate>(_Module, "efl_loop_future_resolved");
188     private static  Eina.Future future_resolved(System.IntPtr obj, System.IntPtr pd,   Eina.ValueNative result)
189    {
190       Eina.Log.Debug("function efl_loop_future_resolved was called");
191       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
192       if(wrapper != null) {
193                var _in_result = new  Eina.Value(result);
194                       Eina.Future _ret_var = default( Eina.Future);
195          try {
196             _ret_var = ((LoopConsumer)wrapper).FutureResolved( _in_result);
197          } catch (Exception e) {
198             Eina.Log.Warning($"Callback error: {e.ToString()}");
199             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
200          }
201                   return _ret_var;
202       } else {
203          return efl_loop_future_resolved_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  result);
204       }
205    }
206    private static efl_loop_future_resolved_delegate efl_loop_future_resolved_static_delegate;
207
208
209    [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] private delegate  Eina.Future efl_loop_future_rejected_delegate(System.IntPtr obj, System.IntPtr pd,    Eina.Error error);
210
211
212    [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.FutureMarshaler))] public delegate  Eina.Future efl_loop_future_rejected_api_delegate(System.IntPtr obj,    Eina.Error error);
213     public static Efl.Eo.FunctionWrapper<efl_loop_future_rejected_api_delegate> efl_loop_future_rejected_ptr = new Efl.Eo.FunctionWrapper<efl_loop_future_rejected_api_delegate>(_Module, "efl_loop_future_rejected");
214     private static  Eina.Future future_rejected(System.IntPtr obj, System.IntPtr pd,   Eina.Error error)
215    {
216       Eina.Log.Debug("function efl_loop_future_rejected was called");
217       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
218       if(wrapper != null) {
219                                      Eina.Future _ret_var = default( Eina.Future);
220          try {
221             _ret_var = ((LoopConsumer)wrapper).FutureRejected( error);
222          } catch (Exception e) {
223             Eina.Log.Warning($"Callback error: {e.ToString()}");
224             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
225          }
226                   return _ret_var;
227       } else {
228          return efl_loop_future_rejected_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)),  error);
229       }
230    }
231    private static efl_loop_future_rejected_delegate efl_loop_future_rejected_static_delegate;
232
233
234     private delegate Eina.Promise efl_loop_promise_new_delegate(System.IntPtr obj, System.IntPtr pd);
235
236
237     public delegate Eina.Promise efl_loop_promise_new_api_delegate(System.IntPtr obj);
238     public static Efl.Eo.FunctionWrapper<efl_loop_promise_new_api_delegate> efl_loop_promise_new_ptr = new Efl.Eo.FunctionWrapper<efl_loop_promise_new_api_delegate>(_Module, "efl_loop_promise_new");
239     private static Eina.Promise promise_new(System.IntPtr obj, System.IntPtr pd)
240    {
241       Eina.Log.Debug("function efl_loop_promise_new was called");
242       Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
243       if(wrapper != null) {
244                   Eina.Promise _ret_var = default(Eina.Promise);
245          try {
246             _ret_var = ((LoopConsumer)wrapper).NewPromise();
247          } catch (Exception e) {
248             Eina.Log.Warning($"Callback error: {e.ToString()}");
249             Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
250          }
251       return _ret_var;
252       } else {
253          return efl_loop_promise_new_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
254       }
255    }
256    private static efl_loop_promise_new_delegate efl_loop_promise_new_static_delegate;
257 }
258