SOLA
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
minhton::RoutingInformation Class Reference

#include <routing_information.h>

Public Member Functions

 RoutingInformation ()=default
 
 RoutingInformation (minhton::NodeInfo self_node_info, Logger logger)
 
 ~RoutingInformation ()=default
 Destructor.
 
void resetPosition (uint64_t event_id)
 
void setPosition (const minhton::LogicalNodeInfo &peer_position)
 
void setNodeStatus (NodeStatus status, uint64_t event_id)
 Setting the status of our NodeInfo object.
 
minhton::NodeInfo getSelfNodeInfo () const
 
uint16_t getFanout () const
 
std::string getString () const
 
minhton::NodeInfo getParent () const
 
void setParent (const minhton::NodeInfo &parent, uint64_t ref_event_id=0)
 
minhton::NodeInfo getChild (uint16_t child_position)
 
std::vector< minhton::NodeInfogetChildren () const
 
void setChild (const minhton::NodeInfo &child, uint16_t position, uint64_t ref_event_id=0)
 
minhton::NodeInfo getAdjacentLeft () const
 
minhton::NodeInfo getAdjacentRight () const
 
void setAdjacentLeft (const minhton::NodeInfo &adjacent_left, uint64_t ref_event_id=0)
 
void setAdjacentRight (const minhton::NodeInfo &adjacent_right, uint64_t ref_event_id=0)
 
std::vector< minhton::NodeInfogetRoutingTableNeighbors () const
 
std::vector< minhton::NodeInfogetRoutingTableNeighborChildren () const
 
std::vector< minhton::NodeInfogetInitializedRoutingTableNeighborsAndChildren () const
 
std::vector< minhton::NodeInfogetLeftRoutingTableNeighborsLeftToRight () const
 
std::vector< minhton::NodeInfogetRightRoutingTableNeighborsLeftToRight () const
 
std::vector< minhton::NodeInfogetLeftRoutingTableNeighborChildrenLeftToRight () const
 
std::vector< minhton::NodeInfogetRightRoutingTableNeighborChildrenLeftToRight () const
 
std::vector< minhton::NodeInfogetLeftRoutingTableNeighborsRightToLeft () const
 
std::vector< minhton::NodeInfogetRightRoutingTableNeighborsRightToLeft () const
 
std::vector< minhton::NodeInfogetLeftRoutingTableNeighborChildrenRightToLeft () const
 
std::vector< minhton::NodeInfogetRightRoutingTableNeighborChildrenRightToLeft () const
 
std::vector< minhton::NodeInfogetAllLeftRoutingTableNeighborsAndChildren () const
 
std::vector< minhton::NodeInfogetAllRightRoutingTableNeighborsAndChildren () const
 
std::vector< minhton::NodeInfogetRoutingTableNeighborsAndChildren () const
 
std::vector< minhton::NodeInfogetAllInitializedLeftRoutingTableNeighborsAndChildren () const
 
std::vector< minhton::NodeInfogetAllInitializedRightRoutingTableNeighborsAndChildren () const
 
std::vector< minhton::NodeInfogetAllInitializedRoutingTableNeighbors () const
 
std::vector< minhton::NodeInfogetAllInitializedRoutingTableNeighborChildren () const
 
minhton::NodeInfo getDirectLeftNeighbor () const
 
minhton::NodeInfo getDirectRightNeighbor () const
 
minhton::NodeInfo getLeftmostNeighbor () const
 
minhton::NodeInfo getRightmostNeighbor () const
 
minhton::NodeInfo getLeftmostNeighborChild () const
 
bool atLeastOneChildExists () const
 
bool atLeastOneChildIsFree () const
 
bool atLeastOneRoutingTableNeighborChildExists () const
 
bool atLeastOneRoutingTableNeighborChildIsFree () const
 
std::vector< minhton::NodeInfogetInitializedChildren () const
 
bool areChildrenFull () const
 
bool areRoutingTableNeighborsFull () const
 
bool areRoutingTableNeighborChildrenEmpty () const
 
bool areRoutingTableNeighborChildrenFull () const
 
void updateRoutingTableNeighbor (minhton::NodeInfo routing_table_neighbor, uint64_t ref_event_id=0)
 
void updateRoutingTableNeighborChild (minhton::NodeInfo routing_table_neighbor_child, uint64_t ref_event_id=0)
 
void resetChild (uint16_t position, uint64_t ref_event_id=0)
 
void resetAdjacentRight (uint64_t ref_event_id=0)
 
void resetAdjacentLeft (uint64_t ref_event_id=0)
 
bool resetRoutingTableNeighbor (const minhton::NodeInfo &routing_table_neighbor, uint64_t ref_event_id=0)
 
bool resetChildOrRoutingTableNeighborChild (const minhton::NodeInfo &routing_table_neighbor_child_or_child, uint64_t ref_event_id=0)
 
minhton::NodeInfo getLowestNode () const
 
std::vector< minhton::NodeInfogetAllUniqueKnownExistingNeighbors () const
 
std::vector< minhton::NodeInfogetAllUniqueSymmetricalExistingNeighbors () const
 
void removeNeighbor (const minhton::NodeInfo &position_to_remove, uint64_t ref_event_id=0)
 
void updateNeighbor (const minhton::NodeInfo &position_to_update, uint64_t ref_event_id=0)
 
bool resetRoutingTableNeighborChild (const minhton::NodeInfo &routing_table_neighbor_child, uint64_t ref_event_id=0)
 
minhton::NodeInfo getNodeInfoByPosition (uint32_t level, uint32_t number)
 
void addNeighborChangeSubscription (const std::function< void(const minhton::NodeInfo &new_node, NeighborRelationship relationship, const minhton::NodeInfo &old_node, uint16_t position)> &callback)
 
void addNodeInfoChangeSubscription (const std::function< void(const minhton::NodeInfo &previous_node_info, const minhton::NodeInfo &new_node_info)> &callback)
 
bool areWeDSN () const
 
bool areWeTempDSN () const
 
NodeInfo getCoveringDSNOrTempDSN ()
 
bool nextDSNExists ()
 
NodeInfo getNextDSN ()
 

Static Public Member Functions

static std::vector< minhton::NodeInfocalcRoutingTableNeighborParents (const minhton::NodeInfo &node)
 
static std::vector< minhton::NodeInfocombiningNodeVectorsWithoutDuplicate (std::vector< minhton::NodeInfo > v1, const std::vector< minhton::NodeInfo > &v2)
 
static std::vector< minhton::NodeInforemoveRoutingTableNeighborChildrenFromVector (minhton::NodeInfo node, std::vector< minhton::NodeInfo > neighbors)
 

Detailed Description

The RoutingInformation contain all information relevant to the routing in the network. This includes information about ourselves and about our neighbors (parent, children, right and left adjacents, and right and left routing tables).

Constructor & Destructor Documentation

◆ RoutingInformation() [1/2]

minhton::RoutingInformation::RoutingInformation ( )
default

Constructor for invalid, non-existent RoutingInformation. To be used only for initialization purposes.

Typical usage:

this->routing_info_ = RoutingInformation();

◆ RoutingInformation() [2/2]

minhton::RoutingInformation::RoutingInformation ( minhton::NodeInfo  self_node_info,
Logger  logger 
)

Constructor for RoutingInformation. To be re-initialized as soon as the own position in the tree is known.

Typical usage:

this->routing_info_ = RoutingInformation(&node);
Parameters
self_node_inforeference to the own node information
loggerreference to the logger instance

Member Function Documentation

◆ areChildrenFull()

bool minhton::RoutingInformation::areChildrenFull ( ) const
Returns
true if every child is initialized / existent, false if at least one child is not initialized

◆ areRoutingTableNeighborChildrenEmpty()

bool minhton::RoutingInformation::areRoutingTableNeighborChildrenEmpty ( ) const
Returns
true, if no routing table neighbor child is initialized

◆ areRoutingTableNeighborChildrenFull()

bool minhton::RoutingInformation::areRoutingTableNeighborChildrenFull ( ) const
Returns
true, if every node entry in the left and right routing tables children is initialized

◆ areRoutingTableNeighborsFull()

bool minhton::RoutingInformation::areRoutingTableNeighborsFull ( ) const
Returns
true, if every node entry in the left and right routing tables is initialized

◆ atLeastOneChildExists()

bool minhton::RoutingInformation::atLeastOneChildExists ( ) const
Returns
true if at least one position in children is initialized

◆ atLeastOneChildIsFree()

bool minhton::RoutingInformation::atLeastOneChildIsFree ( ) const
Returns
true if at least one position in children is uninitialized

◆ atLeastOneRoutingTableNeighborChildExists()

bool minhton::RoutingInformation::atLeastOneRoutingTableNeighborChildExists ( ) const
Returns
true if at least one position in the routing table children is initialized

◆ atLeastOneRoutingTableNeighborChildIsFree()

bool minhton::RoutingInformation::atLeastOneRoutingTableNeighborChildIsFree ( ) const
Returns
true if at least one position in the routing table children is uninitialized

◆ calcRoutingTableNeighborParents()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::calcRoutingTableNeighborParents ( const minhton::NodeInfo node)
static

Helper method to calculate all routing table neighbor parents (those neighbors who know one node as a routing table neighbor child, but the node does not always know those neighbors (asymmetrical)).

Creates a vector of all of those neighbors, but all PhysicalNodeInfos are uninitialized.

Typical usage:

auto neighbors = this->routing_info_.calcRoutingTableNeighborParents();
Parameters
nodeof which to get the parents
Returns
vector of uninitialized NodeInfos

◆ combiningNodeVectorsWithoutDuplicate()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::combiningNodeVectorsWithoutDuplicate ( std::vector< minhton::NodeInfo v1,
const std::vector< minhton::NodeInfo > &  v2 
)
static

Helper method to easily add vectors of NodeInfo objects together. If there are dublicates, only one object will be added. And if one of those duplicates has PhysicalNodeInfo initialized, the one with initialized PhysicalNodeInfo will be chosen.

Typical usage:

auto added = this->routing_info_.combiningNodeVectorsWithoutDuplicate(v1, v2);
Parameters
v1first vector of NodeInfo objects
v2second vector of NodeInfo objects
Returns
vector of unique combined NodeInfo objects

If there is a duplicate, we will choose the node where PhysicalNodeInfo is initialized

◆ getAdjacentLeft()

minhton::NodeInfo minhton::RoutingInformation::getAdjacentLeft ( ) const
Returns
the adjacent left neighbor of this node, uninitialized if we dont have a left adjacent

◆ getAdjacentRight()

minhton::NodeInfo minhton::RoutingInformation::getAdjacentRight ( ) const
Returns
the adjacent right neighbor of this node, uninitialized if we dont have a right adjacent

◆ getAllInitializedLeftRoutingTableNeighborsAndChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllInitializedLeftRoutingTableNeighborsAndChildren ( ) const
Returns
a vector of all initialized routing table neighbors and routing table neighbor children from the left routing table

◆ getAllInitializedRightRoutingTableNeighborsAndChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllInitializedRightRoutingTableNeighborsAndChildren ( ) const
Returns
a vector of all initialized routing table neighbors and routing table neighbor children from the right routing table

◆ getAllInitializedRoutingTableNeighborChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllInitializedRoutingTableNeighborChildren ( ) const
Returns
a vector of all initialized routing table neighbor children from the left and right routing table

◆ getAllInitializedRoutingTableNeighbors()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllInitializedRoutingTableNeighbors ( ) const
Returns
a vector of all initialized routing table neighbors from the left and right routing table

◆ getAllLeftRoutingTableNeighborsAndChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllLeftRoutingTableNeighborsAndChildren ( ) const
Returns
a vector of all routing table neighbors and routing table neighbor children from the left routing table

◆ getAllRightRoutingTableNeighborsAndChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllRightRoutingTableNeighborsAndChildren ( ) const
Returns
a vector of all routing table neighbors and routing table neighbor children from the right routing table

◆ getAllUniqueKnownExistingNeighbors()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllUniqueKnownExistingNeighbors ( ) const

Returns a vector of every neighbor that we know which exists. Every neighbor will occur only once. If a neighbor is not initialized, it will not be added in the vector.

This will be used in the replacement process to tell the replacing node about every neighbor of the leaving node.

Typical usage:

auto neighbors = this->routing_info_.getAllUniqueKnownExistingNeighbors();
Returns
a vector of every existing/initialized neighbor we know

◆ getAllUniqueSymmetricalExistingNeighbors()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getAllUniqueSymmetricalExistingNeighbors ( ) const

Returns a vector of every neighbor that we know which exists. Additionally the neighbor needs to be symmetrical. This means that if we know neigbhor A, neighbor A also needs to know us. Every neighbor will occur only once. If a neighbor is not initialized, it will not be added in the vector.

This will be used in the leaving process when sending node departure messages to address every neighbor which needs this information.

Typical usage:

auto neighbors = this->routing_info_.getAllUniqueKnownExistingNeighbors();
Returns
a vector of every existing/initialized symmetrical neighbor we know

◆ getChild()

minhton::NodeInfo minhton::RoutingInformation::getChild ( uint16_t  child_position)
Parameters
child_positionposition of the node, 0 <= child_position < fanout
Returns
the child at the given position

◆ getChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getChildren ( ) const
Returns
a vector of all children

◆ getDirectLeftNeighbor()

minhton::NodeInfo minhton::RoutingInformation::getDirectLeftNeighbor ( ) const
Returns
the node which is positioned directly to the left of the current node, e.g., if 3:5 calls this method, it returns 3:4. If there are no left neighbors, the method returns a default NodeInfo.

◆ getDirectRightNeighbor()

minhton::NodeInfo minhton::RoutingInformation::getDirectRightNeighbor ( ) const
Returns
the node which is positioned directly to the right of the current node, e.g., if 3:5 calls this method, it returns 3:6. If there are no right neighbors, the method returns a default NodeInfo.

◆ getFanout()

uint16_t minhton::RoutingInformation::getFanout ( ) const
Returns
the Fanout of the Network by using the information of our NodeInfo object

◆ getInitializedChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getInitializedChildren ( ) const
Returns
a vector of all initialized children

◆ getInitializedRoutingTableNeighborsAndChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getInitializedRoutingTableNeighborsAndChildren ( ) const
Returns
vector of all routing table neighbors and routing table neighbor children, left and right

◆ getLeftmostNeighbor()

minhton::NodeInfo minhton::RoutingInformation::getLeftmostNeighbor ( ) const
Returns
the neighbor node which is the furthest away to the left, i.e., has the number 0 or is the closest to the number 0. If there are no left neighbors, the method returns a default NodeInfo.

◆ getLeftmostNeighborChild()

minhton::NodeInfo minhton::RoutingInformation::getLeftmostNeighborChild ( ) const
Returns
the neighbor node child which is the furthest away to the left, i.e., has the number 0 or is the closest to the number 0. If there are no left neighbor children, the method returns a default NodeInfo.

◆ getLeftRoutingTableNeighborChildrenLeftToRight()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getLeftRoutingTableNeighborChildrenLeftToRight ( ) const
Returns
vector of NodeInfo object of all left routing table neighbor children (including uninitialized ones), ordered from left to right.

◆ getLeftRoutingTableNeighborChildrenRightToLeft()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getLeftRoutingTableNeighborChildrenRightToLeft ( ) const
Returns
vector of NodeInfo object of all left routing table neighbor children (including uninitialized ones), ordered from right to left.

◆ getLeftRoutingTableNeighborsLeftToRight()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getLeftRoutingTableNeighborsLeftToRight ( ) const
Returns
vector of NodeInfo object of all left routing table neighbors (including uninitialized ones), ordered from left to right.

◆ getLeftRoutingTableNeighborsRightToLeft()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getLeftRoutingTableNeighborsRightToLeft ( ) const
Returns
vector of NodeInfo object of all left routing table neighbors (including uninitialized ones), ordered from right to left.

◆ getLowestNode()

minhton::NodeInfo minhton::RoutingInformation::getLowestNode ( ) const

Searches in all of our routing information for the lowest node we know, but only in nodes which are on the same level as us or lower than us in the tree (higher level number).

If such a node does not exist, an uninitialized node is returned.

Typical usage:

this->routing_info_.getLowestNode();
Returns
NodeInfo object of the lowest prio node, or uninitialized if we don't know one

◆ getNodeInfoByPosition()

minhton::NodeInfo minhton::RoutingInformation::getNodeInfoByPosition ( uint32_t  level,
uint32_t  number 
)

Helper method for various procedures to find a NodeInfo object in the Routing Information with the given level and number. If such a node does not exist an uninitialized NodeInfo object is being returned.

Parameters
levellevel of the required node
numbernumber of the required node
Returns
required NodeInfo object or uninitialized

◆ getParent()

minhton::NodeInfo minhton::RoutingInformation::getParent ( ) const
Returns
the parent node

◆ getRightmostNeighbor()

minhton::NodeInfo minhton::RoutingInformation::getRightmostNeighbor ( ) const
Returns
the neighbor node which is the furthest away to the right, i.e., has the number m^l - 1 or is the closest to the number m^l - 1. If there are no right neighbors, the method returns a default NodeInfo.

◆ getRightRoutingTableNeighborChildrenLeftToRight()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRightRoutingTableNeighborChildrenLeftToRight ( ) const
Returns
vector of NodeInfo object of all right routing table neighbor children (including uninitialized ones), ordered from left to right.

◆ getRightRoutingTableNeighborChildrenRightToLeft()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRightRoutingTableNeighborChildrenRightToLeft ( ) const
Returns
vector of NodeInfo object of all right routing table neighbor children (including uninitialized ones), ordered from right ot left.

◆ getRightRoutingTableNeighborsLeftToRight()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRightRoutingTableNeighborsLeftToRight ( ) const
Returns
vector of NodeInfo object of all left routing table neighbors (including uninitialized ones), ordered from right to left.

◆ getRightRoutingTableNeighborsRightToLeft()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRightRoutingTableNeighborsRightToLeft ( ) const
Returns
vector of NodeInfo object of all right routing table neighbors (including uninitialized ones), ordered from right to left.

◆ getRoutingTableNeighborChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRoutingTableNeighborChildren ( ) const
Returns
vector of all routing table neighbor children, left and right, initialized and uninitialized

◆ getRoutingTableNeighbors()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRoutingTableNeighbors ( ) const
Returns
vector of all routing table neighbors, left and right, initialized and uninitialized

◆ getRoutingTableNeighborsAndChildren()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::getRoutingTableNeighborsAndChildren ( ) const
Returns
a vector of all routing table neighbor and their children from the left and right routing table

◆ getSelfNodeInfo()

minhton::NodeInfo minhton::RoutingInformation::getSelfNodeInfo ( ) const
Returns
our NodeInfo object

◆ getString()

std::string minhton::RoutingInformation::getString ( ) const
Returns
a string for simple debugging

◆ removeNeighbor()

void minhton::RoutingInformation::removeNeighbor ( const minhton::NodeInfo position_to_remove,
uint64_t  ref_event_id = 0 
)

Uninitializing the given position to remove. We need to have the LogicalNodeInfo position set somewhere.

When we remove an adjacent, we reset the full NodeInfo. When we remove a non adjacent, we reset only PhysicalNodeInfo. If a node has multiple roles (e.g. child and adjacent), both will be reset appropriately.

We cannot remove the parent, because that would not make any sense.

Typical usage:

this->routing_info_.removeNeighbor(node);
Parameters
position_to_removeNodeInfo with the position to remove
ref_event_idID of the event which is the reason for this change

◆ removeRoutingTableNeighborChildrenFromVector()

std::vector< minhton::NodeInfo > minhton::RoutingInformation::removeRoutingTableNeighborChildrenFromVector ( minhton::NodeInfo  node,
std::vector< minhton::NodeInfo neighbors 
)
static

Helper method to remove routing table neighbor children from a given nodes perspective from a given vector of nodes.

Parameters
nodethe node from whichs perspective we want to remove the routing table neighbor children
neighborsvector of known neighbors from which the routing table neighbor children need to be removed
Returns
vector of nodes without the routing table neighbor children

TODO unittests

◆ resetAdjacentLeft()

void minhton::RoutingInformation::resetAdjacentLeft ( uint64_t  ref_event_id = 0)

Resetting information about our adjacent left. We will reset PhysicalNodeInfo and LogicalNodeInfo.

RoutingInformation needs to be initialized properly beforehand.

Typical usage:

this->routing_info.resetAdjacentLeft();
Parameters
ref_event_idID of the event which is the reason for this change

◆ resetAdjacentRight()

void minhton::RoutingInformation::resetAdjacentRight ( uint64_t  ref_event_id = 0)

Resetting information about our adjacent right. We will reset PhysicalNodeInfo and LogicalNodeInfo.

RoutingInformation needs to be initialized properly beforehand.

Typical usage:

this->routing_info.resetAdjacentRight();
Parameters
ref_event_idID of the event which is the reason for this change

◆ resetChild()

void minhton::RoutingInformation::resetChild ( uint16_t  position,
uint64_t  ref_event_id = 0 
)

Resetting information about our child at the given position. We will only reset the PhysicalNodeInfo. LogicalNodeInfo always stays the same.

RoutingInformation needs to be initialized properly beforehand.

Typical usage:

this->routing_info.resetChild(0);
Parameters
positionposition of the new child within the parent
ref_event_idID of the event which is the reason for this change

◆ resetChildOrRoutingTableNeighborChild()

bool minhton::RoutingInformation::resetChildOrRoutingTableNeighborChild ( const minhton::NodeInfo routing_table_neighbor_child_or_child,
uint64_t  ref_event_id = 0 
)

Resetting information about a routing table neighbor child or child. We do not need to know whether its in the left or right routing table or if its a child. Only LogicalNodeInfo is relevant, we ignore PhysicalNodeInfo. We will only reset the PhysicalNodeInfo. LogicalNodeInfo always stays the same.

RoutingInformation needs to be initialized properly beforehand.

Typical usage:

this->routing_info.resetChildOrRoutingTableNeighborChild(node);
Parameters
routing_table_neighbor_child_or_childwith the LogicalNodeInfo position which we want to reset
ref_event_idID of the event which is the reason for this change

◆ resetRoutingTableNeighbor()

bool minhton::RoutingInformation::resetRoutingTableNeighbor ( const minhton::NodeInfo routing_table_neighbor,
uint64_t  ref_event_id = 0 
)

Resetting information about a routing table neighbor. We do not need to know whether its in the left or right routing table. Only LogicalNodeInfo is relevant, we ignore PhysicalNodeInfo. We will only reset the PhysicalNodeInfo. LogicalNodeInfo always stays the same.

RoutingInformation needs to be initialized properly beforehand.

Typical usage:

this->routing_info.resetRoutingTableNeighbor(rt_neighbor);
Parameters
routing_table_neighborwith the LogicalNodeInfo position which we want to reset
ref_event_idID of the event which is the reason for this change

◆ resetRoutingTableNeighborChild()

bool minhton::RoutingInformation::resetRoutingTableNeighborChild ( const minhton::NodeInfo routing_table_neighbor_child,
uint64_t  ref_event_id = 0 
)

Removing a routing table neighbor child by its position. This entails setting the node info object at the given position in the routing table neighbor children vector to uninitialized

Parameters
routing_table_neighbor_childposition that we want to remove
ref_event_idID of the event which is the reason for this change

◆ setAdjacentLeft()

void minhton::RoutingInformation::setAdjacentLeft ( const minhton::NodeInfo adjacent_left,
uint64_t  ref_event_id = 0 
)

Sets the adjacent left routing table neighbor.

Typical usage:

this->routing_info.setAdjacentLeft(new_adjacent_left);
Parameters
adjacent_leftnew information about the adjacent left node, and needs to be initialized
ref_event_idID of the event which is the reason for this change

◆ setAdjacentRight()

void minhton::RoutingInformation::setAdjacentRight ( const minhton::NodeInfo adjacent_right,
uint64_t  ref_event_id = 0 
)

Sets the adjacent right routing table neighbor.

Typical usage:

this->routing_info.setAdjacentLeft(new_adjacent_right);
Parameters
adjacent_rightnew information about the adjacent right node, and needs to be initialized
ref_event_idID of the event which is the reason for this change

◆ setChild()

void minhton::RoutingInformation::setChild ( const minhton::NodeInfo child,
uint16_t  position,
uint64_t  ref_event_id = 0 
)

Setting information about one new or updated child. For this we also need the position of the child.

E.g. with fanout 2 a parent has the positions 0 and 1 for the children. At 0 is the left-most child and 1 the right-most child of this parent.

We are also checking here if the logical position of the child is correct.

RoutingInformation needs to be initialized properly beforehand.

Typical usage:

this->routing_info.setChild(new_child, 1);
Parameters
childreference to NodeInfo of the new child, and needs to be initialized
positionposition of the new child within the parent
ref_event_idID of the event which is the reason for this change

◆ setNodeStatus()

void minhton::RoutingInformation::setNodeStatus ( NodeStatus  status,
uint64_t  event_id 
)

Setting the status of our NodeInfo object.

Parameters
statusNodeStatus that the node will be set to
event_idEventId which triggered this change (used only for logging)

◆ setParent()

void minhton::RoutingInformation::setParent ( const minhton::NodeInfo parent,
uint64_t  ref_event_id = 0 
)

Sets the parent node. The LogicalNodeInfo need to have set the correct position. RoutingInformation needs to be initialized properly beforehand.

We cannot set a parent if we are root.

Typical usage:

this->routing_info.setParent(new_parent);
Parameters
parentnew information about the parent node with the correct position, and needs to be initialized
ref_event_idID of the event which is the reason for this change

◆ setPosition()

void minhton::RoutingInformation::setPosition ( const minhton::LogicalNodeInfo peer_position)

Calling this method if our position has changed. It resets all neighbors, but we keep our PhysicalNodeInfo!

Parameters
peer_positioninformation about our new position and fanout has to be set

◆ updateNeighbor()

void minhton::RoutingInformation::updateNeighbor ( const minhton::NodeInfo position_to_update,
uint64_t  ref_event_id = 0 
)

Setting the new PhysicalNodeInfo at the appropriate position. We need to have the LogicalNodeInfo position set somewhere.

If a node has multiple roles (e.g. child and adjacent), both will be updated.

Typical usage:

this->routing_info_.updateNeighbor(node);
Parameters
position_to_updateNodeInfo with the position to update
ref_event_idID of the event which is the reason for this change

◆ updateRoutingTableNeighbor()

void minhton::RoutingInformation::updateRoutingTableNeighbor ( minhton::NodeInfo  routing_table_neighbor,
uint64_t  ref_event_id = 0 
)

Updates a routing table neighbor entry with the given PhysicalNodeInfo information.

Is being used when we receive a new information about our routing table neighbors.

Typical usage:

this->routing_info_.updateRoutingTableNeighbor(updated_routing_table_neighbor);
Parameters
routing_table_neighborthe NodeInfo with new PhysicalNodeInfo, and needs to be initialized
ref_event_idID of the event which is the reason for this change

◆ updateRoutingTableNeighborChild()

void minhton::RoutingInformation::updateRoutingTableNeighborChild ( minhton::NodeInfo  routing_table_neighbor_child,
uint64_t  ref_event_id = 0 
)

Updates a routing table neighbor child entry with the given PhysicalNodeInfo information.

Is being used when we receive a new information about our routing table neighbors children.

Typical usage:

this->routing_info_.updateRoutingTableNeighborChild(updated_routing_table_neighbor_child);
Parameters
routing_table_neighbor_childthe NodeInfo with new PhysicalNodeInfo, and needs to be initialized
ref_event_idID of the event which is the reason for this change

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