42 template<
typename TYPE,
44 template <
typename,
typename>
typename SERIAL =
blocksList,
45 template <
typename>
typename ALLOC =
allocator>
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>{});
110 void push(
const TYPE& e);
132 [[nodiscard]] std::string
className()
const override;
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>
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>
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>
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.
Default memory allocator using allocators utilities.
Definition allocator.h:154
A block-based list implementation.
Definition blocksList.h:30
blocksList< TYPE, allocator< TYPE > > serial_
Definition containerAdapter.h:60
containerAdapter(const blocksList< TYPE, allocator< TYPE > > &serial)
Definition containerAdapter.h:139
bool empty() const
Definition container.h:155
Comparator for increasing comparison (less than).
Definition comparator.h:65
Exception for missing element requests.
Definition error.h:136
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 & operator=(const prique &other)
Copy assignment operator.
Definition prique.h:169
std::string className() const override
Gets class name identifier.
Definition prique.h:243
TYPE pop()
Extracts highest priority element.
Definition prique.h:218
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:76
Base class for container adapters with common interfaces.
Main namespace for the project Original.
Definition algorithms.h:21
Type system foundations and concept definitions.