* Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved.
* ubs-engine is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
#ifndef UBSE_HEART_BEAT_REPLY_SIMPO_H
#define UBSE_HEART_BEAT_REPLY_SIMPO_H
#include "ubse_election_def.h"
#include "ubse_base_message.h"
namespace ubse::election::message {
using ubse::common::def::UbseResult;
using ubse::message::UbseBaseMessage;
using ubse::utils::Ref;
class UbseElectionReplyPktSimpo : public UbseBaseMessage {
public:
UbseElectionReplyPktSimpo() = default;
explicit UbseElectionReplyPktSimpo(const ElectionReplyPkt&);
explicit UbseElectionReplyPktSimpo(uint8_t* rawDev, uint32_t size)
{
SetInputRawData(rawDev, size);
}
inline ElectionReplyPkt GetElectionReplyPkt()
{
return electionReplyPkt_;
}
inline void SetResponse(ElectionReplyPkt& replyPkt)
{
electionReplyPkt_ = replyPkt;
}
UbseResult Serialize() override;
UbseResult Deserialize() override;
std::string ToString() const override;
private:
ElectionReplyPkt electionReplyPkt_{};
};
using UbseElectionReplyPktSimpoPtr = Ref<UbseElectionReplyPktSimpo>;
}
#endif