mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
Added a new UserController class.
This commit is contained in:
parent
adfcdb8514
commit
6c76f625af
25
modules/users/user_controller.cpp
Normal file
25
modules/users/user_controller.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include "user_controller.h"
|
||||
|
||||
#include "user.h"
|
||||
|
||||
UserController *UserController::get_singleton() {
|
||||
return _self;
|
||||
}
|
||||
|
||||
UserController::UserController() :
|
||||
Object() {
|
||||
|
||||
if (_self) {
|
||||
printf("UserController::UserController(): Error! self is not null!/n");
|
||||
}
|
||||
|
||||
_self = this;
|
||||
}
|
||||
|
||||
UserController::~UserController() {
|
||||
if (_self == this) {
|
||||
_self = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
UserController *UserController::_self = nullptr;
|
21
modules/users/user_controller.h
Normal file
21
modules/users/user_controller.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef USER_CONTROLLER_H
|
||||
#define USER_CONTROLLER_H
|
||||
|
||||
#include "core/object.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class User;
|
||||
|
||||
class UserController : public Object {
|
||||
public:
|
||||
static UserController *get_singleton();
|
||||
|
||||
UserController();
|
||||
~UserController();
|
||||
|
||||
protected:
|
||||
static UserController *_self;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user