Started work on database handling.
This commit is contained in:
47
include/ehs/db/DbObject.h
Normal file
47
include/ehs/db/DbObject.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "ehs/Array.h"
|
||||
#include "DbVar.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
class DbTable;
|
||||
|
||||
class DbObject
|
||||
{
|
||||
private:
|
||||
friend class DbTable;
|
||||
|
||||
UInt_64 id;
|
||||
Array<DbVar> vars;
|
||||
bool loaded;
|
||||
DbTable* parent;
|
||||
|
||||
public:
|
||||
DbObject();
|
||||
|
||||
DbObject(DbObject&& obj) noexcept;
|
||||
|
||||
DbObject(const DbObject& obj);
|
||||
|
||||
DbObject& operator=(DbObject&& obj) noexcept;
|
||||
|
||||
DbObject& operator=(const DbObject& obj);
|
||||
|
||||
UInt_64 GetId();
|
||||
|
||||
bool HasVariable(UInt_64 hashId);
|
||||
|
||||
DbVar* GetVariable(UInt_64 hashId) const;
|
||||
|
||||
void Save();
|
||||
|
||||
void Load();
|
||||
|
||||
bool IsLoaded() const;
|
||||
|
||||
void Free();
|
||||
|
||||
DbTable* GetParent() const;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user