◆ checkRight()
void minhton::MinhtonFindEndAlgorithm::checkRight |
( |
minhton::NodeInfo |
request_origin, |
|
|
uint16_t |
hop_count |
|
) |
| |
Helper method to check if the current level is completely filled
- Parameters
-
request_origin | The new node that wants to join or the existing node that wants to leave the network. |
hop_count | Counter for how many times the request has been forwarded |
◆ decideNextStep()
bool minhton::MinhtonFindEndAlgorithm::decideNextStep |
( |
minhton::NodeInfo |
request_origin, |
|
|
uint16_t |
hop_count |
|
) |
| |
Helper method which makes a decision about the horiziontal direction to follow based on routing tables (only call once when the first null node is reached)
- Parameters
-
request_origin | The new node that wants to join or the existing node that wants to leave the network. |
- Returns
- true when found correct position, false when concurrent steps are needed
- Parameters
-
hop_count | Counter for how many times the request has been forwarded |
◆ findReachableNodeClosestToParent()
Helper method to get a node which is either the direct parent of a node or somewhere close to where the actual parent is, if the parent isn't in the routing table
- Parameters
-
child | Node we are searching a parent (or a node close to it) for |
- Returns
- NodeInfo Parent or a node close to it
◆ forwardRequest()
Helper method to send a message for forwarding the join / leave request to another node
- Parameters
-
target | Node to forward the join / leave request to |
request_origin | The node which wishes to join / leave the network |
search_progress | The current step of the join / leave algorithm |
hop_count | Counter for how many times the request has been forwarded |
◆ forwardToAdjacentNode()
void minhton::MinhtonFindEndAlgorithm::forwardToAdjacentNode |
( |
minhton::NodeInfo |
request_origin, |
|
|
uint16_t |
hop_count |
|
) |
| |
Helper method to jump to the most beneficial adjacent node (during a join / leave)
- Parameters
-
request_origin | The new node that wants to join or the existing node that wants to leave the network. |
hop_count | Counter for how many times the request has been forwarded |
◆ isCorrectParent()
bool minhton::MinhtonFindEndAlgorithm::isCorrectParent |
( |
| ) |
const |
Helper method to check if the current node is the wanted join / leave replacement node position. Only use after it is known which level is the last one!
- Returns
- true if we are at the final position, else false
◆ isRightmostPossibleNode()
bool minhton::MinhtonFindEndAlgorithm::isRightmostPossibleNode |
( |
minhton::NodeInfo |
node | ) |
|
|
static |
Helper method to check if the passed node is the last one that can exists on a level and is initialized
- Parameters
-
node | Node which should be checked |
- Returns
- true if the condition is fulfilled
◆ process()
void minhton::MinhtonFindEndAlgorithm::process |
( |
const MessageVariant & |
| ) |
|
|
inlineoverridevirtual |
◆ searchEndOnLevel()
void minhton::MinhtonFindEndAlgorithm::searchEndOnLevel |
( |
minhton::NodeInfo |
request_origin, |
|
|
bool |
left_side, |
|
|
uint16_t |
hop_count |
|
) |
| |
Helper method to do the search for the first null node on one side
- Parameters
-
request_origin | The new node that wants to join or the existing node that wants to leave the network. |
left_side | Set to true to only search on the left side, else on the right side |
hop_count | Counter for how many times the request has been forwarded |
The documentation for this class was generated from the following files:
- minhton/include/minhton/algorithms/find_end/minhton_find_end_algorithm.h
- minhton/src/algorithms/find_end/minhton_find_end_algorithm_helper.cpp