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.

53 lines
1.3 KiB

  1. #pragma once
  2. #include <memory>
  3. namespace cpphibernate {
  4. namespace mariadb {
  5. /**
  6. * @brief Type properties for the passed type.
  7. *
  8. * @tparam T Type to get properties for.
  9. */
  10. template<typename T, typename = void>
  11. struct type_properties
  12. {
  13. /**
  14. * @brief Get the mariadb type.
  15. */
  16. static constexpr const char * type() = delete;
  17. /**
  18. * @brief Convert a value from the database to its actual type.
  19. */
  20. static T convert_to(const value_t&) = delete;
  21. /**
  22. * @brief Convert the actual value to a database value.
  23. */
  24. static value_t convert_from(const T&) = delete;
  25. /**
  26. * @brief Get the string to start the "convert to" operation.
  27. */
  28. static constexpr const char * convert_to_open() = delete;
  29. /**
  30. * @brief Get the string to end the "convert to" operation.
  31. */
  32. static constexpr const char * convert_to_close() = delete;
  33. /**
  34. * @brief Get the string to start the "convert from" operation.
  35. */
  36. static constexpr const char * convert_from_open() = delete;
  37. /**
  38. * @brief Get the string to end the "convert from" operation.
  39. */
  40. static constexpr const char * convert_from_close() = delete;
  41. };
  42. } }