Started work on database handling.

This commit is contained in:
2024-04-08 03:10:24 -07:00
parent 405acb026f
commit beba947c69
22 changed files with 918 additions and 44 deletions

47
include/ehs/db/DbObject.h Normal file
View 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;
};
}