SOLA
Loading...
Searching...
No Matches
replacement_ack.h
1// Copyright The SOLA Contributors
2//
3// Licensed under the MIT License.
4// For details on the licensing terms, see the LICENSE file.
5// SPDX-License-Identifier: MIT
6
7#ifndef MINHTON_MESSAGE_REPLACEMENT_ACK_H_
8#define MINHTON_MESSAGE_REPLACEMENT_ACK_H_
9
10#include "minhton/message/message.h"
11#include "solanet/serializer/serialize.h"
12
13namespace minhton {
19class MessageReplacementAck : public MinhtonMessage<MessageReplacementAck> {
20public:
21 struct LockedStates {
22 bool locked;
23 bool locked_right;
24 bool locked_left;
25 };
26
30 MessageReplacementAck(MinhtonMessageHeader header, std::vector<minhton::NodeInfo> neighbors,
31 LockedStates lockedStates);
32
33 std::vector<minhton::NodeInfo> getNeighbors() const;
34 LockedStates getLockedStates() const;
35
36 SERIALIZE(header_, neighbors_, locked_, locked_right_, locked_left_);
37
38 MessageReplacementAck() = default;
39
40private:
41 friend MinhtonMessage;
42
45
47 bool validateImpl() const;
48
50 std::vector<minhton::NodeInfo> neighbors_;
51
53 bool locked_ = false;
54 bool locked_right_ = false;
55 bool locked_left_ = false;
56};
57} // namespace minhton
58
59#endif
Usage: The node that wants to leave the network receives a MessageReplacementOffer from a node that i...
Definition replacement_ack.h:19
MessageReplacementAck(MinhtonMessageHeader header, std::vector< minhton::NodeInfo > neighbors, LockedStates lockedStates)
Definition message_header.h:24
Definition message.h:28
Definition minhton_watchdog_ns3.cpp:24
Definition replacement_ack.h:21