ft_irc/includes/Channel.hpp

56 lines
1.3 KiB
C++

#ifndef CHANNEL_HPP
# define CHANNEL_HPP
# include <string>
# include <vector>
class Channel
{
private:
std::string _name;
std::string _topic;
std::string _key;
std::vector<int> _members;
std::vector<int> _operators;
std::vector<int> _invited;
bool _inviteOnly;
bool _topicRestricted;
size_t _userLimit;
public:
Channel(void);
explicit Channel(const std::string &name);
Channel(const Channel &other);
Channel &operator=(const Channel &other);
~Channel(void);
const std::string &getName(void) const;
const std::string &getTopic(void) const;
const std::string &getKey(void) const;
size_t getUserLimit(void) const;
bool isInviteOnly(void) const;
bool isTopicRestricted(void) const;
void setTopic(const std::string &topic);
void setKey(const std::string &key);
void setUserLimit(size_t limit);
void setInviteOnly(bool val);
void setTopicRestricted(bool val);
bool hasMember(int fd) const;
bool isOperator(int fd) const;
bool isInvited(int fd) const;
void addMember(int fd);
void removeMember(int fd);
void addOperator(int fd);
void removeOperator(int fd);
void addInvited(int fd);
void removeInvited(int fd);
const std::vector<int> &getMembers(void) const;
size_t memberCount(void) const;
};
#endif