SOLA
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
minhton::MinhtonFindEndAlgorithm Class Reference
Inheritance diagram for minhton::MinhtonFindEndAlgorithm:
minhton::AlgorithmInterface

Public Member Functions

 MinhtonFindEndAlgorithm (std::shared_ptr< AccessContainer > access, bool join)
 
void process (const MessageVariant &) override
 
void forwardRequest (minhton::NodeInfo target, minhton::NodeInfo request_origin, SearchProgress search_progress, uint16_t hop_count)
 
void forwardToAdjacentNode (minhton::NodeInfo request_origin, uint16_t hop_count)
 
bool isCorrectParent () const
 
void searchEndOnLevel (minhton::NodeInfo request_origin, bool left_side, uint16_t hop_count)
 
minhton::NodeInfo findReachableNodeClosestToParent (minhton::NodeInfo child) const
 
void checkRight (minhton::NodeInfo request_origin, uint16_t hop_count)
 
bool decideNextStep (minhton::NodeInfo request_origin, uint16_t hop_count)
 
- Public Member Functions inherited from minhton::AlgorithmInterface
 AlgorithmInterface (std::shared_ptr< AccessContainer > access)
 

Static Public Member Functions

static bool isRightmostPossibleNode (minhton::NodeInfo node)
 

Additional Inherited Members

- Protected Member Functions inherited from minhton::AlgorithmInterface
void send (const MessageVariant &msg)
 
std::shared_ptr< RoutingInformationgetRoutingInfo () const
 
NodeInfo getSelfNodeInfo () const
 
- Protected Attributes inherited from minhton::AlgorithmInterface
std::shared_ptr< AccessContaineraccess_
 

Member Function Documentation

◆ 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_originThe new node that wants to join or the existing node that wants to leave the network.
hop_countCounter 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_originThe 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_countCounter for how many times the request has been forwarded

◆ findReachableNodeClosestToParent()

minhton::NodeInfo minhton::MinhtonFindEndAlgorithm::findReachableNodeClosestToParent ( minhton::NodeInfo  child) const

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
childNode we are searching a parent (or a node close to it) for
Returns
NodeInfo Parent or a node close to it

◆ forwardRequest()

void minhton::MinhtonFindEndAlgorithm::forwardRequest ( minhton::NodeInfo  target,
minhton::NodeInfo  request_origin,
SearchProgress  search_progress,
uint16_t  hop_count 
)

Helper method to send a message for forwarding the join / leave request to another node

Parameters
targetNode to forward the join / leave request to
request_originThe node which wishes to join / leave the network
search_progressThe current step of the join / leave algorithm
hop_countCounter 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_originThe new node that wants to join or the existing node that wants to leave the network.
hop_countCounter 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
nodeNode 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_originThe new node that wants to join or the existing node that wants to leave the network.
left_sideSet to true to only search on the left side, else on the right side
hop_countCounter for how many times the request has been forwarded

The documentation for this class was generated from the following files: