-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserManager.h
More file actions
37 lines (27 loc) · 996 Bytes
/
UserManager.h
File metadata and controls
37 lines (27 loc) · 996 Bytes
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
// UserManager.h
#ifndef USERMANAGER_H
#define USERMANAGER_H
#include <vector>
#include "BaseUser.h"
#include "University.h"
#include <string>
#include <iostream>
#include <unordered_map>
// Forward declaration
class RegisteredUser;
class UserManager {
private:
std::unordered_map<std::string, BaseUser*> users;
std::unordered_map<std::string, std::vector<University>> favoriteLists; // Store favorite universities for each user
public:
UserManager();
~UserManager();
void addUser(BaseUser* user);
BaseUser* findUser(const std::string& username) const;
void modifyPassword(BaseUser* user, const std::string& newPassword);
void deleteFavoriteUniversity(RegisteredUser* user, const University& university);
std::vector<BaseUser*> getAllUsers(); // Retrieve all users from the user manager
void addFavoriteUniversity(RegisteredUser* user, const University& university);
std::vector<University> getFavoriteUniversities(BaseUser* user);
};
#endif