/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* channel.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: sben-tay +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/20 22:18:17 by rparodi #+# #+# */ /* Updated: 2025/06/17 23:38:49 by sben-tay ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include "user.hpp" #include #include class Channel { public: Channel(const std::string &name, User *owner, size_t maxUsers, bool needInvite); // getters std::string getName() const; std::string getTopic() const; size_t getMaxUsers() const; User *getOwner() const; std::list getOperators() const; std::list getUsers() const; std::list getInvited() const; std::string getPassword() const; bool isOperator(User *user) const; bool isUserInChannel(User *user) const; bool getNeedInvite() const; // setters void setMaxUser(size_t args); void setNeedInvite(bool toSet); void setTopic(const std::string &topic); void setPassword(const std::string &newPass); void addOperator(User *user); void addUser(User *user); void removeUser(User *user); void removeOperator(User *user); // utility functions void sendAllClientInAChannel(const std::string toSend); private: std::string _name; User *_owner; std::string _password; size_t _maxUsers; bool _needInvite; std::string _topic; std::list _operators; std::list _users; std::list _invited; };