From f91e2ea8d9e30b1e62c4f8784fddfd4eb9578d2d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 21 Feb 2023 20:09:41 +0000 Subject: Move Appender in Persistence NS and simplify types --- assetFactory/object.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'assetFactory/object.cpp') diff --git a/assetFactory/object.cpp b/assetFactory/object.cpp index faa9a17..ae5a301 100644 --- a/assetFactory/object.cpp +++ b/assetFactory/object.cpp @@ -16,24 +16,8 @@ Object::createMesh(ModelFactoryMesh & mesh, const Mutation::Matrix & mutation) c return faces; } -template struct Appender : public Persistence::SelectionT> { - Appender(Container & c) : Persistence::SelectionT> {s}, container {c} { } - using Persistence::SelectionT>::SelectionT; - void - endObject(Persistence::Stack & stk) override - { - container.emplace_back(s); - stk.pop(); - } - -private: - std::shared_ptr s; - Container & container; -}; - bool Object::persist(Persistence::PersistenceStore & store) { - using UseAppend = Appender; - return STORE_TYPE && STORE_MEMBER(id) && STORE_NAME_HELPER("use", uses, UseAppend); + return STORE_TYPE && STORE_MEMBER(id) && STORE_NAME_HELPER("use", uses, Persistence::Appender); } -- cgit v1.2.3