37 template <
typename K,
typename V>
class HashMap 88 const K&
keyAt(
unsigned int idx)
const 165 void allocate(
unsigned int newSize);
176 int indexOf(
const K& key)
const;
208 void remove(
const K& key)
257 K** nkeys =
new K*[newSize];
258 V** nvalues =
new V*[newSize];
260 if(
keys !=
nullptr) {
261 for(
unsigned i = 0; i <
size; i++) {
269 for(
unsigned i =
size; i < newSize; i++) {
271 nvalues[i] =
new V();
287 if(key == *
keys[i]) {
300 for(
unsigned i = index + 1; i <
size; i++) {
310 if(
keys !=
nullptr) {
311 for(
unsigned i = 0; i <
size; i++) {
326 for(
unsigned i = 0; i < map.
count(); i++) {
bool(* comparator)(const K &, const K &)
Definition: WHashMap.h:40
void allocate(unsigned int newSize)
Definition: WHashMap.h:252
const V & operator[](const K &key) const
Definition: WHashMap.h:145
HashMap(comparator compare)
Definition: WHashMap.h:58
HashMap class template.
Definition: WHashMap.h:37
comparator cb_comparator
Definition: WHashMap.h:231
void clear()
Definition: WHashMap.h:308
const K & keyAt(unsigned int idx) const
Definition: WHashMap.h:88
long map(long, long, long, long, long)
const V & valueAt(unsigned int idx) const
Definition: WHashMap.h:113
~HashMap()
Definition: WHashMap.h:62
void setNullValue(const V &nullv)
Definition: WHashMap.h:220
uint16_t size
Definition: WHashMap.h:230
V nil
Definition: WHashMap.h:228
uint16_t currentIndex
Definition: WHashMap.h:229
K & keyAt(unsigned int idx)
Definition: WHashMap.h:96
void setMultiple(const HashMap< K, V > &map)
Definition: WHashMap.h:324
K ** keys
Definition: WHashMap.h:226
V & valueAt(unsigned int idx)
Definition: WHashMap.h:121
HashMap()
Definition: WHashMap.h:47
int indexOf(const K &key) const
Definition: WHashMap.h:279
V ** values
Definition: WHashMap.h:227
bool contains(const K &key) const
Definition: WHashMap.h:187
void removeAt(unsigned index)
Definition: WHashMap.h:295
unsigned int count() const
Definition: WHashMap.h:74