Added a new UserModel class.

This commit is contained in:
Relintai 2021-08-22 20:23:06 +02:00
parent 6c76f625af
commit 158a68e028
2 changed files with 46 additions and 0 deletions

View 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;

View 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