forward.h 719 B

123456789101112131415161718192021222324252627
  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> using Accessor = std::function<Object(Obj &, std::string)>;
  20. template <typename Obj> using Getter = std::function<Object(Obj const &, std::string)>;
  21. }
  22. #define reflect(object) reflection::Object(object, #object)