28 sizeof(uint64_t) +
sizeof(int32_t) + \
34 : sender_id_(sender_id), seq_num_(seq_num), spare_id_(false) {}
38 : sender_id_(sender_id), seq_num_(seq_num), spare_id_(spare_id) {}
41 : sender_id_(another.sender_id_),
42 channel_id_(another.channel_id_),
43 seq_num_(another.seq_num_),
44 spare_id_(another.spare_id_) {}
49 if (
this != &another) {
50 sender_id_ = another.sender_id_;
51 channel_id_ = another.channel_id_;
52 seq_num_ = another.seq_num_;
53 spare_id_ = another.spare_id_;
59 return sender_id_ == another.sender_id_ &&
60 channel_id_ == another.channel_id_ && seq_num_ == another.seq_num_ &&
61 spare_id_ == another.spare_id_;
65 return !(*
this == another);
73 reinterpret_cast<const char*
>(&channel_id_),
sizeof(channel_id_));
75 reinterpret_cast<const char*
>(&seq_num_),
sizeof(seq_num_));
77 dst->append(
reinterpret_cast<const char*
>(
78 &send_time_),
sizeof(send_time_));
83 if (dst ==
nullptr || len <
kSize) {
91 reinterpret_cast<const char*
>(&channel_id_),
sizeof(channel_id_));
92 ptr +=
sizeof(channel_id_);
94 reinterpret_cast<const char*
>(&seq_num_),
sizeof(seq_num_));
95 ptr +=
sizeof(seq_num_);
99 reinterpret_cast<const char*
>(&send_time_),
sizeof(send_time_));
110 AWARN <<
"src size mismatch, given[" << len <<
"] target[" <<
kSize <<
"]";
114 char* ptr =
const_cast<char*
>(src);
118 reinterpret_cast<char*
>(&channel_id_), ptr,
sizeof(channel_id_));
119 ptr +=
sizeof(channel_id_);
121 reinterpret_cast<char*
>(&seq_num_), ptr,
sizeof(seq_num_));
122 ptr +=
sizeof(seq_num_);
126 reinterpret_cast<char*
>(&send_time_), ptr,
sizeof(send_time_));
const char * data() const
void set_data(const char *data)
bool operator!=(const MessageInfo &another) const
bool DeserializeFrom(const std::string &src)
static const std::size_t kSize
bool SerializeTo(std::string *dst) const
bool operator==(const MessageInfo &another) const
MessageInfo & operator=(const MessageInfo &another)
#define RETURN_VAL_IF_NULL(ptr, val)
constexpr uint8_t ID_SIZE