SOLA
Loading...
Searching...
No Matches
minhton_leave_algorithm.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_ALGORITHMS_LEAVE_MINHTON_LEAVE_ALGORITHM_H_
8#define MINHTON_ALGORITHMS_LEAVE_MINHTON_LEAVE_ALGORITHM_H_
9
10#include <memory>
11
12#include "minhton/algorithms/find_end/minhton_find_end_algorithm.h"
13#include "minhton/algorithms/leave/leave_algorithm_general.h"
14#include "minhton/message/find_end.h"
15#include "minhton/message/types_all.h"
16
17namespace minhton {
18
20public:
21 explicit MinhtonLeaveAlgorithm(std::shared_ptr<AccessContainer> access)
22 : LeaveAlgorithmGeneral(access), find_end_helper_(access, false){};
23
34 bool canLeaveWithoutReplacement() override;
35
46 void initiateSelfDeparture() override;
47
48protected:
57 void processFindReplacement(const minhton::MessageFindReplacement &message) override;
58
70
85
86private:
87 MinhtonFindEndAlgorithm find_end_helper_;
88};
89} // namespace minhton
90
91#endif
Definition leave_algorithm_general.h:31
Usage: A node wants to leave the network, but cannot leave the position directly because it would vio...
Definition find_replacement.h:21
Definition minhton_find_end_algorithm.h:18
Definition minhton_leave_algorithm.h:19
void processFindReplacement(const minhton::MessageFindReplacement &message) override
Definition minhton_leave_algorithm.cpp:55
bool canLeaveWithoutReplacement() override
Definition minhton_leave_algorithm.cpp:17
void initiateSelfDeparture() override
Definition minhton_leave_algorithm.cpp:40
void performFindReplacement()
Definition minhton_leave_algorithm.cpp:66
Definition minhton_watchdog_ns3.cpp:24