-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHashMapEntry.h
35 lines (26 loc) · 870 Bytes
/
HashMapEntry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
template <typename K, typename V>
class HashMapEntry {
protected:
K _key;
V _value;
public:
HashMapEntry(const K &key, const V &value);
~HashMapEntry();
K getKey();
V getValue();
void setValue(const V &value);
void setKey(const K &key);
};
template <typename K, typename V>
HashMapEntry<K, V>::HashMapEntry(const K &key, const V &value) : _key(key), _value(value) {}
template <typename K, typename V>
HashMapEntry<K, V>::~HashMapEntry() = default;
template <typename K, typename V>
K HashMapEntry<K, V>::getKey() { return _key; }
template <typename K, typename V>
V HashMapEntry<K, V>::getValue() { return _value; }
template <typename K, typename V>
void HashMapEntry<K, V>::setValue(const V &value) { _value = value; }
template <typename K, typename V>
void HashMapEntry<K, V>::setKey(const K &key) { _key = key; }