forward.h 719 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // forward.h
  3. // reflection
  4. //
  5. // Created by Sam Jaffe on 7/3/22.
  6. // Copyright © 2022 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. #include <functional>
  10. #include <map>
  11. #include <string>
  12. #include <type_traits>
  13. namespace reflection {
  14. class Object;
  15. template <typename Obj, typename = void> class Reflection;
  16. template <typename T> class Proxy;
  17. template <typename O, typename I> struct TypeConversion;
  18. template <typename Func> using Cache = std::map<std::string_view, Func>;
  19. template <typename Obj>
  20. using Accessor = std::function<Object(Obj &, std::string)>;
  21. template <typename Obj>
  22. using Getter = std::function<Object(Obj const &, std::string)>;
  23. }
  24. #define reflect(object) reflection::Object(object, #object)