40 if (
this != &rhs) this->message_ = std::move(rhs.message_);
57 std::make_move_iterator(rhs.message_.begin()),
58 std::make_move_iterator(rhs.message_.end())
73 this->
message_.push_back(std::move(m));
100 return SourceInfo{s.GetMessageId(), s.GetTimestamp()};
109 this->
message_.erase(std::remove_if(this->
message_.begin(), this->message_.end(),
111 { return !p.valid(); }),
112 this->message_.end());
118 for (
const auto& p : this->
message_)
120 if (!p.valid())
return false;
121 if (p.allowSend())
empty =
false;
static constexpr MessageTypes GetType()
MessageChain & operator+=(const MessageChain &rhs)
bool empty() const noexcept
STL-like interface
MessageContainer message_
std::optional< SourceInfo > GetSourceInfo() const
获取消息链中的来源信息
bool valid() const
检查消息链是否有效
MessageChain & operator=(const MessageChain &rhs)
void RemoveInvalid()
去除消息链中的无效消息
MessageChain operator+(const MessageChain &lhs, const MessageChain &rhs)