5 #include <libutl/Collection.h> 6 #include <libutl/Vector.h> 78 init(size, increment, owner, multiSet, ordering);
86 Heap(
bool owner,
bool multiSet =
true)
91 virtual void steal(
Object& rhs);
93 virtual size_t innerAllocatedSize()
const;
104 _array.grow(newSize);
112 iterator findIt(
const Object& key)
const;
114 iterator findIt(
const Object& key);
141 return super::add(
object);
144 virtual bool add(
const Object*
object);
149 super::add(collection);
156 virtual void clear();
168 virtual bool remove(
const Object& key);
170 virtual void removeIt(
BidIt& it);
175 inline iterator begin()
const;
177 inline iterator begin();
179 inline virtual BidIt* beginNew()
const;
181 inline virtual BidIt* beginNew();
183 inline iterator end()
const;
185 inline iterator end();
187 inline virtual BidIt* endNew()
const;
189 inline virtual BidIt* endNew();
193 void init(
size_t size = 16,
196 bool multiSet =
true,
202 compareObjects(
const Object* lhs,
const Object* rhs)
const 204 return super::compareObjects(lhs, rhs);
207 void find(
const Object& key,
size_t& idx)
const;
209 void removeIdx(
size_t idx);
211 void swapUp(
size_t idx);
213 void swapDown(
size_t idx);
225 #include <libutl/THeap.h> Heap(size_t size, size_t increment=size_t_max, bool owner=true, bool multiSet=true, Ordering *ordering=nullptr)
Constructor.
#define const_cast_this
Pointer to the object the method was invoked on (casting away const).
void deInit()
De-initialize UTL++.
Object comparison abstraction.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Templated proxy for BidIt.
const size_t size_t_max
Maximum size_t value.
#define IFDEBUG(x)
Do x in DEBUG mode only.
Heap(bool owner, bool multiSet=true)
Constructor.
void setConst(bool p_const)
Set the const flag.
Bi-directional Heap iterator.
Object * getMax() const
Return the largest contained object (nullptr if empty()).
void reserve(size_t newSize)
Grow to the given size (at least).
Bi-directional iterator abstraction.
A sequence of same-type objects.
Root of UTL++ class hierarchy.
void init()
Initialize UTL++.
#define ASSERTD
Do an assertion in DEBUG mode only.