WeakReference.h 854 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "il2cpp-object-internals.h"
  3. #include "Baselib.h"
  4. #include "Cpp/Atomic.h"
  5. namespace il2cpp
  6. {
  7. namespace vm
  8. {
  9. struct WeakReference IL2CPP_FINAL : Il2CppIWeakReference
  10. {
  11. static il2cpp_hresult_t Create(Il2CppObject* managedObject, Il2CppIWeakReference** result);
  12. WeakReference(Il2CppObject * managedObject);
  13. virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_FINAL IL2CPP_OVERRIDE;
  14. virtual uint32_t STDCALL AddRef() IL2CPP_FINAL IL2CPP_OVERRIDE;
  15. virtual uint32_t STDCALL Release() IL2CPP_FINAL IL2CPP_OVERRIDE;
  16. virtual il2cpp_hresult_t STDCALL Resolve(const Il2CppGuid& iid, Il2CppIInspectable** object) IL2CPP_FINAL IL2CPP_OVERRIDE;
  17. private:
  18. uint32_t m_GCHandle;
  19. baselib::atomic<uint32_t> m_RefCount;
  20. };
  21. }
  22. }