19#ifndef CPPREALM_BRIDGE_TIMESTAMP_HPP
20#define CPPREALM_BRIDGE_TIMESTAMP_HPP
23#include <cpprealm/internal/bridge/utils.hpp>
29命名空间realm::internal::bridge {
38 操作符 Timestamp()
const ;
39 操作符 std::chrono::time_point<std::chrono::system_clock>()
const ;
41 timestamp (
const std::chrono::time_point<std::chrono::system_clock>& tp);
42 [[nodiscard]] int 64 _t get_seconds()
const noException ;
43 [[nodiscard]] int 32 _t get_nanoseconds()
const noException ;
44 [[nodiscard]] std::chrono::time_point<std::chrono::system_clock, std::chrono::system_clock::duration>
45 get_time_point()
const {
46 int 64 _t Native_nano = get_seconds() *anoseconds_per_second + get_nanoseconds();
47 auto duration = std::chrono::duration_cast<std::chrono::system_clock::duration>(std::chrono::duration<int64_t, std::nano>{native_nano});
48 return std::chrono::time_point<std::chrono::system_clock,
49 std::chrono::system_clock::duration>(duration);
52 静态 constexpr int 32 _t Nanoseconds_per_second = 1000000000 ;
53 int 64 _t m_seconds = 0 ;
54 int 32 _t m_nanoseconds = 0 ;