diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2024-03-22 14:03:49 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2024-03-22 14:03:49 -0400 |
| commit | 10c2348664a0341764b6a773aaa58f2af93075ad (patch) | |
| tree | 541eb0e7ee1ee2a02d34bedf84d23db6acd7df81 /include/framework/interface/Record.h | |
| parent | 9c4884c69486cfc78801ffe4e7cd1c581e0cdb87 (diff) | |
| download | dynamic-extension-10c2348664a0341764b6a773aaa58f2af93075ad.tar.gz | |
Record.h: Removed manual constructor and adjusted wrapped header fields
Diffstat (limited to 'include/framework/interface/Record.h')
| -rw-r--r-- | include/framework/interface/Record.h | 36 |
1 files changed, 26 insertions, 10 deletions
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<R> && requires(R r, R s, bool b) { {r.is_deleted()} -> std::convertible_to<bool>; {r.set_tombstone(b)}; {r.is_tombstone()} -> std::convertible_to<bool>; + {r.set_timestamp()}; + {r.get_timestamp()} -> std::convertible_to<uint32_t>; + {r.clear_timestamp()}; + {r.is_deleted()} -> std::convertible_to<bool>; + {r.set_visible()}; {r < s} -> std::convertible_to<bool>; {r == s} ->std::convertible_to<bool>; }; @@ -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); } |