#include <node_info.h>
|
| NodeInfo (uint32_t level, uint32_t number, uint16_t fanout) |
|
| NodeInfo (uint32_t level, uint32_t number, uint16_t fanout, const std::string &address, uint16_t port) |
|
minhton::LogicalNodeInfo | getLogicalNodeInfo () const |
|
void | setLogicalNodeInfo (const minhton::LogicalNodeInfo &l_node_info) |
|
minhton::PhysicalNodeInfo | getPhysicalNodeInfo () const |
|
void | setPhysicalNodeInfo (const minhton::PhysicalNodeInfo &p_node_info) |
|
std::string | getString () const |
|
bool | isInitialized () const |
|
void | setPosition (uint32_t level, uint32_t number) |
| Helper method, which sets the position for the internal LogicalNodeInfo object.
|
|
void | setPosition (LogicalNodeInfo other) |
| Helper method, which sets the position for the internal LogicalNodeInfo object.
|
|
void | setFanout (uint16_t fanout) |
| Helper method, which sets the fanout for the internal LogicalNodeInfo object.
|
|
uint32_t | getLevel () const |
|
uint32_t | getNumber () const |
|
uint16_t | getFanout () const |
|
NodeStatus | getStatus () const |
|
void | setStatus (NodeStatus status) |
| sets the status of the node
|
|
bool | isValidPeer () const |
|
void | setPort (uint16_t port) |
| Helper method, which sets the port for PhysicalNodeInfo.
|
|
void | setAddress (const std::string &address) |
| Helper method, which sets the address for PhysicalNodeInfo.
|
|
uint16_t | getPort () const |
|
std::string | getAddress () const |
|
uint32_t | getAddressValue () const |
|
| SERIALIZE (l_node_info_, p_node_info_) |
|
A NodeInfo is based on a LogicalNodeInfo and PhysicalNodeInfo. These two classes build the core of a node in our peer2peer network
◆ NodeInfo() [1/2]
minhton::NodeInfo::NodeInfo |
( |
uint32_t |
level, |
|
|
uint32_t |
number, |
|
|
uint16_t |
fanout |
|
) |
| |
Constructing an initialized NodeInfo object with the given information.
- Parameters
-
level | valid level of a MINHTON m-ary tree |
number | valid number of a MINHTON m-ary tree |
fanout | valid port of a MINHTON m-ary tree |
◆ NodeInfo() [2/2]
minhton::NodeInfo::NodeInfo |
( |
uint32_t |
level, |
|
|
uint32_t |
number, |
|
|
uint16_t |
fanout, |
|
|
const std::string & |
address, |
|
|
uint16_t |
port |
|
) |
| |
Constructing an initialized NodeInfo object with the given information.
- Parameters
-
level | valid level of a MINHTON m-ary tree |
number | valid number of a MINHTON m-ary tree |
fanout | valid port of a MINHTON m-ary tree |
address | valid IPv4 address string |
uint16_t | valid network port |
◆ getAddress()
std::string minhton::NodeInfo::getAddress |
( |
| ) |
const |
◆ getAddressValue()
uint32_t minhton::NodeInfo::getAddressValue |
( |
| ) |
const |
◆ getFanout()
uint16_t minhton::NodeInfo::getFanout |
( |
| ) |
const |
◆ getLevel()
uint32_t minhton::NodeInfo::getLevel |
( |
| ) |
const |
◆ getLogicalNodeInfo()
- Returns
- A LogicalNodeInfo, which represents the position (Level/Number) of a peer within the p2p network
◆ getNumber()
uint32_t minhton::NodeInfo::getNumber |
( |
| ) |
const |
◆ getPhysicalNodeInfo()
- Returns
- A PhysicalNodeInfo, which represents the remote host, by having a IPv4/IPv6 IP address and a port
◆ getPort()
uint16_t minhton::NodeInfo::getPort |
( |
| ) |
const |
◆ getStatus()
NodeStatus minhton::NodeInfo::getStatus |
( |
| ) |
const |
- Returns
- the status of the node
◆ isInitialized()
bool minhton::NodeInfo::isInitialized |
( |
| ) |
const |
Returns the current state of the node if the node is properly initialized. If a node is initialized, it exists. This method depends on initialized state of the LogicalNodeInfo and PhysicalNodeInfo
Typical usage:
bool isInitialized() const
Definition node_info.cpp:37
- Returns
- true if the node is proper initialized, otherwise false
◆ isValidPeer()
bool minhton::NodeInfo::isValidPeer |
( |
| ) |
const |
- Returns
- true if the node consists of an actual known peer, otherwise false
◆ setLogicalNodeInfo()
◆ setPhysicalNodeInfo()
The documentation for this class was generated from the following files:
- minhton/include/minhton/core/node_info.h
- minhton/src/core/node_info.cpp