|
- #pragma once
-
- #include <cppcore/misc/exception.h>
-
- #include "types.h"
-
- namespace cpphibernate
- {
-
- /* timestamp */
-
- timestamp::timestamp(uint64_t v)
- : value(v)
- { }
-
- timestamp& timestamp::operator=(const uint64_t& v)
- {
- value = v;
- return *this;
- }
-
- timestamp::operator uint64_t() const
- { return value; }
-
- /* uuid */
-
- uuid::uuid()
- : std::array<uint8_t, 16>::array({ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } })
- { }
-
- uuid::uuid(const std::string& str)
- : std::array<uint8_t, 16>::array({ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } })
- {
- if (!from_string(str, *this))
- throw ::cppcore::argument_exception("str", "invalid uuid");
- }
-
- }
|