/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* channel.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/21 10:34:25 by maldavid #+# #+# */ /* Updated: 2024/01/22 18:14:50 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef __CHANNEL__ #define __CHANNEL__ #include #include #include #include namespace irc { class Channel { public: Channel(const std::string& name); inline const std::string& getName() const { return _name; } inline const std::string& getPassword() const { return _password; } inline void addClient(unstd::SharedPtr client) { _clients.insert(client); } inline bool removeClient(unstd::SharedPtr client) { return _clients.erase(client); } inline std::size_t getNumberOfClients() const { return _clients.size(); } inline void addOperator(unstd::SharedPtr op) { _operators.insert(op); } inline bool removeOperator(unstd::SharedPtr op) { return _operators.erase(op); } inline bool isInviteOnly() const { return _invite_only; } ~Channel(); private: std::set > _clients; std::set > _operators; const std::string _name; std::string _password; bool _invite_only; }; } #endif