From 10c2348664a0341764b6a773aaa58f2af93075ad Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 22 Mar 2024 14:03:49 -0400 Subject: Record.h: Removed manual constructor and adjusted wrapped header fields --- include/framework/interface/Record.h | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'include/framework/interface') diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h index f4105c6..39880bd 100644 --- a/include/framework/interface/Record.h +++ b/include/framework/interface/Record.h @@ -54,6 +54,11 @@ concept WrappedInterface = RecordInterface && requires(R r, R s, bool b) { {r.is_deleted()} -> std::convertible_to; {r.set_tombstone(b)}; {r.is_tombstone()} -> std::convertible_to; + {r.set_timestamp()}; + {r.get_timestamp()} -> std::convertible_to; + {r.clear_timestamp()}; + {r.is_deleted()} -> std::convertible_to; + {r.set_visible()}; {r < s} -> std::convertible_to; {r == s} ->std::convertible_to; }; @@ -71,9 +76,29 @@ struct Wrapped { return header & 2; } + inline void set_visible() { + header |= 4; + } + + inline bool is_visible() const { + return header & 4; + } + + inline void set_timestamp(int ts) { + header |= (ts << 3); + } + + inline int get_timestamp() const { + return header >> 3; + } + + inline void clear_timestamp() { + header &= 7; + } + inline void set_tombstone(bool val=true) { if (val) { - header |= val; + header |= 1; } else { header &= 0; } @@ -98,15 +123,6 @@ struct Record { K key; V value; - Record &operator=(const Record &other) { - this->key = K(); - - this->key = other.key; - this->value = other.value; - - return *this; - } - inline bool operator<(const Record& other) const { return key < other.key || (key == other.key && value < other.value); } -- cgit v1.2.3