[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.
This commit is contained in:
parent
3ca252320f
commit
522bb42e8f
42
deps/ox/src/ox/model/modelops.hpp
vendored
42
deps/ox/src/ox/model/modelops.hpp
vendored
@ -94,7 +94,7 @@ class Copier {
|
|||||||
MemberList<size> *m_dst = nullptr;
|
MemberList<size> *m_dst = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr Copier(MemberList<size> *dst) noexcept: m_dst(dst) {
|
constexpr explicit Copier(MemberList<size> *dst) noexcept: m_dst(dst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename FT>
|
template<typename FT>
|
||||||
@ -135,7 +135,7 @@ class Copier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T = void>
|
template<typename T = void>
|
||||||
constexpr void setTypeInfo(const char* = T::TypeName, int = T::Fields) noexcept {
|
constexpr void setTypeInfo(const char* = T::TypeName, int = T::TypeVersion, int = ModelFieldCount_v<T>) noexcept {
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
@ -153,7 +153,7 @@ class Mover {
|
|||||||
MemberList<size> *m_dst = nullptr;
|
MemberList<size> *m_dst = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
constexpr Mover(MemberList<size> *dst) noexcept: m_dst(dst) {
|
constexpr explicit Mover(MemberList<size> *dst) noexcept: m_dst(dst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename FT>
|
template<typename FT>
|
||||||
@ -284,24 +284,6 @@ class Equals {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
constexpr void moveModel(ModelObject *dst, T *src) noexcept {
|
|
||||||
constexpr auto size = ModelFieldCount_v<T>;
|
|
||||||
detail::MemberList<size> dstFields;
|
|
||||||
detail::Mover<size> mover(&dstFields);
|
|
||||||
oxIgnoreError(model(&dstFields, dst));
|
|
||||||
oxIgnoreError(model(&mover, src));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
constexpr void moveModel(T *dst, ModelObject *src) noexcept {
|
|
||||||
constexpr auto size = ModelFieldCount_v<T>;
|
|
||||||
detail::MemberList<size> dstFields;
|
|
||||||
detail::Mover<size> mover(&dstFields);
|
|
||||||
oxIgnoreError(model(&dstFields, dst));
|
|
||||||
oxIgnoreError(model(&mover, src));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr void moveModel(T *dst, T *src) noexcept {
|
constexpr void moveModel(T *dst, T *src) noexcept {
|
||||||
constexpr auto size = ModelFieldCount_v<T>;
|
constexpr auto size = ModelFieldCount_v<T>;
|
||||||
@ -311,24 +293,6 @@ constexpr void moveModel(T *dst, T *src) noexcept {
|
|||||||
oxIgnoreError(model(&mover, src));
|
oxIgnoreError(model(&mover, src));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
constexpr void copyModel(ModelObject *dst, const T *src) noexcept {
|
|
||||||
constexpr auto size = ModelFieldCount_v<T>;
|
|
||||||
detail::MemberList<size> dstFields;
|
|
||||||
detail::Copier<size> copier(&dstFields);
|
|
||||||
oxIgnoreError(model(&dstFields, dst));
|
|
||||||
oxIgnoreError(model(&copier, src));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
constexpr void copyModel(T *dst, const ModelObject *src) noexcept {
|
|
||||||
constexpr auto size = ModelFieldCount_v<T>;
|
|
||||||
detail::MemberList<size> dstFields;
|
|
||||||
detail::Copier<size> copier(&dstFields);
|
|
||||||
oxIgnoreError(model(&dstFields, dst));
|
|
||||||
oxIgnoreError(model(&copier, src));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr void copyModel(T *dst, const T *src) noexcept {
|
constexpr void copyModel(T *dst, const T *src) noexcept {
|
||||||
constexpr auto size = ModelFieldCount_v<T>;
|
constexpr auto size = ModelFieldCount_v<T>;
|
||||||
|
Loading…
Reference in New Issue
Block a user