Advertisement
mattparks5855

Generated Output C#

May 20th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.35 KB | None | 0 0
  1. // ----------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This is autogenerated code by CppSharp.
  4. // Do not edit this file or all your changes will be lost after re-generation.
  5. // </auto-generated>
  6. // ----------------------------------------------------------------------------
  7. using System;
  8. using System.Runtime.InteropServices;
  9. using System.Security;
  10.  
  11. public enum TestState
  12. {
  13.     TestStateA = 0,
  14.     TestStateB = 1,
  15.     TestStateC = 2
  16. }
  17.  
  18. public unsafe partial class TestStateCreateInfo : IDisposable
  19. {
  20.     [StructLayout(LayoutKind.Explicit, Size = 16)]
  21.     public partial struct __Internal
  22.     {
  23.         [FieldOffset(0)]
  24.         internal int testStateCount;
  25.  
  26.         [FieldOffset(8)]
  27.         internal global::System.IntPtr pTestStates;
  28.  
  29.         [SuppressUnmanagedCodeSecurity]
  30.         [DllImport("Test", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
  31.             EntryPoint="??0TestStateCreateInfo@@QEAA@AEBU0@@Z")]
  32.         internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
  33.     }
  34.  
  35.     public global::System.IntPtr __Instance { get; protected set; }
  36.  
  37.     protected int __PointerAdjustment;
  38.     internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::TestStateCreateInfo> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::TestStateCreateInfo>();
  39.     protected void*[] __OriginalVTables;
  40.  
  41.     protected bool __ownsNativeInstance;
  42.  
  43.     internal static global::TestStateCreateInfo __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
  44.     {
  45.         return new global::TestStateCreateInfo(native.ToPointer(), skipVTables);
  46.     }
  47.  
  48.     internal static global::TestStateCreateInfo __CreateInstance(global::TestStateCreateInfo.__Internal native, bool skipVTables = false)
  49.     {
  50.         return new global::TestStateCreateInfo(native, skipVTables);
  51.     }
  52.  
  53.     private static void* __CopyValue(global::TestStateCreateInfo.__Internal native)
  54.     {
  55.         var ret = Marshal.AllocHGlobal(sizeof(global::TestStateCreateInfo.__Internal));
  56.         *(global::TestStateCreateInfo.__Internal*) ret = native;
  57.         return ret.ToPointer();
  58.     }
  59.  
  60.     private TestStateCreateInfo(global::TestStateCreateInfo.__Internal native, bool skipVTables = false)
  61.         : this(__CopyValue(native), skipVTables)
  62.     {
  63.         __ownsNativeInstance = true;
  64.         NativeToManagedMap[__Instance] = this;
  65.     }
  66.  
  67.     protected TestStateCreateInfo(void* native, bool skipVTables = false)
  68.     {
  69.         if (native == null)
  70.             return;
  71.         __Instance = new global::System.IntPtr(native);
  72.     }
  73.  
  74.     public TestStateCreateInfo()
  75.     {
  76.         __Instance = Marshal.AllocHGlobal(sizeof(global::TestStateCreateInfo.__Internal));
  77.         __ownsNativeInstance = true;
  78.         NativeToManagedMap[__Instance] = this;
  79.     }
  80.  
  81.     public TestStateCreateInfo(global::TestStateCreateInfo _0)
  82.     {
  83.         __Instance = Marshal.AllocHGlobal(sizeof(global::TestStateCreateInfo.__Internal));
  84.         __ownsNativeInstance = true;
  85.         NativeToManagedMap[__Instance] = this;
  86.         *((global::TestStateCreateInfo.__Internal*) __Instance) = *((global::TestStateCreateInfo.__Internal*) _0.__Instance);
  87.     }
  88.  
  89.     public void Dispose()
  90.     {
  91.         Dispose(disposing: true);
  92.     }
  93.  
  94.     public virtual void Dispose(bool disposing)
  95.     {
  96.         if (__Instance == IntPtr.Zero)
  97.             return;
  98.         global::TestStateCreateInfo __dummy;
  99.         NativeToManagedMap.TryRemove(__Instance, out __dummy);
  100.         if (__ownsNativeInstance)
  101.             Marshal.FreeHGlobal(__Instance);
  102.         __Instance = IntPtr.Zero;
  103.     }
  104.  
  105.     public int TestStateCount
  106.     {
  107.         get
  108.         {
  109.             return ((global::TestStateCreateInfo.__Internal*) __Instance)->testStateCount;
  110.         }
  111.  
  112.         set
  113.         {
  114.             ((global::TestStateCreateInfo.__Internal*)__Instance)->testStateCount = value;
  115.         }
  116.     }
  117.  
  118.     public global::TestState* PTestStates
  119.     {
  120.         get
  121.         {
  122.             return ((global::TestStateCreateInfo.__Internal*) __Instance)->pTestStates;
  123.         }
  124.  
  125.         set
  126.         {
  127.             ((global::TestStateCreateInfo.__Internal*)__Instance)->pTestStates = value;
  128.         }
  129.     }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement