48 constexpr auto ext_type =
static_cast<std::int8_t
>(-1);
50 constexpr auto max_timestamp32_seconds =
51 static_cast<std::time_t
>(0xFFFFFFFF);
52 if (value.tv_nsec == 0 &&
53 static_cast<std::time_t
>(0U) <= value.tv_sec &&
54 value.tv_sec <= max_timestamp32_seconds) {
58 static_cast<std::uint32_t
>(value.tv_sec));
62 constexpr auto max_timestamp64_seconds =
63 static_cast<std::time_t
>(0x3FFFFFFFF);
64 if (
static_cast<std::time_t
>(0U) <= value.tv_sec &&
65 value.tv_sec <= max_timestamp64_seconds) {
67 auto data =
static_cast<std::uint64_t
>(value.tv_nsec);
68 constexpr unsigned int nsec_offset = 34;
70 data |=
static_cast<std::uint64_t
>(value.tv_sec);
78 constexpr std::size_t timestamp96_data_size = 12;
Class of buffers to serialize data.
void serialize_fixext8_header(std::int8_t ext_type)
Serialize the size and type of an extension value in fixext 8 format.
void write_in_big_endian(T... values)
Write values in big endian.
void serialize_ext_header(std::int8_t ext_type, std::size_t data_size)
Serialize the size and type of an extension value.
void serialize_fixext4_header(std::int8_t ext_type)
Serialize the size and type of an extension value in fixext 4 format.
Forward declaration of classes to support serialization of data types.
Namespace of classes to support serialization of types.
Definition of serialization_buffer class.
static void serialize(serialization_buffer &buffer, const std::timespec &value)
Serialize a value.
Class to define functions to serialize data of various types.