-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
274 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
unity/general/Src/UnitTest/wrap/Puerts_UnitTest_GenericGenTest2_Wrap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
| ||
using System; | ||
using Puerts; | ||
|
||
namespace PuertsStaticWrap | ||
{ | ||
public static class Puerts_UnitTest_GenericGenTest2_Wrap | ||
{ | ||
|
||
[Puerts.MonoPInvokeCallback(typeof(Puerts.V8ConstructorCallback))] | ||
private static IntPtr Constructor(IntPtr isolate, IntPtr info, int paramLen, long data) | ||
{ | ||
try | ||
{ | ||
|
||
{ | ||
|
||
{ | ||
|
||
var result = new Puerts.UnitTest.GenericGenTest2(); | ||
|
||
return Puerts.Utils.GetObjectPtr((int)data, typeof(Puerts.UnitTest.GenericGenTest2), result); | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
} catch (Exception e) { | ||
Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace); | ||
} | ||
return IntPtr.Zero; | ||
} | ||
|
||
[Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))] | ||
private static void M_GetTypeTest(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data) | ||
{ | ||
try | ||
{ | ||
var obj = Puerts.Utils.GetSelf((int)data, self) as Puerts.UnitTest.GenericGenTest2; | ||
|
||
if (paramLen == 2) | ||
|
||
{ | ||
|
||
var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0); | ||
|
||
var argHelper1 = new Puerts.ArgumentHelper((int)data, isolate, info, 1); | ||
|
||
if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.String, typeof(string), false, false) && argHelper1.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.NativeObject | Puerts.JsValueType.Function, typeof(System.Action<Puerts.UnitTest.WrapperTestBase>), false, false)) | ||
|
||
{ | ||
|
||
var Arg0 = argHelper0.GetString(false); | ||
|
||
var Arg1 = argHelper1.Get<System.Action<Puerts.UnitTest.WrapperTestBase>>(false); | ||
|
||
var result = obj.GetTypeTest(Arg0, Arg1); | ||
|
||
Puerts.ResultHelper.Set((int)data, isolate, info, result); | ||
|
||
return; | ||
} | ||
|
||
} | ||
|
||
if (paramLen == 1) | ||
|
||
{ | ||
|
||
var argHelper0 = new Puerts.ArgumentHelper((int)data, isolate, info, 0); | ||
|
||
if (argHelper0.IsMatch(Puerts.JsValueType.NullOrUndefined | Puerts.JsValueType.String, typeof(string), false, false)) | ||
|
||
{ | ||
|
||
var Arg0 = argHelper0.GetString(false); | ||
|
||
var result = obj.GetTypeTest<Puerts.UnitTest.WrapperTestBase>(Arg0); | ||
|
||
Puerts.ResultHelper.Set((int)data, isolate, info, result); | ||
|
||
return; | ||
} | ||
|
||
} | ||
|
||
Puerts.PuertsDLL.ThrowException(isolate, "invalid arguments to GetTypeTest"); | ||
|
||
} | ||
catch (Exception e) | ||
{ | ||
Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace); | ||
} | ||
} | ||
|
||
public static Puerts.TypeRegisterInfo GetRegisterInfo() | ||
{ | ||
return new Puerts.TypeRegisterInfo() | ||
{ | ||
BlittableCopy = false, | ||
Constructor = Constructor, | ||
Methods = new System.Collections.Generic.Dictionary<Puerts.MethodKey, Puerts.V8FunctionCallback>() | ||
{ | ||
{ new Puerts.MethodKey { Name = "GetTypeTest", IsStatic = false}, M_GetTypeTest } | ||
}, | ||
Properties = new System.Collections.Generic.Dictionary<string, Puerts.PropertyRegisterInfo>() | ||
{ | ||
|
||
}, | ||
LazyMembers = new System.Collections.Generic.List<Puerts.LazyMemberRegisterInfo>() | ||
{ | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
unity/general/Src/UnitTest/wrap/Puerts_UnitTest_GenericWrapperBase_1_T__Wrap.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
| ||
using System; | ||
using Puerts; | ||
|
||
namespace PuertsStaticWrap | ||
{ | ||
public static class Puerts_UnitTest_GenericWrapperBase_1_T__Wrap<T> | ||
{ | ||
|
||
[Puerts.MonoPInvokeCallback(typeof(Puerts.V8ConstructorCallback))] | ||
private static IntPtr Constructor(IntPtr isolate, IntPtr info, int paramLen, long data) | ||
{ | ||
try | ||
{ | ||
|
||
//{ | ||
|
||
// { | ||
|
||
// var result = new Puerts.UnitTest.GenericWrapperBase<T>(); | ||
|
||
// return Puerts.Utils.GetObjectPtr((int)data, typeof(Puerts.UnitTest.GenericWrapperBase<T>), result); | ||
|
||
// } | ||
|
||
//} | ||
|
||
|
||
} catch (Exception e) { | ||
Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace); | ||
} | ||
return IntPtr.Zero; | ||
} | ||
|
||
[Puerts.MonoPInvokeCallback(typeof(Puerts.V8FunctionCallback))] | ||
private static void F_GetGenericType(IntPtr isolate, IntPtr info, IntPtr self, int paramLen, long data) | ||
{ | ||
try | ||
{ | ||
|
||
|
||
{ | ||
|
||
{ | ||
|
||
var result = Puerts.UnitTest.GenericWrapperBase<Version>.GetGenericType(); | ||
|
||
Puerts.ResultHelper.Set((int)data, isolate, info, result); | ||
|
||
|
||
} | ||
|
||
} | ||
|
||
} | ||
catch (Exception e) | ||
{ | ||
Puerts.PuertsDLL.ThrowException(isolate, "c# exception:" + e.Message + ",stack:" + e.StackTrace); | ||
} | ||
} | ||
|
||
public static Puerts.TypeRegisterInfo GetRegisterInfo() | ||
{ | ||
return new Puerts.TypeRegisterInfo() | ||
{ | ||
BlittableCopy = false, | ||
Constructor = Constructor, | ||
Methods = new System.Collections.Generic.Dictionary<Puerts.MethodKey, Puerts.V8FunctionCallback>() | ||
{ | ||
{ new Puerts.MethodKey { Name = "GetGenericType", IsStatic = true}, F_GetGenericType } | ||
}, | ||
Properties = new System.Collections.Generic.Dictionary<string, Puerts.PropertyRegisterInfo>() | ||
{ | ||
|
||
}, | ||
LazyMembers = new System.Collections.Generic.List<Puerts.LazyMemberRegisterInfo>() | ||
{ | ||
} | ||
}; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters