26#ifndef MYSQL_ROUTER_CLASSIC_PROTOCOL_BINARY_H_
27#define MYSQL_ROUTER_CLASSIC_PROTOCOL_BINARY_H_
31#include <system_error>
43template <
bool Borrowed>
44using string_type = std::conditional_t<Borrowed, std::string_view, std::string>;
91 [[nodiscard]]
constexpr uint16_t
year()
const {
return year_; }
92 [[nodiscard]]
constexpr uint8_t
month()
const {
return month_; }
93 [[nodiscard]]
constexpr uint8_t
day()
const {
return day_; }
94 [[nodiscard]]
constexpr uint8_t
hour()
const {
return hour_; }
110 return !(lhs == rhs);
152 [[nodiscard]]
constexpr uint32_t
days()
const {
return days_; }
153 [[nodiscard]]
constexpr uint8_t
hour()
const {
return hour_; }
168 return !(lhs == rhs);
220template <
bool Borrowed>
226template <
bool Borrowed>
232template <
bool Borrowed>
238template <
bool Borrowed>
244template <
bool Borrowed>
250template <
bool Borrowed>
256template <
bool Borrowed>
262template <
bool Borrowed>
268template <
bool Borrowed>
274template <
bool Borrowed>
280template <
bool Borrowed>
286template <
bool Borrowed>
292template <
bool Borrowed>
298template <
bool Borrowed>
Definition: classic_protocol_binary.h:293
Definition: classic_protocol_binary.h:245
Definition: classic_protocol_binary.h:123
Definition: classic_protocol_binary.h:133
POD base-type for Datetime, Timestamp, Date.
Definition: classic_protocol_binary.h:73
constexpr DatetimeBase(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t microsecond=0)
Definition: classic_protocol_binary.h:77
friend bool operator==(const DatetimeBase &lhs, const DatetimeBase &rhs)
Definition: classic_protocol_binary.h:99
constexpr uint8_t hour() const
Definition: classic_protocol_binary.h:94
constexpr uint8_t minute() const
Definition: classic_protocol_binary.h:95
uint8_t month_
Definition: classic_protocol_binary.h:115
constexpr uint32_t microsecond() const
Definition: classic_protocol_binary.h:97
constexpr uint16_t year() const
Definition: classic_protocol_binary.h:91
uint8_t second_
Definition: classic_protocol_binary.h:119
uint16_t year_
Definition: classic_protocol_binary.h:114
constexpr uint8_t second() const
Definition: classic_protocol_binary.h:96
friend bool operator!=(const DatetimeBase &lhs, const DatetimeBase &rhs)
Definition: classic_protocol_binary.h:109
constexpr DatetimeBase(uint16_t year, uint8_t month, uint8_t day)
Definition: classic_protocol_binary.h:88
uint32_t microsecond_
Definition: classic_protocol_binary.h:120
uint8_t hour_
Definition: classic_protocol_binary.h:117
constexpr uint8_t day() const
Definition: classic_protocol_binary.h:93
uint8_t minute_
Definition: classic_protocol_binary.h:118
constexpr uint8_t month() const
Definition: classic_protocol_binary.h:92
uint8_t day_
Definition: classic_protocol_binary.h:116
Definition: classic_protocol_binary.h:281
Definition: classic_protocol_binary.h:210
Definition: classic_protocol_binary.h:269
Definition: classic_protocol_binary.h:215
Definition: classic_protocol_binary.h:299
Definition: classic_protocol_binary.h:190
Definition: classic_protocol_binary.h:239
Definition: classic_protocol_binary.h:263
Definition: classic_protocol_binary.h:180
Definition: classic_protocol_binary.h:185
Definition: classic_protocol_binary.h:257
Definition: classic_protocol_binary.h:287
Definition: classic_protocol_binary.h:304
Definition: classic_protocol_binary.h:275
Definition: classic_protocol_binary.h:195
Definition: classic_protocol_binary.h:221
Definition: classic_protocol_binary.h:138
uint8_t hour_
Definition: classic_protocol_binary.h:174
constexpr uint8_t hour() const
Definition: classic_protocol_binary.h:153
constexpr uint32_t days() const
Definition: classic_protocol_binary.h:152
uint32_t microsecond_
Definition: classic_protocol_binary.h:177
constexpr uint32_t microsecond() const
Definition: classic_protocol_binary.h:156
uint8_t minute_
Definition: classic_protocol_binary.h:175
friend bool operator==(const Time &lhs, const Time &rhs)
Definition: classic_protocol_binary.h:158
uint8_t second_
Definition: classic_protocol_binary.h:176
constexpr uint8_t minute() const
Definition: classic_protocol_binary.h:154
friend bool operator!=(const Time &lhs, const Time &rhs)
Definition: classic_protocol_binary.h:167
constexpr Time(bool is_negative, uint32_t days, uint8_t hour, uint8_t minute, uint8_t second, uint32_t microsecond=0)
Definition: classic_protocol_binary.h:142
constexpr uint8_t second() const
Definition: classic_protocol_binary.h:155
uint32_t days_
Definition: classic_protocol_binary.h:173
constexpr bool is_negative() const
Definition: classic_protocol_binary.h:151
bool is_negative_
Definition: classic_protocol_binary.h:172
Definition: classic_protocol_binary.h:128
Definition: classic_protocol_binary.h:251
Definition: classic_protocol_binary.h:205
base type of all binary scalar value types.
Definition: classic_protocol_binary.h:50
friend bool operator==(const TypeBase &lhs, const TypeBase &rhs)
Definition: classic_protocol_binary.h:58
friend bool operator!=(const TypeBase &lhs, const TypeBase &rhs)
Definition: classic_protocol_binary.h:62
T value_type
Definition: classic_protocol_binary.h:52
constexpr TypeBase(value_type val)
Definition: classic_protocol_binary.h:54
constexpr value_type value() const
Definition: classic_protocol_binary.h:56
value_type v_
Definition: classic_protocol_binary.h:67
Definition: classic_protocol_binary.h:227
Definition: classic_protocol_binary.h:233
Definition: classic_protocol_binary.h:200
borrowable::binary::Float Float
Definition: classic_protocol_binary.h:347
borrowable::binary::LongLong LongLong
Definition: classic_protocol_binary.h:346
borrowable::binary::Date Date
Definition: classic_protocol_binary.h:351
borrowable::binary::Double Double
Definition: classic_protocol_binary.h:348
borrowable::binary::Short Short
Definition: classic_protocol_binary.h:343
borrowable::binary::DateTime DateTime
Definition: classic_protocol_binary.h:352
borrowable::binary::Null Null
Definition: classic_protocol_binary.h:368
borrowable::binary::Long Long
Definition: classic_protocol_binary.h:345
borrowable::binary::Int24 Int24
Definition: classic_protocol_binary.h:344
borrowable::binary::Timestamp Timestamp
Definition: classic_protocol_binary.h:353
borrowable::binary::Tiny Tiny
Definition: classic_protocol_binary.h:342
borrowable::binary::Year Year
Definition: classic_protocol_binary.h:349
std::conditional_t< Borrowed, std::string_view, std::string > string_type
Definition: classic_protocol_binary.h:44
constexpr value_type binary
Definition: classic_protocol_constants.h:275
Definition: classic_protocol_binary.h:39