LuaProfilerWrap.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //this source code was auto-generated by tolua#, do not modify it
  2. using System;
  3. using LuaInterface;
  4. public class LuaProfilerWrap
  5. {
  6. public static void Register(LuaState L)
  7. {
  8. L.BeginStaticLibs("LuaProfiler");
  9. L.RegFunction("Clear", Clear);
  10. L.RegFunction("GetID", GetID);
  11. L.RegFunction("BeginSample", BeginSample);
  12. L.RegFunction("EndSample", EndSample);
  13. L.RegVar("list", get_list, set_list);
  14. L.EndStaticLibs();
  15. }
  16. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  17. static int Clear(IntPtr L)
  18. {
  19. try
  20. {
  21. ToLua.CheckArgsCount(L, 0);
  22. LuaProfiler.Clear();
  23. return 0;
  24. }
  25. catch (Exception e)
  26. {
  27. return LuaDLL.toluaL_exception(L, e);
  28. }
  29. }
  30. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  31. static int GetID(IntPtr L)
  32. {
  33. try
  34. {
  35. ToLua.CheckArgsCount(L, 1);
  36. string arg0 = ToLua.CheckString(L, 1);
  37. int o = LuaProfiler.GetID(arg0);
  38. LuaDLL.lua_pushinteger(L, o);
  39. return 1;
  40. }
  41. catch (Exception e)
  42. {
  43. return LuaDLL.toluaL_exception(L, e);
  44. }
  45. }
  46. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  47. static int BeginSample(IntPtr L)
  48. {
  49. try
  50. {
  51. ToLua.CheckArgsCount(L, 1);
  52. int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
  53. LuaProfiler.BeginSample(arg0);
  54. return 0;
  55. }
  56. catch (Exception e)
  57. {
  58. return LuaDLL.toluaL_exception(L, e);
  59. }
  60. }
  61. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  62. static int EndSample(IntPtr L)
  63. {
  64. try
  65. {
  66. ToLua.CheckArgsCount(L, 0);
  67. LuaProfiler.EndSample();
  68. return 0;
  69. }
  70. catch (Exception e)
  71. {
  72. return LuaDLL.toluaL_exception(L, e);
  73. }
  74. }
  75. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  76. static int get_list(IntPtr L)
  77. {
  78. try
  79. {
  80. ToLua.PushSealed(L, LuaProfiler.list);
  81. return 1;
  82. }
  83. catch (Exception e)
  84. {
  85. return LuaDLL.toluaL_exception(L, e);
  86. }
  87. }
  88. [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
  89. static int set_list(IntPtr L)
  90. {
  91. try
  92. {
  93. System.Collections.Generic.List<string> arg0 = (System.Collections.Generic.List<string>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List<string>));
  94. LuaProfiler.list = arg0;
  95. return 0;
  96. }
  97. catch (Exception e)
  98. {
  99. return LuaDLL.toluaL_exception(L, e);
  100. }
  101. }
  102. }