SOLA
Loading...
Searching...
No Matches
find_replacement.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_FIND_REPLACEMENT_H_
8#define MINHTON_MESSAGE_FIND_REPLACEMENT_H_
9
10#include "minhton/message/find_end.h"
11#include "minhton/message/message.h"
12#include "solanet/serializer/serialize.h"
13
14namespace minhton {
21class MessageFindReplacement : public MinhtonMessage<MessageFindReplacement> {
22public:
28 SearchProgress search_progress = SearchProgress::kNone,
29 uint16_t hop_count = 0);
30
31 NodeInfo getNodeToReplace() const;
32 SearchProgress getSearchProgress() const;
33 uint16_t getHopCount() const;
34
35 SERIALIZE(header_, node_to_replace_, search_progress_, hop_count_);
36
37 MessageFindReplacement() = default;
38
39private:
40 friend MinhtonMessage;
41
44
46 bool validateImpl() const;
47
49 NodeInfo node_to_replace_;
50
52 SearchProgress search_progress_ = SearchProgress::kNone;
53
56 uint16_t hop_count_ = 0;
57};
58} // namespace minhton
59
60#endif
Usage: A node wants to leave the network, but cannot leave the position directly because it would vio...
Definition find_replacement.h:21
Definition message_header.h:24
Definition message.h:28
Definition node_info.h:24
Definition minhton_watchdog_ns3.cpp:24
SearchProgress
Used by the minhton join & leave algorithm to save the progress of the position finding.
Definition find_end.h:12