This commit is contained in:
Kbz-8
2024-01-22 16:12:28 +01:00
parent be35fc2616
commit b9eada3036
2 changed files with 62 additions and 6 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 10:34:25 by maldavid #+# #+# */
/* Updated: 2024/01/22 14:41:25 by maldavid ### ########.fr */
/* Updated: 2024/01/22 16:06:15 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,6 +14,9 @@
#define __CHANNEL__
#include <string>
#include <set>
#include <unstd/shared_ptr.hpp>
#include <client.hpp>
namespace irc
{
@@ -23,10 +26,14 @@ namespace irc
Channel(const std::string& name);
inline const std::string& getName() const { return _name; }
inline void addClient(unstd::SharedPtr<Client> client) { _clients.insert(client); }
inline bool removeClient(unstd::SharedPtr<Client> client) { return _clients.erase(client); }
inline std::size_t getNumberOfClients() const { return _clients.size(); }
~Channel();
private:
std::set<unstd::SharedPtr<Client> > _clients;
const std::string _name;
};
}