Field.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <stdint.h>
  3. #include "il2cpp-config.h"
  4. struct FieldInfo;
  5. struct Il2CppType;
  6. struct Il2CppClass;
  7. struct Il2CppObject;
  8. namespace il2cpp
  9. {
  10. namespace vm
  11. {
  12. class LIBIL2CPP_CODEGEN_API Field
  13. {
  14. public:
  15. // exported
  16. static const Il2CppType* GetType(FieldInfo *field);
  17. static Il2CppClass* GetParent(FieldInfo *field);
  18. static int GetFlags(FieldInfo *field);
  19. static const char* GetName(FieldInfo *field);
  20. static size_t GetOffset(FieldInfo *field);
  21. static void GetValue(Il2CppObject *obj, FieldInfo *field, void *value);
  22. static uint32_t GetToken(const FieldInfo *field);
  23. static Il2CppObject* GetValueObject(FieldInfo *field, Il2CppObject *obj);
  24. static Il2CppObject* GetValueObjectForThread(FieldInfo *field, Il2CppObject *obj, Il2CppThread *thread);
  25. static bool HasAttribute(FieldInfo *field, Il2CppClass *attr_class);
  26. static bool IsDeleted(FieldInfo *field);
  27. static void SetValue(Il2CppObject *obj, const FieldInfo *field, void *value);
  28. static void StaticGetValue(FieldInfo *field, void *value);
  29. static void StaticGetValueInternal(FieldInfo *field, void *value, void *threadStaticData);
  30. static void StaticGetValueForThread(FieldInfo *field, void *value, Il2CppInternalThread *thread);
  31. static void StaticSetValue(FieldInfo *field, void *value);
  32. static void StaticSetValueForThread(FieldInfo *field, void *value, Il2CppThread *thread);
  33. static void SetInstanceFieldValueObject(Il2CppObject* objectInstance, FieldInfo* field, Il2CppObject* value);
  34. public:
  35. // internal
  36. static const char* GetData(FieldInfo *field);
  37. static void GetDefaultFieldValue(FieldInfo *field, void *value);
  38. static bool IsInstance(FieldInfo* field);
  39. static bool IsNormalStatic(FieldInfo* field);
  40. static bool IsThreadStatic(FieldInfo* field);
  41. static void SetValueRaw(const Il2CppType *type, void *dest, void *value, bool deref_pointer);
  42. };
  43. } /* namespace vm */
  44. } /* namespace il2cpp */