Skip to content

Commit

Permalink
refactor: remove unused id handling from Address class
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterLaplace committed Nov 11, 2024
1 parent 6375b59 commit 4fef4cf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
4 changes: 1 addition & 3 deletions Flakkari/Network/Address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ constexpr const char *Address::socketTypeToString(SocketType socket_type)
Address::operator std::string() const
{
return std::string(toString().value_or("null") + " (" + socketTypeToString(_socket_type) + ", " +
ipTypeToString(_ip_type) + ", " + std::to_string(getId()) + ")");
ipTypeToString(_ip_type) + ")");
}

std::ostream &operator<<(std::ostream &os, const Address &addr)
Expand All @@ -199,8 +199,6 @@ std::ostream &operator<<(std::ostream &os, const Address &addr)
os << Address::socketTypeToString(addr.getSocketType());
os << ", ";
os << Address::ipTypeToString(addr.getIpType());
os << ", ";
os << addr.getId();
os << ")";
return os;
}
Expand Down
15 changes: 0 additions & 15 deletions Flakkari/Network/Address.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,6 @@ class Address {
*/
[[nodiscard]] IpType getIpType() const { return _ip_type; }

/**
* @brief Get the Id object
*
* @return id_t Id
*/
[[nodiscard]] id_t getId() const { return _id; }

/**
* @brief Set the Id object
*
* @param id Id
*/
void setId(id_t id) { _id = id; }

/**
* @brief Convert Address to string (std::string)
*
Expand All @@ -176,7 +162,6 @@ class Address {
std::shared_ptr<addrinfo> _addrInfo = nullptr;
SocketType _socket_type = SocketType::None;
IpType _ip_type = IpType::None;
id_t _id = -1;
};

/**
Expand Down

0 comments on commit 4fef4cf

Please sign in to comment.