RefCounted.cs 788 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. namespace AtomicEngine
  5. {
  6. public partial class RefCounted
  7. {
  8. public RefCounted()
  9. {
  10. }
  11. protected RefCounted(IntPtr native)
  12. {
  13. nativeInstance = native;
  14. }
  15. public static implicit operator IntPtr(RefCounted refCounted)
  16. {
  17. if (refCounted == null)
  18. return IntPtr.Zero;
  19. return refCounted.nativeInstance;
  20. }
  21. public IntPtr nativeInstance = IntPtr.Zero;
  22. [DllImport(Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
  23. public static extern IntPtr csi_Atomic_RefCounted_GetClassID(IntPtr self);
  24. }
  25. }