You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
550 B
27 lines
550 B
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace sk {
|
|
class host {
|
|
std::string ip;
|
|
|
|
unsigned int connections;
|
|
unsigned int connectionsMax;
|
|
|
|
public:
|
|
host(const std::string &ip, unsigned int connectionsMax);
|
|
void addConnection();
|
|
|
|
const std::string &getIp() const;
|
|
|
|
unsigned int getNbConnections() const;
|
|
unsigned int getNbConnectionsMax() const;
|
|
|
|
bool operator<(const host &other) const {
|
|
return (connectionsMax - connections) <
|
|
other.getNbConnectionsMax() - other.getNbConnections();
|
|
}
|
|
};
|
|
}
|