19#ifndef CPPREALM_MANAGED_TIMESTAMP_HPP
20#define CPPREALM_MANAGED_TIMESTAMP_HPP
22#include <cpprealm/internal/bridge/timestamp.hpp>
23#include <cpprealm/macros.hpp>
32 using value_type = std::chrono::time_point<std::chrono::system_clock>;
33 using managed<std::chrono::time_point<std::chrono::system_clock>>::managed_base::operator=;
35 [[nodiscard]] std::chrono::time_point<std::chrono::system_clock> detach()
const {
36 return m_obj->template get<realm::internal::bridge::timestamp>(m_key);
39 [[nodiscard]]
operator std::chrono::time_point<std::chrono::system_clock>()
const {
43 auto time_since_epoch()
const {
44 auto ts = m_obj->template get<internal::bridge::timestamp>(m_key);
45 return ts.get_time_point().time_since_epoch();
49 void operator+=(
const std::chrono::duration<S>& rhs) {
50 auto ts = m_obj->template get<internal::bridge::timestamp>(m_key);
55 rbool operator==(
const std::chrono::time_point<std::chrono::system_clock>& rhs)
const noexcept;
56 rbool operator!=(
const std::chrono::time_point<std::chrono::system_clock>& rhs)
const noexcept;
57 rbool operator>(
const std::chrono::time_point<std::chrono::system_clock>& rhs)
const noexcept;
58 rbool operator>=(
const std::chrono::time_point<std::chrono::system_clock>& rhs)
const noexcept;
59 rbool operator<(
const std::chrono::time_point<std::chrono::system_clock>& rhs)
const noexcept;
60 rbool operator<=(
const std::chrono::time_point<std::chrono::system_clock>& rhs)
const noexcept;
68 template<
typename,
typename>
74 using value_type = std::optional<std::chrono::time_point<std::chrono::system_clock>>;
75 using managed<std::optional<std::chrono::time_point<std::chrono::system_clock>>>::managed_base::operator=;
77 [[nodiscard]] std::optional<std::chrono::time_point<std::chrono::system_clock>> detach()
const {
81 [[nodiscard]]
operator std::optional<std::chrono::time_point<std::chrono::system_clock>>()
const {
87 void operator+=(
const std::chrono::duration<S>& rhs) {
91 auto time_since_epoch()
const {
93 return ts->get_time_point().time_since_epoch();
97 std::reference_wrapper<managed<std::optional<std::chrono::time_point<std::chrono::system_clock>>>> m_parent;
98 friend struct managed<std::optional<std::chrono::time_point<std::chrono::system_clock>>>;
101 std::unique_ptr<box> operator->()
103 return std::make_unique<box>(
box(*
this));
105 [[nodiscard]]
box operator*() {
110 rbool operator==(
const std::optional<std::chrono::time_point<std::chrono::system_clock>>& rhs)
const noexcept;
111 rbool operator!=(
const std::optional<std::chrono::time_point<std::chrono::system_clock>>& rhs)
const noexcept;
119 template<
typename,
typename>
Definition: managed_dictionary.hpp:129
Definition: timestamp.hpp:30
Definition: macros.hpp:286