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.
28 lines
619 B
28 lines
619 B
#pragma once
|
|
|
|
#include "runner.hpp"
|
|
#include <queue>
|
|
#include <string>
|
|
|
|
namespace sk {
|
|
class host {
|
|
std::string ip;
|
|
|
|
unsigned int connections;
|
|
unsigned int connectionsMax;
|
|
|
|
std::queue<sk::runner *> runners;
|
|
|
|
public:
|
|
host(const std::string &ip, unsigned int connectionsMax);
|
|
void addConnection(sk::runner &runner);
|
|
|
|
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(); }
|
|
};
|
|
}
|