Database implementation mostly complete.

This commit is contained in:
2024-04-09 01:44:15 -07:00
parent beba947c69
commit d13fe81ac5
20 changed files with 768 additions and 106 deletions

View File

@@ -2,23 +2,35 @@
#include "DbType.h"
#include "ehs/EHS.h"
#include "ehs/BaseObj.h"
#include "ehs/Serializer.h"
#include "ehs/Str.h"
namespace ehs
{
class DbVarTmpl : public BaseObj
class DbVar;
class DbVarTmpl
{
private:
friend class DbTable;
friend class DbVar;
UInt_64 hashId;
Str_8 id;
DbType type;
bool array;
UInt_64 size;
Byte* def;
Array<DbVar*> slaves;
public:
~DbVarTmpl();
DbVarTmpl();
DbVarTmpl(Str_8 id, DbType type, bool array);
DbVarTmpl(Str_8 id, DbType type, UInt_64 size, const Byte* def);
DbVarTmpl(Str_8 id, DbType type, const Byte* def);
DbVarTmpl(DbVarTmpl&& varTmpl) noexcept;
@@ -41,5 +53,16 @@ namespace ehs
void SetIsArray(bool value);
bool IsArray() const;
UInt_64 GetSize() const;
Byte* GetDefault() const;
private:
void UpdateSlave(const DbVar *oldSlave, DbVar *newSlave) const;
void Serialize(Serializer<UInt_64> &data) const;
void Deserialize(Serializer<UInt_64> &data);
};
}