forked from activesys/libcstl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcstl_multiset_iterator.h
125 lines (107 loc) · 4.47 KB
/
cstl_multiset_iterator.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* The iterator interface of multiset.
* Copyright (C) 2008 - 2012 Wangbo
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author e-mail: [email protected]
*/
#ifndef _CSTL_MULTISET_ITERATOR_H_
#define _CSTL_MULTISET_ITERATOR_H_
#ifdef __cplusplus
extern "C" {
#endif
/** include section **/
/** constant declaration and macro section **/
/** data type declaration and struct, union, enum section **/
typedef iterator_t multiset_iterator_t;
typedef iterator_t multiset_reverse_iterator_t;
/** exported global variable declaration section **/
/** exported function prototype section **/
/**
* Create multiset iterator.
* @return multiset iterator.
* @remarks the returned iterator is invalid iterator.
*/
extern multiset_iterator_t create_multiset_iterator(void);
/**
* Get data value referenced by iterator.
* @param it_iter multiset iterator.
* @param pv_value data value buffer.
* @return void.
* @remarks it_iter must be valid multiset iterator, otherwise the behavior is undefined. if pv_value == NULL, then the
* behavior is undefined.
*/
extern void _multiset_iterator_get_value(multiset_iterator_t it_iter, void* pv_value);
/**
* Get data value pointer referenced by iterator.
* @param it_iter multiset iterator.
* @return void.
* @remarks it_iter must be valid multiset iterator, otherwise the behavior is undefined.
*/
extern const void* _multiset_iterator_get_pointer(multiset_iterator_t it_iter);
/**
* Get data value pointer referenced by iterator, but ignore char*.
* @param it_iter multiset iterator.
* @return void.
* @remarks it_iter must be valid multiset iterator, otherwise the behavior is undefined.
*/
extern const void* _multiset_iterator_get_pointer_ignore_cstr(multiset_iterator_t it_iter);
/**
* Return iterator reference next element.
* @param it_iter current iterator.
* @return next iterator.
* @remarks it_iter and next iterator must be valid iterator, otherwise the behavior is undefined.
*/
extern multiset_iterator_t _multiset_iterator_next(multiset_iterator_t it_iter);
/**
* Return iterator reference previous element.
* @param it_iter current iterator.
* @return previous iterator.
* @remarks it_iter and previous iterator must be valid iterator, otherwise the behavior is undefined.
*/
extern multiset_iterator_t _multiset_iterator_prev(multiset_iterator_t it_iter);
/**
* Test the two multiset iterator are equal.
* @param it_first multiset iterator.
* @param it_second multiset iterator.
* @return true, if the two iterator are equal, else return false.
* @remarks the two iterator must be valid multiset iterator, otherwise the behavior is undefined.
*/
extern bool_t _multiset_iterator_equal(multiset_iterator_t it_first, multiset_iterator_t it_second);
/**
* Calculate distance between two iterators.
* @param it_first multiset iterator.
* @param it_second multiset iterator.
* @return distance.
* @remarks the two iterator must be valid multiset iterator, and must be belong to same multiset, otherwise the behavior
* is undefined. the result distance may be less than 0, equal to 0 or greater than 0.
*/
extern int _multiset_iterator_distance(multiset_iterator_t it_first, multiset_iterator_t it_second);
/**
* Test the first iterator is before the second.
* @param it_first multiset iterator.
* @param it_second multiset iterator.
* @return true, if the first iterator is before the second, else return false.
* @remarks the two iterator must be valid multiset iterator, and must be belong to same multiset, otherwise the behavior
* is undefined.
*/
extern bool_t _multiset_iterator_before(multiset_iterator_t it_first, multiset_iterator_t it_second);
#ifdef __cplusplus
}
#endif
#endif /* _CSTL_MULTISET_ITERATOR_H_ */
/** eof **/