-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdsrbtreeiterator.h
79 lines (57 loc) · 2.31 KB
/
dsrbtreeiterator.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* START OF "dsrbtreeiterator.h" FILE */
#pragma once
#ifndef _DSRBTREEITERATOR_H
#define _DSRBTREEITERATOR_H
// forward declaration
template <typename VALUE_TYPE>
class dsRB_TREE;
// forward declaration
template <typename VALUE_TYPE>
class dsRB_TREE_ITERATOR;
template <typename VALUE_TYPE>
class dsRB_TREE_CONST_ITERATOR {
friend class dsRB_TREE<VALUE_TYPE>;
friend class dsRB_TREE_ITERATOR<VALUE_TYPE>;
public:
typedef typename dsRB_TREE<VALUE_TYPE>::NODE NODE;
dsRB_TREE_CONST_ITERATOR (void);
dsRB_TREE_CONST_ITERATOR (const NODE * p);
dsRB_TREE_CONST_ITERATOR (const dsRB_TREE_CONST_ITERATOR & it);
~dsRB_TREE_CONST_ITERATOR (void) {}
const VALUE_TYPE & operator* (void) const;
const VALUE_TYPE * operator-> (void) const;
bool operator!= (const dsRB_TREE_CONST_ITERATOR & it) const;
bool operator== (const dsRB_TREE_CONST_ITERATOR & it) const;
bool operator!= (const dsRB_TREE_ITERATOR<VALUE_TYPE> & it) const;
bool operator== (const dsRB_TREE_ITERATOR<VALUE_TYPE> & it) const;
dsRB_TREE_CONST_ITERATOR & operator= (const dsRB_TREE_CONST_ITERATOR & it);
dsRB_TREE_CONST_ITERATOR & operator++ (void);
dsRB_TREE_CONST_ITERATOR & operator++ (int i);
private:
const NODE * p;
};
template <typename VALUE_TYPE>
class dsRB_TREE_ITERATOR {
friend class dsRB_TREE<VALUE_TYPE>;
friend class dsRB_TREE_CONST_ITERATOR<VALUE_TYPE>;
public:
typedef typename dsRB_TREE<VALUE_TYPE>::NODE NODE;
dsRB_TREE_ITERATOR (void);
dsRB_TREE_ITERATOR (NODE * p);
dsRB_TREE_ITERATOR (const NODE * p);
dsRB_TREE_ITERATOR (const dsRB_TREE_CONST_ITERATOR<VALUE_TYPE> & it);
dsRB_TREE_ITERATOR (const dsRB_TREE_ITERATOR & it);
~dsRB_TREE_ITERATOR (void) {}
VALUE_TYPE & operator* (void) const;
VALUE_TYPE * operator-> (void) const;
bool operator!= (const dsRB_TREE_ITERATOR & it) const;
bool operator== (const dsRB_TREE_ITERATOR & it) const;
dsRB_TREE_ITERATOR & operator= (const dsRB_TREE_ITERATOR & it);
dsRB_TREE_ITERATOR & operator++ (void);
dsRB_TREE_ITERATOR & operator++ (int i);
private:
NODE * p;
};
#include "dsrbtreeiterator.hpp"
#endif // _DSRBTREEITERATOR_H
/* END OF "dsrbtreeiterator.h" FILE */