feat(channel): starting the channel class

This commit is contained in:
Raphael 2025-05-20 22:55:43 +02:00
parent cb5f92db0c
commit 12cc225603
3 changed files with 206 additions and 2 deletions

43
include/channel.hpp Normal file
View file

@ -0,0 +1,43 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* channel.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/20 22:18:17 by rparodi #+# #+# */
/* Updated: 2025/05/20 22:53:57 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#pragma once
#include "user.hpp"
#include <string>
#include <list>
class Channel {
private:
std::string _name;
std::string _password;
std::string _topic;
User *_owner;
std::list<User *> _operators;
std::list<User *> _users;
public:
// getters
std::string getName() const;
std::string getTopic() const;
User *getOwner() const;
std::list<User *> getOperators() const;
std::list<User *> getUsers() const;
bool isOperator(User *user) const;
bool isUserInChannel(User *user) const;
// setters
void setTopic(const std::string &topic);
void addOperator(User *user);
void addUser(User *user);
void removeUser(User *user);
void removeOperator(User *user);
};