summaryrefslogtreecommitdiff
path: root/test/testStructures.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/testStructures.h')
-rw-r--r--test/testStructures.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/testStructures.h b/test/testStructures.h
new file mode 100644
index 0000000..666562e
--- /dev/null
+++ b/test/testStructures.h
@@ -0,0 +1,52 @@
+#pragma once
+
+#include <persistence.h>
+
+struct AbsObject : public Persistence::Persistable {
+ std::string base;
+
+ bool persist(Persistence::PersistenceStore & store) override;
+
+ virtual void dummy() const = 0;
+};
+
+struct SubObject : public AbsObject {
+ std::string sub;
+
+ bool persist(Persistence::PersistenceStore & store) override;
+
+ void dummy() const override;
+
+ [[nodiscard]] std::string getId() const override;
+};
+
+struct SubObject2 : public AbsObject {
+ bool persist(Persistence::PersistenceStore & store) override;
+ void dummy() const override;
+};
+
+struct TestObject : public Persistence::Persistable {
+ TestObject() = default;
+
+ float flt {};
+ std::string str {};
+ bool bl {};
+ glm::vec3 pos {};
+ std::vector<float> flts;
+ std::vector<glm::vec3> poss;
+ std::vector<std::vector<std::vector<std::string>>> nest;
+ std::unique_ptr<TestObject> ptr;
+ std::unique_ptr<AbsObject> aptr;
+ std::vector<std::unique_ptr<TestObject>> vptr;
+
+ bool persist(Persistence::PersistenceStore & store) override;
+};
+
+struct SharedTestObject : public Persistence::Persistable {
+ SharedTestObject() = default;
+
+ std::shared_ptr<AbsObject> sptr;
+ std::shared_ptr<SubObject> ssptr;
+
+ bool persist(Persistence::PersistenceStore & store) override;
+};