lib.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <common/boxed_type.h>
  2. #include <common/empty.h>
  3. #include <entt/core/attribute.h>
  4. #include <entt/core/hashed_string.hpp>
  5. #include <entt/core/type_info.hpp>
  6. #include <entt/locator/locator.hpp>
  7. #include <entt/meta/context.hpp>
  8. #include <entt/meta/factory.hpp>
  9. #include <entt/meta/meta.hpp>
  10. template const entt::type_info &entt::type_id<double>() noexcept;
  11. test::boxed_int create_boxed_int(int value) {
  12. return test::boxed_int{value};
  13. }
  14. ENTT_API void share(const entt::locator<entt::meta_ctx>::node_type &handle) {
  15. entt::locator<entt::meta_ctx>::reset(handle);
  16. }
  17. ENTT_API void set_up() {
  18. using namespace entt::literals;
  19. entt::meta<test::boxed_int>()
  20. .type("boxed_int"_hs)
  21. .ctor<&create_boxed_int>()
  22. .data<&test::boxed_int::value>("value"_hs);
  23. entt::meta<test::empty>()
  24. .type("empty"_hs)
  25. .ctor<>();
  26. }
  27. ENTT_API void tear_down() {
  28. entt::meta_reset<test::boxed_int>();
  29. entt::meta_reset<test::empty>();
  30. }
  31. ENTT_API entt::meta_any wrap_int(int value) {
  32. return value;
  33. }