CustomAttributeCreator.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "metadata/CustomAttributeDataReader.h"
  3. #include "il2cpp-object-internals.h"
  4. #include "vm-utils/VmThreadUtils.h"
  5. namespace il2cpp
  6. {
  7. namespace metadata
  8. {
  9. class CustomAttributeCreator : public CustomAttributeReaderVisitor
  10. {
  11. private:
  12. Il2CppObject* attr;
  13. Il2CppException* exc;
  14. public:
  15. CustomAttributeCreator() : attr(NULL), exc(NULL)
  16. {
  17. // As currently implemented CustomAttributeCreator must be stack allocated
  18. // It directly stores managed objects attr & exc so it must be either on the stack
  19. // or in GC allocated memory
  20. IL2CPP_ASSERT_STACK_PTR(this);
  21. }
  22. virtual void VisitCtor(const MethodInfo* ctor, CustomAttributeArgument args[], uint32_t argumentCount);
  23. virtual void VisitField(const CustomAttributeFieldArgument& field, uint32_t index);
  24. virtual void VisitProperty(const CustomAttributePropertyArgument& prop, uint32_t index);
  25. Il2CppObject* GetAttribute(Il2CppException** exc);
  26. private:
  27. };
  28. } /* namespace vm */
  29. } /* namespace il2cpp */