From 43fdf551af012300c433c54c08644414bbff170c Mon Sep 17 00:00:00 2001 From: morzhovets Date: Tue, 16 Jul 2024 14:07:52 +0400 Subject: [PATCH] Update DataColumn classes --- include/momo/DataColumn.h | 42 +++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/include/momo/DataColumn.h b/include/momo/DataColumn.h index 4e866ec3..3cf29f88 100644 --- a/include/momo/DataColumn.h +++ b/include/momo/DataColumn.h @@ -407,14 +407,8 @@ class DataColumn : public DataColumn, TStruct, TCod typedef TCode Code; typedef DataColumn BaseColumn; - typedef DataColumn, Struct, Code> MutableColumn; - typedef DataEquality Equality; - - template - using Assignment = DataAssignment; - public: constexpr explicit DataColumn(const char* name) noexcept : mCode(internal::StrHasher::GetHashCode64(name)), @@ -460,15 +454,15 @@ class DataColumn : public DataColumn, TStruct, TCod return false; } - Equality operator==(const Item& item) const noexcept + DataEquality operator==(const Item& item) const noexcept { - return Equality(*this, item); + return DataEquality(*this, item); } template - Assignment operator=(ItemArg&& itemArg) const noexcept + DataAssignment operator=(ItemArg&& itemArg) const noexcept { - return Assignment(*this, std::forward(itemArg)); + return DataAssignment(*this, std::forward(itemArg)); } private: @@ -556,6 +550,20 @@ class DataColumnInfo : public internal::DataColumnInfoBase ColumnInfoBase::template ptVisit(item, ptrVisitor); } + template + static DataEquality> MakeEquality( + const Column& column, const Item& item) noexcept + { + return DataEquality>(column, item); + } + + template + static DataAssignment, ItemArg> MakeAssignment( + const Column& column, ItemArg&& itemArg) noexcept + { + return DataAssignment, ItemArg>(column, std::forward(itemArg)); + } + private: const char* mName; }; @@ -604,6 +612,20 @@ class DataColumnInfoNative : public internal::DataColumnInfoBase(item, ptrVisitor); } + + template + static DataEquality> MakeEquality( + const Column& column, const Item& item) noexcept + { + return DataEquality>(column, item); + } + + template + static DataAssignment, ItemArg> MakeAssignment( + const Column& column, ItemArg&& itemArg) noexcept + { + return DataAssignment, ItemArg>(column, std::forward(itemArg)); + } }; template