From 7a70e75656d31428c9bbbd51fbf1ca920e577ed1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 28 Feb 2023 01:24:18 +0000 Subject: Remove to specify if the Selection pointer type is shared or not Inferred based on whether the pointer is copyable or not. --- assetFactory/assetFactory.h | 4 ++-- assetFactory/faceController.h | 2 +- assetFactory/factoryMesh.h | 2 +- assetFactory/object.h | 2 +- assetFactory/use.h | 2 +- lib/persistence.h | 13 +++++++------ 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/assetFactory/assetFactory.h b/assetFactory/assetFactory.h index a68b460..42082eb 100644 --- a/assetFactory/assetFactory.h +++ b/assetFactory/assetFactory.h @@ -14,7 +14,7 @@ public: FactoryMesh::Collection meshes; private: - friend Persistence::SelectionPtrBase, true>; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; }; @@ -36,6 +36,6 @@ public: static void normalizeColourName(std::string &); private: - friend Persistence::SelectionPtrBase, true>; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; }; diff --git a/assetFactory/faceController.h b/assetFactory/faceController.h index 0618388..10a226a 100644 --- a/assetFactory/faceController.h +++ b/assetFactory/faceController.h @@ -21,7 +21,7 @@ public: FaceControllers faceControllers; private: - friend Persistence::SelectionPtrBase, false>; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; std::string getId() const override diff --git a/assetFactory/factoryMesh.h b/assetFactory/factoryMesh.h index 4b6d3e5..bbeb870 100644 --- a/assetFactory/factoryMesh.h +++ b/assetFactory/factoryMesh.h @@ -13,6 +13,6 @@ public: Use::Collection uses; private: - friend Persistence::SelectionPtrBase, true>; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; }; diff --git a/assetFactory/object.h b/assetFactory/object.h index 1069f66..f3726c7 100644 --- a/assetFactory/object.h +++ b/assetFactory/object.h @@ -16,7 +16,7 @@ public: std::string id; private: - friend Persistence::SelectionPtrBase, true>; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; std::string getId() const override diff --git a/assetFactory/use.h b/assetFactory/use.h index 5b61eca..5e4c35f 100644 --- a/assetFactory/use.h +++ b/assetFactory/use.h @@ -17,7 +17,7 @@ public: FaceControllers faceControllers; private: - friend Persistence::SelectionPtrBase, true>; + friend Persistence::SelectionPtrBase>; bool persist(Persistence::PersistenceStore & store) override; std::string getId() const override diff --git a/lib/persistence.h b/lib/persistence.h index bfd27f0..458ba4d 100644 --- a/lib/persistence.h +++ b/lib/persistence.h @@ -381,7 +381,8 @@ namespace Persistence { using SeenSharedObjects = std::map; inline SeenSharedObjects seenSharedObjects; - template struct SelectionPtrBase : public SelectionV { + 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 { @@ -526,13 +527,13 @@ namespace Persistence { } }; - template struct SelectionT> : public SelectionPtrBase, false> { - using SelectionPtrBase, false>::SelectionPtrBase; + template struct SelectionT> : public SelectionPtrBase> { + using SelectionPtrBase>::SelectionPtrBase; }; - template struct SelectionT> : public SelectionPtrBase, true> { - using SelectionPtrBase, true>::SelectionPtrBase; - using SelectionPtrBase, true>::setValue; + template struct SelectionT> : public SelectionPtrBase> { + using SelectionPtrBase>::SelectionPtrBase; + using SelectionPtrBase>::setValue; void setValue(std::string && id) override -- cgit v1.2.3