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