From 753c26d320e894069157bd401f7779ad07073d7c Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 27 Jun 2022 00:09:44 +0000 Subject: (From git) Initial Qt GUI setup git-svn-id: file:///home/arch/svn/epistmool/trunk@2 71f44415-077c-4ad7-a976-72ddbf76608f --- ui.qt/source/knowledgefragment.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ui.qt/source/knowledgefragment.hpp (limited to 'ui.qt/source/knowledgefragment.hpp') diff --git a/ui.qt/source/knowledgefragment.hpp b/ui.qt/source/knowledgefragment.hpp new file mode 100644 index 0000000..533d99f --- /dev/null +++ b/ui.qt/source/knowledgefragment.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include "fwd.hpp" + +#include +#include +#include + +struct KnowledgeId +{ + size_t id; +}; + +class KnowledgeFragment +{ +private: + QDateTime createTime; + QDateTime modifyTime; + KnowledgeId id; + +public: + KnowledgeFragment(KnowledgeId id); + + KnowledgeId getId() const; +}; + +class KnowledgeDatabase +{ +private: + std::vector storage; + std::vector index; // Mapping from KnowledgeId (index) to `storage` index + KnowledgeId nextId; + +public: + KnowledgeId allocateFragment(); + bool deleteFragment(KnowledgeId id); + KnowledgeFragment* getFragment(KnowledgeId id); +}; -- cgit v1.2.3-70-g09d2