Profiler.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Profiler.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho
  18. {
  19. /// <summary>
  20. /// Hierarchical performance profiler subsystem.
  21. /// </summary>
  22. public unsafe partial class Profiler : UrhoObject
  23. {
  24. unsafe partial void OnProfilerCreated ();
  25. [Preserve]
  26. public Profiler (IntPtr handle) : base (handle)
  27. {
  28. OnProfilerCreated ();
  29. }
  30. [Preserve]
  31. protected Profiler (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnProfilerCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Profiler_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Profiler_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Profiler_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Profiler_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Profiler_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Profiler));
  54. return new StringHash (Profiler_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Profiler_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Profiler));
  61. return Marshal.PtrToStringAnsi (Profiler_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public Profiler () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr Profiler_Profiler (IntPtr context);
  69. [Preserve]
  70. public Profiler (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(Profiler));
  73. handle = Profiler_Profiler ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnProfilerCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void Profiler_EndBlock (IntPtr handle);
  79. /// <summary>
  80. /// End timing the current profiling block.
  81. /// </summary>
  82. public void EndBlock ()
  83. {
  84. Runtime.ValidateRefCounted (this);
  85. Profiler_EndBlock (handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void Profiler_BeginFrame (IntPtr handle);
  89. /// <summary>
  90. /// Begin the profiling frame. Called by HandleBeginFrame().
  91. /// </summary>
  92. public void BeginFrame ()
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. Profiler_BeginFrame (handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void Profiler_EndFrame (IntPtr handle);
  99. /// <summary>
  100. /// End the profiling frame. Called by HandleEndFrame().
  101. /// </summary>
  102. public void EndFrame ()
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. Profiler_EndFrame (handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void Profiler_BeginInterval (IntPtr handle);
  109. /// <summary>
  110. /// Begin a new interval.
  111. /// </summary>
  112. public void BeginInterval ()
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. Profiler_BeginInterval (handle);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern IntPtr Profiler_PrintData (IntPtr handle, bool showUnused, bool showTotal, uint maxDepth);
  119. /// <summary>
  120. /// Return profiling data as text output. This method is not thread-safe.
  121. /// </summary>
  122. public string PrintData (bool showUnused = false, bool showTotal = false, uint maxDepth = uint.MaxValue)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. return Marshal.PtrToStringAnsi (Profiler_PrintData (handle, showUnused, showTotal, maxDepth));
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern ProfilerBlock* Profiler_GetCurrentBlock (IntPtr handle);
  129. /// <summary>
  130. /// Return the current profiling block.
  131. /// </summary>
  132. private ProfilerBlock* GetCurrentBlock ()
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return Profiler_GetCurrentBlock (handle);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern ProfilerBlock* Profiler_GetRootBlock (IntPtr handle);
  139. /// <summary>
  140. /// Return the root profiling block.
  141. /// </summary>
  142. private ProfilerBlock* GetRootBlock ()
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return Profiler_GetRootBlock (handle);
  146. }
  147. public override StringHash Type {
  148. get {
  149. return UrhoGetType ();
  150. }
  151. }
  152. public override string TypeName {
  153. get {
  154. return GetTypeName ();
  155. }
  156. }
  157. [Preserve]
  158. public static StringHash TypeStatic {
  159. get {
  160. return GetTypeStatic ();
  161. }
  162. }
  163. public static string TypeNameStatic {
  164. get {
  165. return GetTypeNameStatic ();
  166. }
  167. }
  168. /// <summary>
  169. /// Return the current profiling block.
  170. /// </summary>
  171. public ProfilerBlock* CurrentBlock {
  172. get {
  173. return GetCurrentBlock ();
  174. }
  175. }
  176. /// <summary>
  177. /// Return the root profiling block.
  178. /// </summary>
  179. public ProfilerBlock* RootBlock {
  180. get {
  181. return GetRootBlock ();
  182. }
  183. }
  184. }
  185. }