#include "cloudserver.h" CloudServer::CloudServer(DispatcherClient * c, const PIString & sname) : server(c) { setName(sname); server_name = sname; } CloudServer::~CloudServer() { for (auto c :clients) { c->close(); } } PIString CloudServer::serverName() const { return server_name; } void CloudServer::addClient(DispatcherClient * c) { clients << c; } void CloudServer::removeClient(DispatcherClient * c) { clients.removeOne(c); } PIVector CloudServer::getClients() { return clients; } void CloudServer::printStatus() { piCout << " " << "Clients for" << server->address() << ":"; for (auto c: clients) { piCout << " " << c->address(); } }