-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUserManager.h
More file actions
34 lines (23 loc) · 834 Bytes
/
UserManager.h
File metadata and controls
34 lines (23 loc) · 834 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
#ifndef USER_MANAGER_H_
#define USER_MANAGER_H_
#include "Utils.h"
#include "UserInfo.h"
#include "DataStructure/List.h"
#include "DataStructure/BPlusTree.h"
#include "DataStructure/CachedBPlusTree.h"
namespace trainsys {
class UserManager {
private:
CachedBPlusTree<UserID, UserInfo> userInfoTable;
public:
UserManager(const char *filename);
~UserManager() = default;
void insertUser(const UserID &userID, const char *username, const char *password, int privilege);
bool existUser(const UserID &userID);
UserInfo findUser(const UserID &userID);
void removeUser(const UserID &userID);
void modifyUserPrivilege(const UserID &userID, int newPrivilege);
void modifyUserPassword(const UserID &userID, const char *newPassword);
};
}
#endif