You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
1.2 KiB

  1. #pragma once
  2. #include <cpphibernate/config.h>
  3. #include <cpphibernate/schema/table.h>
  4. namespace cpphibernate {
  5. namespace schema {
  6. namespace __impl
  7. {
  8. /**
  9. * @brief Helper type to build tables.
  10. */
  11. template<typename T, typename = void>
  12. struct tables_builder;
  13. /**
  14. * @brief Helper class to find a table by it's datatype.
  15. */
  16. template<typename X, typename = void>
  17. struct find_table_builder;
  18. }
  19. /**
  20. * @brief Evaluates to true_t if the passed type is a tables type.
  21. */
  22. template<typename T>
  23. struct is_tables;
  24. /**
  25. * @brief Is true if the passed type is an tables type, false otherwise.
  26. */
  27. template<typename T>
  28. constexpr bool is_tables_v = is_tables<T>::value;
  29. /**
  30. * @brief Predicate to create an tables object from the passed tables.
  31. */
  32. constexpr decltype(auto) make_tables = mp::generic_predicate<__impl::tables_builder> { };
  33. /**
  34. * @brief Predicate to find a table by it's dataset type.
  35. */
  36. constexpr decltype(auto) find_table = mp::generic_predicate<__impl::find_table_builder> { };
  37. } }
  38. #include "tables.inl"