7#ifndef MINHTON_CORE_NODE_INFO_H_
8#define MINHTON_CORE_NODE_INFO_H_
12#include "minhton/core/logical_node_info.h"
13#include "minhton/core/physical_node_info.h"
14#include "solanet/serializer/serialize.h"
18enum class NodeStatus : uint8_t { kUninit = 0, kRunning = 1, kLeft = 2, kFailed = 3 };
35 NodeInfo(uint32_t level, uint32_t number, uint16_t fanout);
46 NodeInfo(uint32_t level, uint32_t number, uint16_t fanout,
const std::string &address,
71 std::string getString()
const;
139 SERIALIZE(l_node_info_, p_node_info_);
145 NodeStatus status_{NodeStatus::kUninit};
156 return peer_hash ^ network_hash;
Definition logical_node_info.h:23
Definition node_info.h:24
uint16_t getPort() const
Definition node_info.cpp:59
uint32_t getAddressValue() const
Definition node_info.cpp:63
uint32_t getLevel() const
Definition node_info.cpp:49
uint32_t getNumber() const
Definition node_info.cpp:51
void setPhysicalNodeInfo(const minhton::PhysicalNodeInfo &p_node_info)
Definition node_info.cpp:33
minhton::PhysicalNodeInfo getPhysicalNodeInfo() const
Definition node_info.cpp:32
void setFanout(uint16_t fanout)
Helper method, which sets the fanout for the internal LogicalNodeInfo object.
Definition node_info.cpp:47
std::string getAddress() const
Definition node_info.cpp:61
NodeStatus getStatus() const
Definition node_info.cpp:65
void setLogicalNodeInfo(const minhton::LogicalNodeInfo &l_node_info)
Definition node_info.cpp:28
void setAddress(const std::string &address)
Helper method, which sets the address for PhysicalNodeInfo.
Definition node_info.cpp:57
bool isValidPeer() const
Definition node_info.cpp:68
void setStatus(NodeStatus status)
sets the status of the node
Definition node_info.cpp:66
void setPosition(uint32_t level, uint32_t number)
Helper method, which sets the position for the internal LogicalNodeInfo object.
Definition node_info.cpp:41
minhton::LogicalNodeInfo getLogicalNodeInfo() const
Definition node_info.cpp:26
uint16_t getFanout() const
Definition node_info.cpp:53
bool isInitialized() const
Definition node_info.cpp:37
void setPort(uint16_t port)
Helper method, which sets the port for PhysicalNodeInfo.
Definition node_info.cpp:55
Definition physical_node_info.h:23
Definition minhton_watchdog_ns3.cpp:24
Definition logical_node_info.h:233
Definition node_info.h:148
Definition physical_node_info.h:110