42 template<
typename TYPE,
43 template <
typename>
typename Callback = increaseComparator,
44 template <
typename,
typename>
typename SERIAL = blocksList,
45 template <
typename>
typename ALLOC = allocator>
46 requires Compare<Callback<TYPE>, TYPE>
49 Callback<TYPE> compare_;
59 explicit prique(
const SERIAL<TYPE, ALLOC<TYPE>>&
serial = SERIAL<TYPE, ALLOC<TYPE>>{},
60 const Callback<TYPE>& compare = Callback<TYPE>{});
69 prique(
const std::initializer_list<TYPE>& lst,
70 const Callback<TYPE>& compare = Callback<TYPE>{});
137 template<
typename TYPE,
138 template <
typename>
typename Callback,
139 template <
typename,
typename>
typename SERIAL,
140 template <
typename>
typename ALLOC>
148 template<
typename TYPE,
149 template <
typename>
typename Callback,
150 template <
typename,
typename>
typename SERIAL,
151 template <
typename>
typename ALLOC>
154 :
prique(SERIAL<TYPE, ALLOC<TYPE>>(lst), compare) {}
156 template<
typename TYPE,
157 template <
typename>
typename Callback,
158 template <
typename,
typename>
typename SERIAL,
159 template <
typename>
typename ALLOC>
162 :
containerAdapter<TYPE, SERIAL, ALLOC>(other.serial_), compare_(other.compare_) {}
164 template<
typename TYPE,
165 template <
typename>
typename Callback,
166 template <
typename,
typename>
typename SERIAL,
167 template <
typename>
typename ALLOC>
171 if (
this == &other)
return *
this;
173 compare_ = other.compare_;
177 template<
typename TYPE,
178 template <
typename>
typename Callback,
179 template <
typename,
typename>
typename SERIAL,
180 template <
typename>
typename ALLOC>
184 this->operator=(std::move(other));
187 template<
typename TYPE,
188 template <
typename>
typename Callback,
189 template <
typename,
typename>
typename SERIAL,
190 template <
typename>
typename ALLOC>
197 this->serial_ = std::move(other.serial_);
198 this->compare_ = std::move(other.compare_);
202 template<
typename TYPE,
203 template <
typename>
typename Callback,
204 template <
typename,
typename>
typename SERIAL,
205 template <
typename>
typename ALLOC>
209 this->serial_.pushEnd(e);
213 template<
typename TYPE,
214 template <
typename>
typename Callback,
215 template <
typename,
typename>
typename SERIAL,
216 template <
typename>
typename ALLOC>
223 TYPE res = this->serial_.popEnd();
228 template<
typename TYPE,
229 template <
typename>
typename Callback,
230 template <
typename,
typename>
typename SERIAL,
231 template <
typename>
typename ALLOC>
235 return this->serial_.getBegin();
238 template<
typename TYPE,
239 template <
typename>
typename Callback,
240 template <
typename,
typename>
typename SERIAL,
241 template <
typename>
typename ALLOC>
Standard algorithm implementations for iterator-based containers.
A block-based list implementation.
static void heapInit(const iterator< TYPE > &begin, const iterator< TYPE > &end, const Callback &compares)
Initializes a heap structure from a range of iterators.
static void swap(const iterator< TYPE > &it1, const iterator< TYPE > &it2) noexcept
Swaps the values of two elements.
static void heapAdjustUp(const iterator< TYPE > &begin, const iterator< TYPE > ¤t, const Callback &compares)
Adjusts a heap structure upwards from a given iterator.
static void heapAdjustDown(const iterator< TYPE > &begin, const iterator< TYPE > &range, const iterator< TYPE > ¤t, const Callback &compares)
Adjusts a heap structure downwards starting from a given iterator.
Adapter class that provides unified interface for various container types.
Definition containerAdapter.h:53
SERIAL< TYPE, ALLOC< TYPE > > serial_
The underlying container instance.
Definition containerAdapter.h:60
Exception for missing element requests.
Definition error.h:213
Heap-based priority queue container.
Definition prique.h:48
prique(const std::initializer_list< TYPE > &lst, const Callback< TYPE > &compare=Callback< TYPE >{})
Constructs from initializer list with comparator and allocator.
Definition prique.h:153
TYPE top() const
Accesses highest priority element.
Definition prique.h:233
prique(const SERIAL< TYPE, ALLOC< TYPE > > &serial=SERIAL< TYPE, ALLOC< TYPE > >{}, const Callback< TYPE > &compare=Callback< TYPE >{})
Constructs priority queue with container, comparator and allocator.
Definition prique.h:142
void push(const TYPE &e)
Inserts element maintaining heap property.
Definition prique.h:207
prique(prique &&other) noexcept
Move constructs a priority queue with allocator propagation.
Definition prique.h:182
prique & operator=(const prique &other)
Copy assignment operator.
Definition prique.h:169
std::string className() const override
Gets class name identifier.
Definition prique.h:243
prique(const prique &other)
Copy constructs a priority queue with allocator propagation.
Definition prique.h:161
TYPE pop()
Extracts highest priority element.
Definition prique.h:218
prique & operator=(prique &&other) noexcept
Move assignment operator.
Definition prique.h:192
Abstract base class for sequential containers with index-based access.
Definition serial.h:34
Comparator base class and concrete comparator classes.
Combines Comparable and CallbackOf for comparison callbacks.
Definition types.h:298
Base class for container adapters with common interfaces.
Main namespace for the project Original.
Definition algorithms.h:21
Core type system foundations and concept definitions.