-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntry.h
More file actions
20 lines (19 loc) · 798 Bytes
/
Entry.h
File metadata and controls
20 lines (19 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef ENTRY_H
#define ENTRY_H
// Modified for CSCI 220 Fall 15
template <typename K, typename V>
class Entry { // a (key, value) pair
public: // public functions
typedef K Key; // key type
typedef V Value; // value type
Entry(const K& k = K(), const V& v = V()) // constructor
: _key(k), _value(v) { }
const K& key() const { return _key; } // get key
const V& value() const { return _value; } // get value
void setKey(const K& k) { _key = k; } // set key
void setValue(const V& v) { _value = v; } // set value
private: // private data
K _key; // key
V _value; // value
};
#endif