Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

39 lignes
768 B

  1. #pragma once
  2. #include <cppcore/misc/exception.h>
  3. #include "types.h"
  4. namespace cpphibernate
  5. {
  6. /* timestamp */
  7. timestamp::timestamp(uint64_t v)
  8. : value(v)
  9. { }
  10. timestamp& timestamp::operator=(const uint64_t& v)
  11. {
  12. value = v;
  13. return *this;
  14. }
  15. timestamp::operator uint64_t() const
  16. { return value; }
  17. /* uuid */
  18. uuid::uuid()
  19. : std::array<uint8_t, 16>::array({ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } })
  20. { }
  21. uuid::uuid(const std::string& str)
  22. : std::array<uint8_t, 16>::array({ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } })
  23. {
  24. if (!from_string(str, *this))
  25. throw ::cppcore::argument_exception("str", "invalid uuid");
  26. }
  27. }