-
Notifications
You must be signed in to change notification settings - Fork 0
/
dsmap.h
40 lines (28 loc) · 973 Bytes
/
dsmap.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
36
37
38
39
40
/* START OF "dsmap.h" FILE */
#pragma once
#ifndef _DSMAP_H
#define _DSMAP_H
#include "dsrbtree.h"
template <typename KEY_TYPE, typename VALUE_TYPE>
class dsMAP : public dsRB_TREE<std::pair<KEY_TYPE, VALUE_TYPE>> {
// map is an ordered red-black tree of {key, value} values, unique keys
public:
typedef std::pair<KEY_TYPE, VALUE_TYPE> ELEM_TYPE;
dsMAP (void) {}
dsMAP (const dsMAP & map);
dsMAP (dsMAP && map);
~dsMAP (void) {}
dsMAP & operator= (const dsMAP & map);
dsMAP & operator= (dsMAP && map);
VALUE_TYPE & operator[] (const KEY_TYPE & key);
int Size (void) const;
bool Empty (void) const;
void Clear (void);
void Erase (const KEY_TYPE & key);
int Count (const KEY_TYPE & key);
ITERATOR Find (const KEY_TYPE & key);
CONST_ITERATOR Find (const KEY_TYPE & key) const;
};
#include "dsmap.hpp"
#endif // _DSMAP_H
/* END OF "dsmap.h" FILE */