SOLA
Loading...
Searching...
No Matches
replacement_update.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_UPDATE_H_
8#define MINHTON_MESSAGE_REPLACEMENT_UPDATE_H_
9
10#include "minhton/message/message.h"
11#include "solanet/serializer/serialize.h"
12
13namespace minhton {
20class MessageReplacementUpdate : public MinhtonMessage<MessageReplacementUpdate> {
21public:
28 MessageReplacementUpdate(MinhtonMessageHeader header, NodeInfo removed_position_node,
29 NodeInfo replaced_position_node, LogicalNodeInfo new_l_node_info,
30 bool should_acknowledge = false);
31
32 NodeInfo getRemovedPositionNode() const;
33 NodeInfo getReplacedPositionNode() const;
34 LogicalNodeInfo getNewLogicalNodeInfo() const;
35 bool getShouldAcknowledge() const;
36
37 SERIALIZE(header_, removed_position_node_, replaced_position_node_, new_l_node_info_,
38 should_acknowledge_);
39
40 MessageReplacementUpdate() = default;
41
42private:
43 friend MinhtonMessage;
44
47
49 bool validateImpl() const;
50
52 NodeInfo removed_position_node_;
53
56 NodeInfo replaced_position_node_;
57
59 LogicalNodeInfo new_l_node_info_;
60
61 bool should_acknowledge_ = false;
62};
63} // namespace minhton
64
65#endif
Definition logical_node_info.h:23
Usage: During the replacement process, the neighbor nodes of the leaving node / the replaced position...
Definition replacement_update.h:20
Definition message_header.h:24
Definition message.h:28
Definition node_info.h:24
Definition minhton_watchdog_ns3.cpp:24