SOLA
Loading...
Searching...
No Matches
minhton_find_end_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_MINTHON_FIND_END_ALGORITHM_H_
8#define MINHTON_ALGORITHMS_MINTHON_FIND_END_ALGORITHM_H_
9
10#include <memory>
11
12#include "minhton/algorithms/algorithm_interface.h"
13#include "minhton/message/find_end.h"
14#include "minhton/message/types_all.h"
15
16namespace minhton {
17
19public:
20 MinhtonFindEndAlgorithm(std::shared_ptr<AccessContainer> access, bool join)
21 : AlgorithmInterface(access), join_(join){};
22
23 void process(const MessageVariant &) override { /* nothing required */
24 }
25
32 void forwardRequest(minhton::NodeInfo target, minhton::NodeInfo request_origin,
33 SearchProgress search_progress, uint16_t hop_count);
34
40 void forwardToAdjacentNode(minhton::NodeInfo request_origin, uint16_t hop_count);
41
46 bool isCorrectParent() const;
47
54 void searchEndOnLevel(minhton::NodeInfo request_origin, bool left_side, uint16_t hop_count);
55
62
68 void checkRight(minhton::NodeInfo request_origin, uint16_t hop_count);
69
76
84 bool decideNextStep(minhton::NodeInfo request_origin, uint16_t hop_count);
85
86private:
89 bool join_;
90};
91
92} // namespace minhton
93
94#endif
Definition algorithm_interface.h:18
Definition minhton_find_end_algorithm.h:18
bool decideNextStep(minhton::NodeInfo request_origin, uint16_t hop_count)
Definition minhton_find_end_algorithm_helper.cpp:206
void forwardRequest(minhton::NodeInfo target, minhton::NodeInfo request_origin, SearchProgress search_progress, uint16_t hop_count)
Definition minhton_find_end_algorithm_helper.cpp:15
void checkRight(minhton::NodeInfo request_origin, uint16_t hop_count)
Definition minhton_find_end_algorithm_helper.cpp:176
void forwardToAdjacentNode(minhton::NodeInfo request_origin, uint16_t hop_count)
Definition minhton_find_end_algorithm_helper.cpp:50
minhton::NodeInfo findReachableNodeClosestToParent(minhton::NodeInfo child) const
Definition minhton_find_end_algorithm_helper.cpp:154
void searchEndOnLevel(minhton::NodeInfo request_origin, bool left_side, uint16_t hop_count)
Definition minhton_find_end_algorithm_helper.cpp:110
static bool isRightmostPossibleNode(minhton::NodeInfo node)
Definition minhton_find_end_algorithm_helper.cpp:201
bool isCorrectParent() const
Definition minhton_find_end_algorithm_helper.cpp:71
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