From ff000799c3254f52e0beabbe9c62d10c3fc4178e Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 15 May 2023 16:48:56 -0400 Subject: Record format generalization Currently, tombstone counting is bugged. But the rest of it appears to be working. --- include/ds/PriorityQueue.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/ds') diff --git a/include/ds/PriorityQueue.h b/include/ds/PriorityQueue.h index 290d5c8..22582da 100644 --- a/include/ds/PriorityQueue.h +++ b/include/ds/PriorityQueue.h @@ -16,14 +16,14 @@ namespace de { -template +template struct queue_record { - const Record *data; + const R *data; size_t version; }; -template +template class PriorityQueue { public: PriorityQueue(size_t size) : data(size), tail(0) {} @@ -54,7 +54,7 @@ public: } } - void push(const Record* record, size_t version=0) { + void push(const R* record, size_t version=0) { assert(tail != this->data.size()); size_t new_idx = this->tail++; @@ -67,7 +67,7 @@ public: } - queue_record peek(size_t depth=0) { + queue_record peek(size_t depth=0) { ssize_t idx = 0; size_t cur_depth = 0; @@ -81,7 +81,7 @@ public: } private: - std::vector> data; + std::vector> data; size_t tail; /* @@ -124,7 +124,7 @@ private: } inline bool heap_cmp(size_t a, size_t b) { - if (!data[a].data->match(data[b].data)) { + if (data[a].data != data[b].data) { return *(data[a].data) < *(data[b].data); } else if (data[a].version != data[b].version) return data[a].version < data[b].version; -- cgit v1.2.3