diff --git a/ydb/core/mind/bscontroller/id_wrapper.h b/ydb/core/mind/bscontroller/id_wrapper.h new file mode 100644 index 000000000000..fd2d002a782e --- /dev/null +++ b/ydb/core/mind/bscontroller/id_wrapper.h @@ -0,0 +1,43 @@ +#include +#include +#include +using TString = TBasicString; + +class TGroupIdTag; +template +concept IntegralType = std::is_integral::value; + +concept StringType = std::convertible_to; +template +class TIdWrapper { +private: + T Raw; +public: + TIdWrapper() = default; + + ~TIdWrapper() = default; + + TIdWrapper(const T& value) : Raw(value) {}; + + TIdWrapper(const TIdWrapper& other) : TIdWrapper(other.Raw); + + + TIdWrapper& operator=(const T& value) = delete; + + void CopyToProto(NProtoBuf::Message *message, void (NProtoBuf::Message::*pfn)(T value)) { + (message->*pfn)(*this); + } + + T& operator+=(const T& other) { + return this.Raw += other.Raw; + } + + + friend TBasicString operator+(const T& first, const T& other) Y_WARN_UNUSED_RESULT { + return first + second; + } + + constexpr auto operator<=>(const IntWrapper&) const = default; + + +}; \ No newline at end of file