From 522bb42e8f7099d9b5b03a182518d74f0f6e1c2d Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 9 Jul 2022 01:43:21 -0500 Subject: [PATCH] [ox/model] Remove ModelObject copyModel and moveModel operations These operations will require a lot more work to work correctly. This feature might be worth revisiting at some point though. --- deps/ox/src/ox/model/modelops.hpp | 42 +++---------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/deps/ox/src/ox/model/modelops.hpp b/deps/ox/src/ox/model/modelops.hpp index 9fe92835..1b935974 100644 --- a/deps/ox/src/ox/model/modelops.hpp +++ b/deps/ox/src/ox/model/modelops.hpp @@ -94,7 +94,7 @@ class Copier { MemberList *m_dst = nullptr; public: - constexpr Copier(MemberList *dst) noexcept: m_dst(dst) { + constexpr explicit Copier(MemberList *dst) noexcept: m_dst(dst) { } template @@ -135,7 +135,7 @@ class Copier { } template - constexpr void setTypeInfo(const char* = T::TypeName, int = T::Fields) noexcept { + constexpr void setTypeInfo(const char* = T::TypeName, int = T::TypeVersion, int = ModelFieldCount_v) noexcept { } [[nodiscard]] @@ -153,7 +153,7 @@ class Mover { MemberList *m_dst = nullptr; public: - constexpr Mover(MemberList *dst) noexcept: m_dst(dst) { + constexpr explicit Mover(MemberList *dst) noexcept: m_dst(dst) { } template @@ -284,24 +284,6 @@ class Equals { } -template -constexpr void moveModel(ModelObject *dst, T *src) noexcept { - constexpr auto size = ModelFieldCount_v; - detail::MemberList dstFields; - detail::Mover mover(&dstFields); - oxIgnoreError(model(&dstFields, dst)); - oxIgnoreError(model(&mover, src)); -} - -template -constexpr void moveModel(T *dst, ModelObject *src) noexcept { - constexpr auto size = ModelFieldCount_v; - detail::MemberList dstFields; - detail::Mover mover(&dstFields); - oxIgnoreError(model(&dstFields, dst)); - oxIgnoreError(model(&mover, src)); -} - template constexpr void moveModel(T *dst, T *src) noexcept { constexpr auto size = ModelFieldCount_v; @@ -311,24 +293,6 @@ constexpr void moveModel(T *dst, T *src) noexcept { oxIgnoreError(model(&mover, src)); } -template -constexpr void copyModel(ModelObject *dst, const T *src) noexcept { - constexpr auto size = ModelFieldCount_v; - detail::MemberList dstFields; - detail::Copier copier(&dstFields); - oxIgnoreError(model(&dstFields, dst)); - oxIgnoreError(model(&copier, src)); -} - -template -constexpr void copyModel(T *dst, const ModelObject *src) noexcept { - constexpr auto size = ModelFieldCount_v; - detail::MemberList dstFields; - detail::Copier copier(&dstFields); - oxIgnoreError(model(&dstFields, dst)); - oxIgnoreError(model(&copier, src)); -} - template constexpr void copyModel(T *dst, const T *src) noexcept { constexpr auto size = ModelFieldCount_v;