mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
35 lines
567 B
C++
35 lines
567 B
C++
#ifndef USER_MANAGER_H
|
|
#define USER_MANAGER_H
|
|
|
|
#include "core/object.h"
|
|
|
|
#include <map>
|
|
#include <mutex>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class User;
|
|
|
|
class UserManager : public Object {
|
|
public:
|
|
void add_user(User *user);
|
|
void remove_user(User *user);
|
|
User *get_user(const std::string &user_name);
|
|
virtual User *create_user();
|
|
|
|
void clear();
|
|
|
|
static UserManager *get_singleton();
|
|
|
|
UserManager();
|
|
~UserManager();
|
|
|
|
std::map<std::string, User *> _users;
|
|
std::vector<User *> _users_vec;
|
|
std::mutex _mutex;
|
|
|
|
protected:
|
|
static UserManager *_self;
|
|
};
|
|
|
|
#endif |