From 2f8d7643d03f39fa848576692264d0fe3a37ed91 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 6 Nov 2023 20:48:33 +0000 Subject: Reformat with new clang-format --- lib/persistence.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/persistence.h') diff --git a/lib/persistence.h b/lib/persistence.h index 5d71d4c..92f3052 100644 --- a/lib/persistence.h +++ b/lib/persistence.h @@ -153,6 +153,7 @@ namespace Persistence { }; struct Persistable; + struct PersistenceStore { using SelectionFactory = std::function; PersistenceStore() = default; @@ -163,6 +164,7 @@ namespace Persistence { enum class NameAction { Push, HandleAndContinue, Ignore }; using NameActionSelection = std::pair; + template [[nodiscard]] inline bool persistValue(const std::string_view key, T & value) @@ -267,6 +269,7 @@ namespace Persistence { template struct SelectionT> : public SelectionT> { SelectionT(glm::vec & v) : SelectionT> {spn}, spn {&v[0], L} { } + std::span spn; }; @@ -316,6 +319,7 @@ namespace Persistence { MapByMember(Map & m) : Persistence::SelectionT {s}, map {m} { } using Persistence::SelectionT::SelectionT; + void endObject(Persistence::Stack & stk) override { @@ -332,7 +336,9 @@ namespace Persistence { template struct Appender : public Persistence::SelectionT { Appender(Container & c) : Persistence::SelectionT {s}, container {c} { } + using Persistence::SelectionT::SelectionT; + void endObject(Persistence::Stack & stk) override { @@ -407,6 +413,7 @@ namespace Persistence { { return std::dynamic_pointer_cast(Persistence::ParseBase::sharedObjects.lock()->at(k)); } + template static auto emplaceShared(T &&... v) @@ -421,6 +428,7 @@ namespace Persistence { inline static thread_local SharedObjectsWPtr sharedObjects; SharedObjectsPtr sharedObjectsInstance; }; + // TODO Move these using SeenSharedObjects = std::map; inline SeenSharedObjects seenSharedObjects; @@ -428,6 +436,7 @@ namespace Persistence { template struct SelectionPtrBase : public SelectionV { static constexpr auto shared = std::is_copy_assignable_v; using T = typename Ptr::element_type; + struct SelectionObj : public SelectionV { struct MakeObjectByTypeName : public SelectionV { using SelectionV::SelectionV; -- cgit v1.2.3