64 return start > 0 ? std::optional<T>(
start - 1) : std::nullopt;
77 std::priority_queue<T, std::vector<T>, std::greater<T>>
queue;
90 std::lock_guard<std::mutex>
lock;
108 { t.getIndex() } -> std::integral;
121 return a.getIndex() > b.getIndex();
144template<
typename T,
typename IT,
typename L>
171 std::vector<T> inSequence;
174 inSequence.push_back(
queue.top());
205 return a->getIndex() > b->getIndex();
215template<
typename T,
typename IT,
typename L>
216 requires HasGetIndex<T> && std::integral<IT>
238 std::vector<T*>
pop(T* val)
243 std::vector<T*> inSequence;
246 inSequence.push_back(
queue.top());
MinHeapBase()
Definition MinHeap.h:133
IT start
Tracks the next expected index for sequential popping.
Definition MinHeap.h:135
std::mutex queue_mutex
Mutex for thread-safe access.
Definition MinHeap.h:134
MinHeapFakeLocker(std::mutex &mut)
Definition MinHeap.h:99
Thread-safe min-heap for values with customizable locking.
Definition MinHeap.h:147
size_t size() const
Returns the current size of the heap.
Definition MinHeap.h:185
std::priority_queue< T, std::vector< T >, MinHeapComparator< T > > queue
Underlying min-heap.
Definition MinHeap.h:192
std::vector< T > push_and_pop(const T &val)
Pushes a value and pops all consecutive elements starting from 'start'.
Definition MinHeap.h:167
void push(const T &val)
Pushes a value onto the heap.
Definition MinHeap.h:156
MinHeapLocker(std::mutex &mut)
Definition MinHeap.h:87
std::lock_guard< std::mutex > lock
Definition MinHeap.h:90
Thread-safe min-heap for pointers with customizable locking.
Definition MinHeap.h:218
std::vector< T * > pop(T *val)
Optionally pushes a pointer and pops all consecutive elements starting from 'start'.
Definition MinHeap.h:238
std::priority_queue< T *, std::vector< T * >, MinHeapPtrComparator< T > > queue
Underlying min-heap.
Definition MinHeap.h:264
void push(T *val)
Pushes a pointer onto the heap.
Definition MinHeap.h:227
size_t size() const
Returns the current size of the heap.
Definition MinHeap.h:257
A simple non-thread-safe min-heap for tracking contiguous sequences of size_t indices.
Definition MinHeap.h:34
std::priority_queue< T, std::vector< T >, std::greater< T > > queue
Min-heap of indices.
Definition MinHeap.h:77
void push(T index)
Pushes an index onto the heap.
Definition MinHeap.h:40
std::optional< T > push_and_pop(T index)
Pushes an index and returns the greatest integer at the end of the contiguous sequence.
Definition MinHeap.h:51
size_t size() const
Returns the current size of the heap.
Definition MinHeap.h:71
T start
Tracks the next expected index in the sequence.
Definition MinHeap.h:78
Concept ensuring a type T has a getIndex() method returning an integral type.
Definition MinHeap.h:107
ResWindow.
Definition CompressedChunkCache.h:36
Comparator for min-heap ordering based on getIndex() (value version).
Definition MinHeap.h:118
bool operator()(const T &a, const T &b) const
Definition MinHeap.h:119
Comparator for min-heap ordering based on getIndex() (pointer version).
Definition MinHeap.h:202
bool operator()(const T *a, const T *b) const
Definition MinHeap.h:203