-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathChannel.hpp
63 lines (51 loc) · 1.39 KB
/
Channel.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <string>
#include <vector>
#include <set>
#include "User.hpp"
class User;
class Channel
{
private:
std::string _name;
std::string _topic;
std::set<User *> _members;
std::set<User *> _operators;
std::set<char> _modes;
std::set<User *> _invited_users; // added for tracking invited users
size_t _userlimit; // for l mode
std::string _key; // for k mode
public:
Channel();
Channel(const std::string &name);
~Channel();
// getters
const std::string& get_name() const;
const std::string& get_topic() const;
const std::set<User*> &get_members() const;
const std::set<User*> &get_operators() const;
const std::set<User *> &get_invitees() const;
const std::string &get_key() const;
size_t get_user_limit() const;
// setters
void add_member(User* user);
void remove_member(User* user);
bool is_member(User* user) const;
void set_topic(const std::string &topic);
// ops
void add_operator(User* user);
void remove_operator(User* user);
bool is_operator(User* user) const;
// modes
void set_mode(char mode, bool value);
bool get_mode(char mode) const;
std::string str_modes() const;
void set_key(const std::string &key);
void remove_key();
void set_user_limit(size_t limit);
void remove_user_limit();
// invites
void add_invite(User* user);
bool is_invited(User* user) const;
void remove_invite(User* user);
};